Finalize poll command and add emojify command (the fuck am i doing with my life)

This commit is contained in:
Runebaas 2017-11-08 01:30:50 +01:00
parent ea76629d6e
commit f96954a7e1
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
3 changed files with 124 additions and 14 deletions

View file

@ -0,0 +1,37 @@
using System;
using System.Text;
using System.Threading.Tasks;
using Discord.Commands;
using Geekbot.net.Lib;
namespace Geekbot.net.Commands
{
public class Emojify : ModuleBase
{
private readonly IErrorHandler _errorHandler;
private readonly IEmojiConverter _emojiConverter;
public Emojify(IErrorHandler errorHandler, IEmojiConverter emojiConverter)
{
_errorHandler = errorHandler;
_emojiConverter = emojiConverter;
}
[Command("emojify", RunMode = RunMode.Async)]
[Remarks(CommandCategories.Helpers)]
[Summary("Emojify text")]
public async Task Dflt([Remainder, Summary("text")] string text)
{
try
{
var sb = new StringBuilder();
await ReplyAsync($"*{Context.User.Username}#{Context.User.Discriminator} said:*");
await ReplyAsync(_emojiConverter.textToEmoji(text));
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
}
}
}
}