Use regex\' global flag

This commit is contained in:
Ecolipsy 2021-12-02 17:02:00 +01:00
parent 329faa1fd6
commit 3ab4a66488

View file

@ -61,7 +61,7 @@ client.on("interactionCreate", (int) => {
if(int.commandName == "ping"){ if(int.commandName == "ping"){
int.reply(`Pong! (${client.ws.ping} ms)`); int.reply(`Pong! (${client.ws.ping} ms)`);
} else if(int.commandName == "rps"){ } else if(int.commandName == "rps"){
var shape = int.options.getString("firstmove").toLowerCase().replace("", ""); var shape = int.options.getString("firstmove").toLowerCase().replace(//g, "");
if(!shapes.includes(shape)) return int.reply("That isn't a valid shape."); if(!shapes.includes(shape)) return int.reply("That isn't a valid shape.");
var msgRow = new dc.MessageActionRow(); var msgRow = new dc.MessageActionRow();
var rockButton = new dc.MessageButton(); var rockButton = new dc.MessageButton();