Discord.js: Optional comma in message reply

Created on 21 Sep 2017  路  8Comments  路  Source: discordjs/discord.js

The comma added to the message when using message.reply() does not make sense and doesn't look good. It would be nice if it was optional to add the comma or not.

invalid

All 8 comments

You can always construct the reply yourself with:

message.channel.send(`${msg.author} text here`);

and remove the comma yourself.

Of course I could do that, but using message.reply() is more convenient and making it optional isn't that much work anyway.

This is a stylistic choice and makes grammatically sense, considering you are replying to someone.
All reply() does is exactly what I have written above.

This is old, but I second this. If you changed your mind since then, that would be a simple but appreciated change. :)

If you really want a comma by default, maybe you can add an argument in the constructor?

public reply(content?: StringResolvable, options?: MessageOptions, comma?: boolean): Promise<Message | Message[]>;
public reply(content?: StringResolvable, options?: MessageOptions, comma?: boolean): Promise<Message | Message[]>;

Instead of a boolean comma argument, perhaps a string delimiter that defaults to ','? That way users could send an empty string, or a ':' if they wanted to "@BretHudson: You have failed!".

export default () =>
    Structures.extend('Message', (Message) => {
        return class MyMessage extends Message {
            public reply(content?: StringResolvable, options?: MessageOptions) {
                return this.channel.send(`${msg.author}: ${content}`, options);
            }
        };
    });

2910 might help.

@iCrawl This is fantastic, thank you!

@ItsPapaia Sweet, hope this gets merged soon! 馃槃 I was considering opening a PR, but looks like someone beat me to it haha

Was this page helpful?
0 / 5 - 0 ratings