discord.ts icon indicating copy to clipboard operation
discord.ts copied to clipboard

CommandMessage: commandContent ("-cmd hello there" => "hello there")

Open owengombas opened this issue 5 years ago • 3 comments
trafficstars

this is example of command

-cmd hello there I know we can read the parameters by slug cmd :text :text2

but I wish to read full text hello there

I can replace -cmd

but is there any alternative solution?

By Harry

owengombas avatar Jun 04 '20 16:06 owengombas

Done https://github.com/OwenCalvin/discord.ts/commit/4af0a233bd1c703a8710441e12673525437b6d93

owengombas avatar Jun 04 '20 22:06 owengombas

there is a problem with commit, command.commandContent is only output without prefix only

current passed regex for command `-cmd hello there`` is

/^-/i

expected output

/^-([\w-]+)\s

samarmeena avatar Jun 05 '20 00:06 samarmeena

message.content.split(' ').slice(1).join(' ')

orangixx avatar Dec 08 '20 03:12 orangixx