Urban Dictionary command, small improvents in message handler, emojis are in embeds now, avatar command
This commit is contained in:
parent
667d928ca4
commit
45f289d071
7 changed files with 168 additions and 27 deletions
37
Geekbot.net/Commands/AvatarGetter.cs
Normal file
37
Geekbot.net/Commands/AvatarGetter.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Geekbot.net.Lib;
|
||||
|
||||
namespace Geekbot.net.Commands
|
||||
{
|
||||
public class AvatarGetter : ModuleBase
|
||||
{
|
||||
private readonly IErrorHandler _errorHandler;
|
||||
|
||||
public AvatarGetter(IErrorHandler errorHandler)
|
||||
{
|
||||
_errorHandler = errorHandler;
|
||||
}
|
||||
|
||||
[Command("avatar", RunMode = RunMode.Async)]
|
||||
[Remarks(CommandCategories.Randomness)]
|
||||
[Summary("Get someones avatar")]
|
||||
public async Task getAvatar([Remainder, Summary("user")] IUser user = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
user = Context.User;
|
||||
}
|
||||
await ReplyAsync(user.GetAvatarUrl());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_errorHandler.HandleCommandException(e, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue