owengombas / discord.ts

🤖 Create your discord bot by using TypeScript and decorators!
https://owencalvin.github.io/discord.ts/
325 stars 40 forks source link

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

Open owengombas opened 4 years ago

owengombas commented 4 years ago

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 commented 4 years ago

Done [https://github.com/OwenCalvin/discord.ts/commit/4af0a233bd1c703a8710441e12673525437b6d93]()

vijayymmeena commented 4 years ago

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

orangixx commented 3 years ago

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