Closed JAVAB3ANS closed 3 years ago
Holup this bot shouldn't really have this command lol. Also what was the issue it was having before?
It had an issue like this with the normal code:
Something along the lines of this as well:
To be honest, announce.js
still pretty good for modmail bot though -- serves its purpose well in a super configurable way 💯
Command works as intended when used correctly. While I think I could make it more user friendly, an announce command is not of the highest priority for a Modmail system. I am also not a huge fan of commands with too many arguments (4-5 is quite a lot). Which is why I made this command to intake JSON generated from tools such as an embed visualizer.
Proper usage would be [p]announce embed #channel-to-send
Bot will then say: @User, Please provide some body text (embed format) Respond with cancel to cancel the command. The command will automatically be cancelled in 30 seconds.
This is where I would send my entire JSON body all formatted in one single message instead of multiple arguments.
{
"title": "title ~~(did you know you can have markdown here too?)~~",
"description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
"url": "https://discordapp.com",
"color": 14293695,
"timestamp": "2021-05-11T20:17:33.775Z",
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "footer text"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"image": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"author": {
"name": "author name",
"url": "https://discordapp.com",
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"fields": [
{
"name": "🤔",
"value": "some of these properties have certain limits..."
},
{
"name": "😱",
"value": "try exceeding some of them!"
},
{
"name": "🙄",
"value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
},
{
"name": "<:thonkang:219069250692841473>",
"value": "these last two",
"inline": true
},
{
"name": "<:thonkang:219069250692841473>",
"value": "are inline fields",
"inline": true
}
]
}
And that outputs:
This allows users to create little templates and copy and paste and use as needed giving them access to all the fields they want in an embed and only limited by Discord's 2000 character limit. Like I said, not very user friendly, unless you are familiar with JSON syntax, but if there are more requests to make something more user friendly I will consider it. I will also update the documentation in the help command to make it more clear.
Ye great stuff boss
There was a bit of trouble with Modmail
announce.js
code so here's my spin on it to help with the issue:Let me know your thoughts boss :)