-
Notifications
You must be signed in to change notification settings - Fork 5
Send a ping to mods in a new channel when a ban appeal form in submitted #397
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
base: dev
Are you sure you want to change the base?
Conversation
Sends a ping to mods in a new channel when a ban appeal form is submitted through the website, added new optional ENV variable for new ban appeal forms channel and new constant for mod role ID. Closes: #360
|
also closes #398 |
| body = { | ||
| "content": f"<@&{RoleIDs.MOD}> ", | ||
| "allowed_mentions": {"parse": ["roles"]}, | ||
| "embeds": [ | ||
| { | ||
| "title": "Ban Appeal Submitted", | ||
| "description": ( | ||
| f"Ban appeal form submitted by <@{request.user_id}> " | ||
| f"(form ID: {result})." | ||
| ), | ||
| "fields": [ | ||
| { | ||
| # TODO: Add character limiting; fails to send on more than 1024 characters | ||
| "name": "Reason", | ||
| "value": request.reason, | ||
| "inline": False, | ||
| }, | ||
| { | ||
| "name": "Submission", | ||
| "value": f"To view request details, please refer to the [mod portal](https://naurffxiv.com/mod-portal/unban-appeals/).", # add {result} to end of link when forms are functioning to link directly to requested form | ||
| "inline": False, | ||
| }, | ||
| ], | ||
| "footer": {"text": f"ID: {request.user_id}"}, | ||
| "timestamp": datetime.now(timezone.utc).isoformat(), | ||
| } | ||
| ], | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like this body is too big to be in this function. and honestly i think we can probably benefit a lot if we make this into a class since i would expect we would making a lot more api calls later... although now that i'm thinking about it more, discord.py should be able to send all of this data without doing all of headers and body stuff (see how we make the logging embed)
Sends a ping to mods in a new channel when a ban appeal form is submitted through the website, added new optional ENV variable for new ban appeal forms channel and new constant for mod role ID. Closes: #360