Merge pull request #46 from classabbyamp/img-improvements

more imagecog improvements
This commit is contained in:
0x5c 2019-10-18 09:26:20 -04:00 committed by GitHub
commit 6de73ac319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,17 @@ class ImageCog(commands.Cog):
with ctx.typing(): with ctx.typing():
if arg not in name: if arg not in name:
arg = 'us' desc = 'Possible arguments are:\n'
for abbrev, title in name.items():
desc += f'`{abbrev}`: {title}\n'
embed = discord.Embed(title=f'Bandplan Not Found!',
description=desc,
colour=self.gs.colours.bad,
timestamp=datetime.utcnow())
embed.set_footer(text=ctx.author.name,
icon_url=str(ctx.author.avatar_url))
await ctx.send(embed=embed)
else:
img = discord.File(f"resources/images/bandchart/{arg}bandchart.png", img = discord.File(f"resources/images/bandchart/{arg}bandchart.png",
filename=f'{arg}bandchart.png') filename=f'{arg}bandchart.png')
embed = discord.Embed(title=f'{name[arg]} Amateur Radio Bands', embed = discord.Embed(title=f'{name[arg]} Amateur Radio Bands',
@ -101,7 +111,17 @@ class ImageCog(commands.Cog):
arg = msg.lower() arg = msg.lower()
with ctx.typing(): with ctx.typing():
if arg not in map_titles: if arg not in map_titles:
arg = 'us' desc = 'Possible arguments are:\n'
for abbrev, title in map_titles.items():
desc += f'`{abbrev}`: {title}\n'
embed = discord.Embed(title=f'Map Not Found!',
description=desc,
colour=self.gs.colours.bad,
timestamp=datetime.utcnow())
embed.set_footer(text=ctx.author.name,
icon_url=str(ctx.author.avatar_url))
await ctx.send(embed=embed)
else:
img = discord.File(f"resources/images/map/{arg}map.png", img = discord.File(f"resources/images/map/{arg}map.png",
filename=f'{arg}map.png') filename=f'{arg}map.png')
embed = discord.Embed(title=f'{map_titles[arg]} Map', embed = discord.Embed(title=f'{map_titles[arg]} Map',