Skip to content

Instantly share code, notes, and snippets.

@compil3
Created June 16, 2020 04:32
Show Gist options
  • Save compil3/994d6109bc6844b7e9b58e0f63e36d67 to your computer and use it in GitHub Desktop.
Save compil3/994d6109bc6844b7e9b58e0f63e36d67 to your computer and use it in GitHub Desktop.
private async Task HandleCommand(SocketMessage messageParam)
{
var message = messageParam as SocketUserMessage;
if (message == null) return;
var argPos = 0;
if (!(message.HasCharPrefix('.', ref argPos) ||
message.HasMentionPrefix(_discord.CurrentUser, ref argPos)) || message.Author.IsBot) return;
var context = new SocketCommandContext(_discord, message);
var result = await _commands.ExecuteAsync(context, argPos, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment