Skip to content

Added RespondWithDmAsync method to CommandContext

Mateusz Brawański requested to merge github/fork/igromanru/master into master

Created by: igromanru

Summary

Implemented a simple function in CommandContext that allows us quickly respond to a message with a DM to the author of the message.

Details

Method CommandContext.RespondWithDmAsync checks for us, if the user sent a command/message over a channel or as a DM to the bot and uses the right function to respond in a DM to the user.

if (this.Member != null)
{
	this.Member.SendMessageAsync(...);
}
else
{
	this.RespondAsync(...);
}

Changes proposed

  • Added method RespondWithDmAsync to the class CommandContext

Notes

This is just a simple "quality of life improvement". I'm using it a lot in my bot to send sensitive data to the user.

Merge request reports

Loading