Add Info Cog #11

Merged
cswimr merged 19 commits from info into master 2023-07-01 11:36:31 -04:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 3e8fc0a8af - Show all commits

View file

@ -4,4 +4,5 @@
missing-function-docstring, missing-function-docstring,
missing-class-docstring, missing-class-docstring,
line-too-long, line-too-long,
too-many-arguments too-many-arguments,
too-many-branches

View file

@ -8,13 +8,13 @@ class Info(commands.Cog):
self.client = client self.client = client
async def upload_file(self, asset: revolt.Asset): async def upload_file(self, asset: revolt.Asset):
dir = os.path.dirname(os.path.abspath(__file__)) temp_dir = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(dir, 'tempfile.png') file_path = os.path.join(temp_dir, 'tempfile.png')
with open(file_path, 'wb') as file: with open(file_path, 'wb') as file:
await asset.save(file) await asset.save(file)
id = await self.client.upload_file(file=file_path, tag="attachments") avatar_id = await self.client.upload_file(file=file_path, tag="attachments")
os.remove(file_path) os.remove(file_path)
return id return avatar_id
@commands.command() @commands.command()
async def temporarycmd(self, ctx: commands.Context): async def temporarycmd(self, ctx: commands.Context):
@ -81,7 +81,6 @@ class Info(commands.Cog):
if user.display_name is not None: if user.display_name is not None:
embeds[0].title += f" - {user.display_name}" embeds[0].title += f" - {user.display_name}"
embeds[0].set_footer(f"User ID: {user.id} - User is not in this server!") embeds[0].set_footer(f"User ID: {user.id} - User is not in this server!")
pass
if embeds[0].colour is None: if embeds[0].colour is None:
embeds[0].colour = "#5d82d1" embeds[0].colour = "#5d82d1"
await ctx.message.reply(embeds=embeds) await ctx.message.reply(embeds=embeds)