From 0adb4b99f2e755f8227dfa9a7c0d759671f36214 Mon Sep 17 00:00:00 2001 From: Daan Date: Thu, 18 Jan 2018 14:40:06 +0000 Subject: [PATCH] Remove !trump command --- Geekbot.net/Commands/Trump.cs | 73 ----------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 Geekbot.net/Commands/Trump.cs diff --git a/Geekbot.net/Commands/Trump.cs b/Geekbot.net/Commands/Trump.cs deleted file mode 100644 index ad87f51..0000000 --- a/Geekbot.net/Commands/Trump.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Threading.Tasks; -using Discord; -using Discord.Commands; -using Geekbot.net.Lib; - -namespace Geekbot.net.Commands -{ - public class Trump : ModuleBase - { - private readonly IErrorHandler _errorHandler; - - public Trump(IErrorHandler errorHandler) - { - _errorHandler = errorHandler; - } - - [Command("trump", RunMode = RunMode.Async)] - [Remarks(CommandCategories.Games)] - [Summary("Get a trump quote")] - public async Task getQuote() - { - try - { - using (var client = new WebClient()) - { - var url = new Uri("https://api.tronalddump.io/random/quote"); - var response = client.DownloadString(url); - var quote = Utf8Json.JsonSerializer.Deserialize(response); - - var eb = new EmbedBuilder(); - eb.WithTitle($"Trump @ {quote.appeared_at.Day}.{quote.appeared_at.Month}.{quote.appeared_at.Year}"); - eb.WithDescription(quote.value); - eb.WithUrl(quote._embedded.source.FirstOrDefault()?.url.ToString()); - eb.WithColor(new Color(143, 167, 232)); - await ReplyAsync("", false, eb.Build()); - } - } - catch (Exception e) - { - _errorHandler.HandleCommandException(e, Context); - } - } - - public class TrumpQuote - { - public DateTimeOffset appeared_at { get; set; } - public DateTimeOffset created_at { get; set; } - public string quote_id { get; set; } - public DateTimeOffset updated_at { get; set; } - public string value { get; set; } - public Embedded _embedded { get; set; } - - public class Embedded - { - public List source { get; set; } - - public class Source - { - public DateTimeOffset created_at { get; set; } - public string filename { get; set; } - public string quote_source_id { get; set; } - public string remarks { get; set; } - public DateTimeOffset updated_at { get; set; } - public Uri url { get; set; } - } - } - } - } -} \ No newline at end of file