old_contents: import discord
  import json
  import random
  import html
  from datetime import datetime, timezone
  from discord.ext import commands
  
  
  class Trump(commands.Cog):
      """ A cog which nobody ever asked for, that fetches a random Trump tweet """
  
      with open("data/trump.json", encoding="utf8") as f:
          TRUMP_JSON = json.load(f)
      THUMB_URLS = (
          "https://i.imgur.com/36idZdn.png",
          "https://eastscroll.com/wp-content/uploads/2017/02/Donald-Trump-cutout.png",
          "http://pngimg.com/uploads/donald_trump/donald_trump_PNG20.png",
          "https://basicgestalt.files.wordpress.com/2017/07/trumphead3.png?w=234&h=333",
      )
      FOOTER_URL = (
          "http://icons.iconarchive.com/icons/uiconstock/socialmedia/512/Twitter-icon.png"
      )
      TWITTER_STATUS_URL = "https://twitter.com/statuses/{}"
  
      def __init__(self, bot):
          self.bot = bot
  
      @staticmethod
      def _to_datetime(time: str) -> datetime:
          """Small helper which converts twitter TZs to a datetime obj
  
          Relevant SO answer found here
          https://stackoverflow.com/questions/7703865/going-from-twitter-date-to-python-datetime-date"""
          return datetime.strptime(time, "%a %b %d %H:%M:%S %z %Y").replace(
              tzinfo=timezone.utc
          )
  
      @commands.command(aliases=["tweet", "twit", "tt"])
      async def trump(self, ctx):
          """ Get a random Trump tweet """
          icon_url = random.choice(self.THUMB_URLS)
          tweet_json = random.choice(self.TRUMP_JSON)
  
          # Create the embed
          em = discord.Embed(
              color=0x00BEF5, url=self.TWITTER_STATUS_URL.format(tweet_json["id_str"])
          )
          em.description = html.unescape(tweet_json["text"])
          em.set_author(name="Donald J. Trump \U00002611", icon_url=icon_url)
          em.add_field(name="Retweets", value=tweet_json["retweet_count"])
          em.add_field(name="Likes", value=tweet_json["favorite_count"])
          em.timestamp = self._to_datetime(tweet_json["created_at"])
          em.set_footer(text=tweet_json["source"], icon_url=self.FOOTER_URL)
  
          await ctx.send(embed=em)
  
  
  def setup(bot):
      bot.add_cog(Trump(bot))
  
new_contents: import discord
  import random
  
  from dateutil.parser import parse
  from urllib.parse import quote_plus
  from discord.ext import commands
  from discord.utils import escape_markdown
  from utils.aiohttp_wrap import aio_get_json
  
  
  class Trump(commands.Cog):
      """ A cog which nobody ever asked for, that fetches a random Trump tweet """
  
      RAND_URL = "https://api.tronalddump.io/random/quote"
      SEARCH_URL = "https://api.tronalddump.io/search/quote"
      PIC_URL = "https://www.tronalddump.io/img/tronalddump_850x850.png"
  
      @commands.command(name="trump", aliases=["tt"])
      async def _trump(self, ctx: commands.Context, *, query: str = None):
          """Get a random, dumb Trump quote -- alternatively, search for something similarly stupid he's said
  
          Args:
              ctx (commands.Context): Message context
              query (str, optional): Optional query. Defaults to None.
          """
          if query:
              search_results = await aio_get_json(
                  ctx.bot.aio_session,
                  self.SEARCH_URL,
                  params={"query": quote_plus(query)},
              )
              if search_results is None:
                  return await ctx.error(
                      "Couldn't communicate with our dear leader",
                      description="Please try again later -- or don't.",
                  )
              if search_results["count"] == 0:
                  return await ctx.error(
                      "No results",
                      description=f"Couldn't find any Trumpisms on `{escape_markdown(query)}`",
                  )
              
              resp = random.choice(search_results["_embedded"]["quotes"])
          else:
              resp = await aio_get_json(ctx.bot.aio_session, self.RAND_URL)
          
          em = discord.Embed(color=0x00acee)
          em.set_author(name="Donald Trump", icon_url=self.PIC_URL, url=resp["_embedded"]["source"]["url"])
          em.description = resp["value"]
          em.timestamp = parse(resp["appeared_at"])
          em.set_footer(text="via twitter", icon_url="https://i.imgur.com/DUUkDwY.png")
  
  
  def setup(bot):
      bot.add_cog(Trump(bot))
  
subject: change method of accessing trump tweets