Python (discord.py)如何使我的discord Bot从邮件中重新发送附件?
我想问的是,在给定特定事件/情况的情况下,如何使discord bot重新发送邮件中的所有附件 这是我的密码:Python (discord.py)如何使我的discord Bot从邮件中重新发送附件?,python,discord,discord.py,Python,Discord,Discord.py,我想问的是,在给定特定事件/情况的情况下,如何使discord bot重新发送邮件中的所有附件 这是我的密码: if "ngab" in message.content.lower(): content=message.content.lower() final=content.replace("ngab",":ng::ab:") if len(final)<=2000:
if "ngab" in message.content.lower():
content=message.content.lower()
final=content.replace("ngab",":ng::ab:")
if len(final)<=2000:
attc = message.attachments
ref = message.reference
await message.delete()
await message.channel.send(f'{message.author.mention}: {final}', reference=ref)
else:
await message.reply(f"kata mas discord kepanjangan :ng::ab: {message.author.mention}")
虽然附件与邮件分开并逐个发送,但效果良好。那么如何让机器人一次发送所有信息呢
提前感谢任何帮助或只是阅读的人。请原谅我在这篇文章中所犯的任何错误。我不确定你一下子说的是什么意思,你上传的每个附件都是它自己的消息,所以不管你是否使用了
discord.File
,它都是两条不同的消息。你不能发送多次。
此外,用户不能发送多个附件。
所以别介意
if message.attachments:
for attachment in attc:
await message.channel.send(attachment.url)