sylveon / discord-ban-appeals

Sample ban appeals page with OAuth2 integration
https://discord-ban-appeal-preview.netlify.app/
MIT License
137 stars 45 forks source link

Unknown error after submitting the ban appeal. #49

Closed OldJamieIsGeek closed 2 years ago

OldJamieIsGeek commented 2 years ago

Hey so I have followed all setup steps listed however when I click the submit button on the ban appeal i get this error message:

{"errorType":"Error","errorMessage":"Failed to submit message","trace":["Error: Failed to submit message"," at Runtime.handler (/var/task/func/submit-appeal.js:8530:13)"," at processTicksAndRejections (internal/process/task_queues.js:95:5)"]}

Any ideas, everything else works fine however the appeal never gets sent due to that error

jcsumlin commented 2 years ago

I would check your bot token and permissions first make sure those are correct then trigger a redeploy to ensure they are set in your environment. Netlify will not redeploy you site when you change those environment variables

OldJamieIsGeek commented 2 years ago

The bot has the Administrator permission so I don't think its the bots permissions, I have just replaced the discord token and redeployed it. Should the bot come online at this point or no? currently with the application deployed the bot is not online!

jcsumlin commented 2 years ago

The bot will never be "online" but that's expected behavior

OldJamieIsGeek commented 2 years ago

I have redeployed the bot after updating the token and tried again but I am still getting that same issue

jcsumlin commented 2 years ago

I may be missing something but that trace points to a file (submit-appeal.js) that doesn't exist

OldJamieIsGeek commented 2 years ago

Yep, I was wondering where that file was, I haven't modified the source code in any way, I just clicked the button that was on the README.md and put in the variables it asked for.

sylveon commented 2 years ago

It's submission-created.js, it gets renamed at build time: https://github.com/sylveon/discord-ban-appeals/blob/e041d25dafae99e4c5f71bca615f5c6c9b65f893/build.js#L38

This is because Netlify Forms wants that exact name and I don't believe I can use that name when Netlify Forms is disabled.

sylveon commented 2 years ago

Make sure the channel and server ID is correct, and that the bot joined the server

jcsumlin commented 2 years ago

I would suggest deleting the Netlify site and re-deploying it after TRIPPLE checking your env variables. I just did a deployment of my own and got it working first try. the only thing I added was the SKIP_BAN_CHECK environment variable so I could test it without banning myself.

It's submission-created.js, it gets renamed at build time:

https://github.com/sylveon/discord-ban-appeals/blob/e041d25dafae99e4c5f71bca615f5c6c9b65f893/build.js#L38

This is because Netlify Forms wants that exact name and I don't believe I can use that name when Netlify Forms is disabled.

ah, neat @sylveon! good to know

OldJamieIsGeek commented 2 years ago

Yep, recreating the Netlify site and redeploying it worked, thanks very much for your help!