-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord Webhooks #554
Comments
Hi @gaurishhs, we appreciate your input and I agree, the addition of webhooks does make a lot of sense! I don't agree however with your statement For plain notifications you're absolutely right that webhooks are the more suitable solution, which is why I'd like to include them. We won't however remove the support for Discord bots. How do you feel about adding a Using a Discord Bot: // Keep the existing constructor function to avoid a breaking change
discordBot, _ := discord.New()
// Add a bot constructor alias for explicity and consistency
discordBot, _ = discord.NewBot() Using a Discord Webhook: // Initialize a new service with a single Discord webhook
singleDiscordWebhook := discord.NewWebhook("https://some-url.here")
// Initialize a new service with multiple webhooks
multiDiscordWebhooks := discord.NewWebhook("https://some-url.here", "https://and-another-url.here") If you do decide to add this to the library, please take a look at our internal HTTP service and use it for your implementation. A great usage example can be seen in #516. We'd greatly appreciate your contribution. Let me know if there's anything I can help you with! |
Ah yes, I'm sorry. I was just taking a first look at this library (thanks for this its really useful) and after taking a look at the http service i don't think so theres a need for seperate function since this will increase the size. I made the webhook thing functional by utilising the Discord Webhook API and the http service with a custom |
@gaurishhs that's great to hear! Did the HTTP servce work well for you? I'm still inclined of adding this to the library as it reuses existing code, meaning no additional logic we have to maintain and at the same time makes the library or the discord service in particular more accessible. |
Yes, It worked for me |
Is your feature request related to a problem? Please describe.
Discord already has Webhooks for notifications, It makes no sense to use gateway (bot sessions) to send notifications
Describe the solution you'd like
Instead of using
discordgo
Use simple HTTP post requests to post to a discord webhookDescribe alternatives you've considered
Shoutrrr uses discord webhooks https://containrrr.dev/shoutrrr/0.7/services/discord/
Additional context
I'm willing to make a PR for this.
Discord Webhook Documentation
The text was updated successfully, but these errors were encountered: