work ongoing

This commit is contained in:
2024-11-10 18:25:12 +01:00
parent 73f184b263
commit 63366f7ea1
2 changed files with 15 additions and 6 deletions
+13 -3
View File
@@ -604,9 +604,19 @@ class MusicModule(commands.Cog):
guild=discord.Object(id=664789470779932693),
)
async def batch_download(self, ctx):
self.logger.info(ctx.message.attachments[0].content_type)
file_bytes = ctx.message.attachments[0].read()
self.logger.info(file_bytes.decode(encoding="utf-8"))
content_type = ctx.message.attachments[0].contluzent_type
check = re.search ("text\/plain; *charset=(.*)", content_type, re.IGNORECASE)
if check:
file_bytes = await ctx.message.attachments[0].read()
text = file_bytes.decode(encoding=check.group(1))
self.logger.info(text)
lines = text.split("\n")
for item in lines:
self.logger.info(item)
else:
ctx.reply("Spierdalaj")
async def disconnect(self, ctx):
"""