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

[Feature Request] Add emotes / roles without exceeding 1024 character limit #21

Open
valkyrienyanko opened this issue Oct 6, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@valkyrienyanko
Copy link
Collaborator

Message should display first x roles / emotes without exceeding the 1024 character limit whilst keeping track of all the characters in the roles / emotes / description among any other characters in the message.

For reference old emote display code.

{
    name: `Emojis: \`${message.guild.emojis.cache.size}\``,
    value: message.guild.emojis.cache.size === 0 ? 'No Emotes' : `${guildInfo.emojis.join(' ')}`,
    inline: false
}
@valkyrienyanko valkyrienyanko added the enhancement New feature or request label Oct 6, 2020
@valkyrienyanko valkyrienyanko added good first issue Good for newcomers help wanted Extra attention is needed labels Oct 17, 2020
@m-bobi
Copy link

m-bobi commented Aug 1, 2021

const embeds = new Array()
const charactersPerMessage = 2000;
// we're going to go with 2000 instead of 2048 for breathing room
const emojis2 = message.guild.emojis.cache.map(e => { return `${e} = \`:${e.name}:\`\n\n` }).join('');
const numberOfMessages = Math.ceil(emojis2.length / charactersPerMessage); // calculate how many messages we need

        for (i = 0; i < numberOfMessages; i++) {
            embeds.push(embed.setDescription(`${emojis2.slice(i * charactersPerMessage, (i + 1) * charactersPerMessage)}`))
        }`

Could this be what you're trying to do?

@valkyrienyanko
Copy link
Collaborator Author

@Yohanfrm3 At the time this issue was created I believe the Discord character limit per message was 1024. I'm working on several other projects right now, if you think this solves this issue, please test it out first and then create a PR and I'll merge it.

@m-bobi
Copy link

m-bobi commented Aug 1, 2021

@Yohanfrm3 At the time this issue was created I believe the Discord character limit per message was 1024. I'm working on several other projects right now, if you think this solves this issue, please test it out first and then create a PR and I'll merge it.

will do, and yes you are right it used to be 1024, its now been raised to 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants