Finalize poll command and add emojify command (the fuck am i doing with my life)
This commit is contained in:
parent
ea76629d6e
commit
f96954a7e1
3 changed files with 124 additions and 14 deletions
37
Geekbot.net/Commands/Emojify.cs
Normal file
37
Geekbot.net/Commands/Emojify.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue