Retrieving Author of the Message
Some time it's useful to get the author of a message.
For those cases Discapp provides you a quick way of retrieving the author of the message that invoked the command.
In this chapter we will improve the PokeCommand from the Mention Arguments section.
Improving PokeCommand.ts#
path/to/your/app/src/Commands/PokeCommand.ts
For getting the author of the message, just declare a property and mark it with the @Author() decorator.
Testing PokeCommand#
When sending:
You should receive ๐ and the bot should send (your username) just poked (your username) in the server.