mirror of
https://github.com/miaowware/qrm2.git
synced 2025-07-30 11:52:26 -04:00
Merge pull request #46 from classabbyamp/img-improvements
more imagecog improvements
This commit is contained in:
commit
6de73ac319
@ -34,17 +34,27 @@ 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'
|
||||||
img = discord.File(f"resources/images/bandchart/{arg}bandchart.png",
|
for abbrev, title in name.items():
|
||||||
filename=f'{arg}bandchart.png')
|
desc += f'`{abbrev}`: {title}\n'
|
||||||
embed = discord.Embed(title=f'{name[arg]} Amateur Radio Bands',
|
embed = discord.Embed(title=f'Bandplan Not Found!',
|
||||||
colour=self.gs.colours.good,
|
description=desc,
|
||||||
timestamp=datetime.utcnow())
|
colour=self.gs.colours.bad,
|
||||||
embed.set_image(url=f'attachment://{arg}bandchart.png')
|
timestamp=datetime.utcnow())
|
||||||
embed.set_footer(text=ctx.author.name,
|
embed.set_footer(text=ctx.author.name,
|
||||||
icon_url=str(ctx.author.avatar_url))
|
icon_url=str(ctx.author.avatar_url))
|
||||||
|
await ctx.send(embed=embed)
|
||||||
|
else:
|
||||||
|
img = discord.File(f"resources/images/bandchart/{arg}bandchart.png",
|
||||||
|
filename=f'{arg}bandchart.png')
|
||||||
|
embed = discord.Embed(title=f'{name[arg]} Amateur Radio Bands',
|
||||||
|
colour=self.gs.colours.good,
|
||||||
|
timestamp=datetime.utcnow())
|
||||||
|
embed.set_image(url=f'attachment://{arg}bandchart.png')
|
||||||
|
embed.set_footer(text=ctx.author.name,
|
||||||
|
icon_url=str(ctx.author.avatar_url))
|
||||||
|
|
||||||
await ctx.send(embed=embed, file=img)
|
await ctx.send(embed=embed, file=img)
|
||||||
|
|
||||||
@commands.command(name="cond", aliases=['condx'])
|
@commands.command(name="cond", aliases=['condx'])
|
||||||
async def _band_conditions(self, ctx: commands.Context):
|
async def _band_conditions(self, ctx: commands.Context):
|
||||||
@ -101,17 +111,27 @@ 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'
|
||||||
img = discord.File(f"resources/images/map/{arg}map.png",
|
for abbrev, title in map_titles.items():
|
||||||
filename=f'{arg}map.png')
|
desc += f'`{abbrev}`: {title}\n'
|
||||||
embed = discord.Embed(title=f'{map_titles[arg]} Map',
|
embed = discord.Embed(title=f'Map Not Found!',
|
||||||
colour=self.gs.colours.good,
|
description=desc,
|
||||||
timestamp=datetime.utcnow())
|
colour=self.gs.colours.bad,
|
||||||
embed.set_image(url=f'attachment://{arg}map.png')
|
timestamp=datetime.utcnow())
|
||||||
embed.set_footer(text=ctx.author.name,
|
embed.set_footer(text=ctx.author.name,
|
||||||
icon_url=str(ctx.author.avatar_url))
|
icon_url=str(ctx.author.avatar_url))
|
||||||
|
await ctx.send(embed=embed)
|
||||||
|
else:
|
||||||
|
img = discord.File(f"resources/images/map/{arg}map.png",
|
||||||
|
filename=f'{arg}map.png')
|
||||||
|
embed = discord.Embed(title=f'{map_titles[arg]} Map',
|
||||||
|
colour=self.gs.colours.good,
|
||||||
|
timestamp=datetime.utcnow())
|
||||||
|
embed.set_image(url=f'attachment://{arg}map.png')
|
||||||
|
embed.set_footer(text=ctx.author.name,
|
||||||
|
icon_url=str(ctx.author.avatar_url))
|
||||||
|
|
||||||
await ctx.send(embed=embed, file=img)
|
await ctx.send(embed=embed, file=img)
|
||||||
|
|
||||||
|
|
||||||
def setup(bot: commands.Bot):
|
def setup(bot: commands.Bot):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user