JohnnyJayJay / instant-poll

A Discord bot that lets you create polls in your server
MIT License
42 stars 9 forks source link

Support for custom emoji #1

Closed pmonks closed 2 years ago

pmonks commented 3 years ago

As a poll creator, I would like to be able to include custom emoji in my polls (both questions and answers), so that the polls I create can be tailored to my server.

JohnnyJayJay commented 3 years ago

I'm afraid this isn't trivial.

In order for the bot to use custom emojis in its messages, it needs to be a member of the server, which is not the default for this app. You can add it as a regular bot, then this isn't shouldn't be a problem anymore. However, when I tried this, I noticed that Discord, for some reason, removes all emoji mentions when editing the poll message, which means they disappear as soon as someone votes. I believe this is a bug and I will open an issue over at Discord to hopefully get this fixed.

One thing that has official support and works without inviting the bot to your server already is a single emoji at the beginning of a button. This is something I could already implement, the question then is how that should be parsed. If the very first part of a response is an emoji mention, maybe?

JohnnyJayJay commented 3 years ago

Okay, an update on this: It does work, even with edits, when the bot is a member of the server. So If you want to use custom emojis in your question/options, you just have to make sure the app has the bot OAuth2 scope on the server the emoji is from. Use this link to do this.

I just opened an issue concerning custom emojis when the bot is not on the server and when messages are edited. Depending on what happens to this issue, you might be able to use arbitrary custom emojis without inviting the bot in the future. @pmonks

JohnnyJayJay commented 3 years ago

You can now use custom emojis in question and option texts without limits, the Discord bug has been fixed. I will keep this open for the "emoji on buttons" feature.