diff options
| author | 2020-10-03 13:38:45 +0530 | |
|---|---|---|
| committer | 2020-10-03 13:39:12 +0530 | |
| commit | 0cc321f5694c0366297f1d46ba160d65853732a9 (patch) | |
| tree | cb7ad01109858bbe988438da8ef9bd99998863af /bot/exts | |
| parent | final changes (diff) | |
made code more consistent
Diffstat (limited to 'bot/exts')
| -rw-r--r-- | bot/exts/evergreen/githubinfo.py | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index 2a540bac..f52454ba 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -1,4 +1,5 @@  import logging +import random  from datetime import datetime  from typing import Optional @@ -7,6 +8,8 @@ import discord  from discord.ext import commands  from discord.ext.commands.cooldowns import BucketType +from bot.constants import NEGATIVE_REPLIES +  log = logging.getLogger(__name__) @@ -38,13 +41,12 @@ class GithubInfo(commands.Cog):              return          async with ctx.typing(): -              user_data = await self.fetch_data(f"https://api.github.com/users/{username}")              # User_data will not have a message key if the user exists              if user_data.get('message') is not None: -                await ctx.send(embed=discord.Embed(title=f"The profile for `{username}` was not found.", -                                                   colour=0xff0022)) +                await ctx.send(embed=discord.Embed(title=random.choice(NEGATIVE_REPLIES), +                                                   colour=discord.Colour.red()))                  return              org_data = await self.fetch_data(user_data['organizations_url']) @@ -64,7 +66,7 @@ class GithubInfo(commands.Cog):              embed = discord.Embed(                  title=f"`{user_data['login']}`'s GitHub profile info",                  description=f"```{user_data['bio']}```\n" if user_data['bio'] is not None else "", -                colour=0xf5faf6, +                colour=0x7289da,                  url=user_data['html_url'],                  timestamp=datetime.strptime(user_data['created_at'], "%Y-%m-%dT%H:%M:%SZ")              )  |