mrbbot / slshx

⚔️ Strongly-typed Discord commands on Cloudflare Workers
MIT License
210 stars 9 forks source link

send modal submission to another channel? #9

Closed RedSpid3r closed 2 years ago

RedSpid3r commented 2 years ago

is it possible to send the submitted data from a modal to another channel?

I can do this with other interactions with things like Discord.JS but i'm struggling a little with this - and help/info would be appreciated :)

Also apologies if this isn't the best place for general help requests, I didn't see any other options!

mrbbot commented 2 years ago

Hey! 👋

You'll need to call the Discord API directly to do this at the moment. I'd like to add higher-level functions for this in the future though.

To send a message to a channel as a bot: https://discord.com/developers/docs/resources/channel#create-message. See the call function documentation: https://github.com/mrbbot/slshx#missing-apis. Note you'll need a bot token and user for this I think.

You could also send a message to a channel via a webhook: https://discord.com/developers/docs/resources/webhook#execute-webhook

RedSpid3r commented 2 years ago

Thank you, i'll give that a try!