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

Invalid String Format on Builder's .setName() #8781

Closed
Neodevils opened this issue Oct 23, 2022 · 3 comments · Fixed by #8783
Closed

Invalid String Format on Builder's .setName() #8781

Neodevils opened this issue Oct 23, 2022 · 3 comments · Fixed by #8783

Comments

@Neodevils
Copy link
Contributor

Which package is this bug report for?

discord.js

Issue description

  1. Used "—" on context user menu builder.
  2. Special chars occurs ExpectedConstraintError: Invalid string format error.

Code sample

import { ContextMenuCommandBuilder, ApplicationCommandType } from "discord.js";

export default {
    data: new ContextMenuCommandBuilder().setName("— User Avatar").setType(ApplicationCommandType.User),
    run: async (client, interaction) => {
        const target = interaction.guild.members.cache.get(interaction.targetId);

        await interaction.reply({
            content: `>>> ${target.user.avatarURL({ dynamic: true, extension: "jpg", size: 4096 })}`,
            ephemeral: true,
        });
    },
};

Package version

discord.js@14.6.0

Node.js version

v18.8.0

Operating system

Windows

Priority this issue should have

Low (slightly annoying)

Which partials do you have configured?

User, Channel, GuildMember, Message, Reaction

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildVoiceStates, GuildMessages, MessageContent

I have tested this issue on a development release

No response

@Jiralite
Copy link
Member

Copied and pasted without builders and the command is successfully created.

@Neodevils
Copy link
Contributor Author

Copied and pasted without builders and the command is successfully created.

The problem is with builders. It's occuring error on builders.

@Jiralite
Copy link
Member

Yes, I'm just stating that this is a bug.

@kodiakhq kodiakhq bot closed this as completed in #8783 Oct 31, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants