【发布时间】:2020-11-16 14:42:37
【问题描述】:
所以我的服务器决定开始这场比赛,为了与其他所有服务器通信,我们想创建一个命令,我们可以使用他们发送过来的 webhook 并使用它来传达信息。 示例:
Server1Webhook = "webhook url"
Server2Webhook = "webhook url"
Server3Webhook = "webhook url"
有没有办法遍历所有的 webhook,直到每个服务器都收到消息?
到目前为止我的代码:
@commands.command()
async def eventsend(self, ctx, webhook, *, reason):
async with aiohttp.ClientSession() as session:
eventweb = discord.Embed(title = "Incoming Announcment!", color = 0xfad934, description = reason)
webhook = Webhook.from_url('url', adapter=AsyncWebhookAdapter(session)) #something here to cycle through url's
await webhook.send(embed = eventweb ,username='Solamita')
任何帮助将不胜感激!
【问题讨论】:
标签: python discord.py