This commit is contained in:
Abigail Gold 2019-12-10 23:48:56 -05:00
parent 25ea169bf1
commit b980c8e2fa
No known key found for this signature in database
GPG Key ID: CF88335E873C3FB4
2 changed files with 28 additions and 36 deletions

View File

@ -46,12 +46,11 @@ class LookupCog(commands.Cog):
noMatch = True noMatch = True
queryMatch = None queryMatch = None
query = query.upper() query = query.upper()
if query != 'LAST_UPDATED': embed = discord.Embed(title=f'DXCC Info for {query} not found',
embed = discord.Embed(title=f'DXCC Info for {query}',
timestamp=datetime.utcnow()) timestamp=datetime.utcnow())
embed.set_footer(text=f'{ctx.author.name} | Last Updated: {self.CTY.formatted_version}', embed.set_footer(text=f'{ctx.author.name}',
icon_url=str(ctx.author.avatar_url)) icon_url=str(ctx.author.avatar_url))
embed.description = f'Prefix {query} not found' embed.description = f'*Last Updated: {self.CTY.formatted_version}*'
embed.colour = cmn.colours.bad embed.colour = cmn.colours.bad
while noMatch: while noMatch:
if query in self.CTY.keys(): if query in self.CTY.keys():
@ -63,7 +62,7 @@ class LookupCog(commands.Cog):
noMatch = False noMatch = False
if queryMatch is not None: if queryMatch is not None:
data = self.CTY[queryMatch] data = self.CTY[queryMatch]
embed = embed.add_field(name="Entity", embed.add_field(name="Entity",
value=data['entity'])\ value=data['entity'])\
.add_field(name="CQ Zone", .add_field(name="CQ Zone",
value=data['cq'])\ value=data['cq'])\
@ -73,13 +72,8 @@ class LookupCog(commands.Cog):
value=data['continent'])\ value=data['continent'])\
.add_field(name="Time Zone", .add_field(name="Time Zone",
value=f'+{data["tz"]}' if data['tz'] > 0 else str(data['tz'])) value=f'+{data["tz"]}' if data['tz'] > 0 else str(data['tz']))
embed.description = '' embed.title = f'DXCC Info for {query}'
embed.colour = cmn.colours.good embed.colour = cmn.colours.good
else:
result = f'CTY.DAT last updated on {self.CTY.formatted_version}'
embed = discord.Embed(title=result, colour=cmn.colours.neutral)
embed.set_footer(text=f'{ctx.author.name}',
icon_url=str(ctx.author.avatar_url))
await ctx.send(embed=embed) await ctx.send(embed=embed)
@tasks.loop(hours=24) @tasks.loop(hours=24)

View File

@ -1,6 +1,4 @@
discord.py discord.py
feedparser
requests
ctyparser ctyparser
beautifulsoup4 beautifulsoup4
lxml lxml