added file attachments as manual upload method
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user