Skip to content
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" vs. "discordapp" in discord.go #87

Closed
droberson opened this issue Oct 6, 2021 · 2 comments · Fixed by #90 or #95
Closed

"discord" vs. "discordapp" in discord.go #87

droberson opened this issue Oct 6, 2021 · 2 comments · Fixed by #90 or #95
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed.

Comments

@droberson
Copy link

It appears that discord.go expects DiscordWebHookURL to use "discord.com" as the domain for webhook URLs: https://github.com/projectdiscovery/notify/blob/master/pkg/providers/discord/discord.go#L43

Copying a webhook's URL from Discord's settings currently yields an URL with "discordapp.com." Pasting webhook URLs copied from Discord into provider-config.yaml results in the following error when running notify:

[ERR] failed to send discord notification for id: alert : token missing from config URL

Changing "discordapp.com" in the webhook's URL to the expected "discord.com" results in a valid configuration.

I am not sure if, at one point in time, Discord used "discord.com" instead of "discordapp.com" for webhook URLs or if this was a typo.

Trimming both "https://discord.com/api/webhooks/" and "https://discordapp.com/api/webhooks/" from the discordTokens variable seems like an easy solution that would not break existing configurations and also allow pasting webhook URLs copied directly from Discord.

@IlluminatiFish
Copy link
Contributor

discordapp.com is the legacy domain for discord, therefore most if not all their webhooks should be on the discord.com domain from now. Realistically I think checking against a regex pattern would be the best course of action here.

@ehsandeep ehsandeep added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Oct 10, 2021
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Oct 22, 2021
ehsandeep added a commit that referenced this issue Oct 22, 2021
add support for discord webhook URL with legacy domain discordapp.com
@ehsandeep
Copy link
Member

@droberson this is now fixed in the dev version, both domains are allowed now in the config file, you can install the dev version with go install -v github.com/projectdiscovery/notify/cmd/notify@dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed.
Projects
None yet
4 participants