pipedream
pipedream copied to clipboard
[TRIGGER] discord
Part of #3332
Hi, I would like to on this one, you think. Can I give it a try?
Hi, I would like to on this one, you think. Can I give it a try?
Definitely! Please check out #3332 for context, and if you have any questions, our docs are a good place to get started, and the #contribute channel in our community Slack is the best place to ask for help.
Thanks I'll let you know any updates
I was analyzing the code where you use the managed auth (discord, discord_bot, discord_webhook ) for discord sources or actions and from what I understood, the refactor its only needed in the sources that use the discord
app prop because:
a) discord_webhook
is only used by actions.
b) The sources that uses discord_bot
already fetch the most recent 100 messages/guild members and emits them.
Doing some tests with New Message
(the only source that uses the discord
app prop) it seems to me that the creation of the webhook is probably already implemented by the discordApphook
prop (I couldn't find anything in the documentation regarding the syntax of that prop).
The problem I find is that according to the discord documentation, in order to send messages from a channel to the discord API, I need to first create an application
and then a bot
to obtain a bot token
(as you instructions indicate when you use the discord_bot
app prop for managed auth).
I was considering trying to handle the authentication and the process to create the bot inside manually (not using the managed auth provided by you), but I don't feel like it's a good solution.
So I wanted to ask if you have any examples where a similar situation has arisen to see if I can try something similar.
Lastly, I noticed that the fetching of historical events on sources using discord_bot
happens in the run method. Should I refactor that part so that functionality is inside the deploy hook?
Thanks for digging in @gcamach0! Very astute observations.
Are you able to fetch recent messages to the specified channel using the discord
app prop?
No because it doesn't prompt you to follow the steps to get the Bot Token
which is needed to make request to the API like the discord_bot
app prop does.
Hello @jcortes boss, as you have been the the major contributor of our discord app, would you mind helping @gcamach0 on his questions here above?
@gcamach0 may I ask if you have time to handle this, or do you want our component dev to take over?
I'm moving this back to TODO for our component dev to take over as there's no response. @gcamach0 Kindly comment to this Github issue if you want to handle it again 🙏
Having recently worked on Discord components, I believe @gcamach0 is correct. We'll need $auth
to contain the "Bot Token" in order to make requests to the rest api.
I have time to work on this, but I don't know how can I help regarding the bot token situation.
The Discord Bot app now provides the bot token:
https://www.youtube.com/watch?v=UODtCjkqMQw