changed type of filename

This commit is contained in:
2026-06-03 19:25:39 +05:30
parent 5ec64c2da2
commit cbdeec5fac

View File

@@ -118,15 +118,18 @@ async def update_rss(ctx):
await ctx.respond("Sucessfully updated RSS feed") await ctx.respond("Sucessfully updated RSS feed")
@bot.slash_command() @bot.slash_command()
async def upload(ctx, async def upload(ctx,file: discord.Attachment | None = None):
file: discord.Attachment | None = None):
messagechannel = bot.get_channel(torrent_link_channel_id) messagechannel = bot.get_channel(torrent_link_channel_id)
if file is None: if file is None:
logger.info("No link attached") logger.info("No link attached")
else: else:
if ".torrent" in discord.Attachment.filename: filename = str(file.filename)
await file.save(file.filename) if ".torrent" in filename:
await ctx.respond(f"{file.filename} recieved, uploading") await file.save(filename)
await ctx.respond(f"{filename} recieved, uploading")
if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id: if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id:
files = files_to_upload(".") files = files_to_upload(".")
try: try: