Code Cleanup, thanks resharper
This commit is contained in:
parent
00035ac4b1
commit
813698394a
34 changed files with 298 additions and 325 deletions
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Geekbot.net.Lib;
|
||||
|
||||
|
@ -9,38 +7,31 @@ namespace Geekbot.net.Commands
|
|||
{
|
||||
public class Emojify : ModuleBase
|
||||
{
|
||||
private readonly IErrorHandler _errorHandler;
|
||||
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)
|
||||
public async Task Dflt([Remainder] [Summary("text")] string text)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var emojis = _emojiConverter.textToEmoji(text);
|
||||
if (emojis.Length > 1999)
|
||||
{
|
||||
await ReplyAsync("I can't take that much at once!");
|
||||
return;
|
||||
}
|
||||
var eb = new EmbedBuilder();
|
||||
eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
{
|
||||
IconUrl = Context.User.GetAvatarUrl(),
|
||||
Name = $"{Context.User.Username}#{Context.User.Discriminator}"
|
||||
});
|
||||
eb.WithColor(new Color(59, 136, 195));
|
||||
eb.Description = emojis;
|
||||
await ReplyAsync("", false, eb.Build());
|
||||
|
||||
await ReplyAsync($"{Context.User.Username}#{Context.User.Discriminator} said:");
|
||||
await ReplyAsync(emojis);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue