Skip to content

Instantly share code, notes, and snippets.

View thomasianwright's full-sized avatar

Thomas Wright thomasianwright

View GitHub Profile
@thomasianwright
thomasianwright / ExampleModule.cs
Last active January 4, 2021 16:08
Discord.NET example 'userinfo' command. With Spotify, rich presence & custom game.
[Command("userinfo")]
[RequireContext(ContextType.Guild, ErrorMessage = "Sorry, this command must be ran from within a server, not a DM!")]
public async Task UserInfoAsync(SocketGuildUser user = null)
{
user = (SocketGuildUser) (user ?? Context.User);
_logger.Log(LogLevel.Warning, user.Username);
if (user.IsBot)
{
await ReplyAsync("Bots are not people :D");
return;