added file attachments as manual upload method

This commit is contained in:
2026-06-03 19:20:06 +05:30
parent c992916419
commit 5ec64c2da2

View File

@@ -118,8 +118,15 @@ 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):
messagechannel = bot.get_channel(torrent_link_channel_id) 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: if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id:
files = files_to_upload(".") files = files_to_upload(".")
try: try: