diff --git a/DiscordBot.py b/DiscordBot.py index a934df9..1c634c0 100644 --- a/DiscordBot.py +++ b/DiscordBot.py @@ -118,8 +118,15 @@ async def update_rss(ctx): await ctx.respond("Sucessfully updated RSS feed") @bot.slash_command() -async def upload(ctx): +async def upload(ctx, + file: discord.Attachment | None = None): messagechannel = bot.get_channel(torrent_link_channel_id) + if file is None: + logger.info("No link attached") + else: + if ".torrent" in discord.Attachment.filename: + await file.save(file.filename) + await ctx.respond(f"{file.filename} recieved, uploading") if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id: files = files_to_upload(".") try: