【发布时间】:2020-06-07 10:19:09
【问题描述】:
我是否能够使用 discord.py 或其他 Discord bot python 库获取 discord 服务器中所有 webhook URL 的列表?抱歉,这太短了,我不确定我可以为我的问题提供哪些其他信息。
我也尝试了以下方法。
import discord
client = command.Bot()
@client.event
async def on_message(message):
message.content.lower()
if message.author == client.user:
return
if message.content.startswith("webhook"):
async def urls(ctx):
@client.command()
async def urls(ctx):
content = "\n".join([f"{w.name} - {w.url}" for w in await ctx.guild.webhooks()])
await ctx.send(content)
client.run('tokennumber')
【问题讨论】:
-
也许 webhook 文档可以解决您的问题:discordpy.readthedocs.io/en/latest/api.html#webhook-support
-
@merive_ 我检查了,但是我找不到任何涉及获取 webhook URL 的内容。如果您能找到任何有关检索 URL 或创建一个然后获取 URL 的信息,请告诉我。
标签: python python-3.x discord.py discord.py-rewrite