Refaction all files into component based folders

This commit is contained in:
runebaas 2018-05-03 00:56:06 +02:00
parent 55e152f4aa
commit e3adf55742
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
102 changed files with 816 additions and 709 deletions

View file

@ -0,0 +1,44 @@
using System;
using System.Threading.Tasks;
using Discord.Commands;
using Geekbot.net.Lib;
using Geekbot.net.Lib.Converters;
using Geekbot.net.Lib.ErrorHandling;
namespace Geekbot.net.Commands.Utils
{
public class Emojify : ModuleBase
{
private readonly IEmojiConverter _emojiConverter;
private readonly IErrorHandler _errorHandler;
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 emojis = _emojiConverter.TextToEmoji(text);
if (emojis.Length > 1999)
{
await ReplyAsync("I can't take that much at once!");
return;
}
await ReplyAsync($"{Context.User.Username}#{Context.User.Discriminator} said:");
await ReplyAsync(emojis);
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
}
}
}
}