import discord
TOKEN = 'Make your bot at https://discord.com/developers/applications'
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.author.bot:
data = message.content
await message.channel.send(f"Received {data}")
print(data)
# anything else you wanted to do with the data
client.run(TOKEN)
Webhook脚本
import requests
hook = 'Your Discord Webhook'
data = {
"content": "This is the data that gets printed to terminal through the bot"
}
r = requests.post(hook, json=data)
您需要清理hookbin网站。我试过了,到目前为止,这是一个痛苦的过程,当然有可能,但你必须像在浏览器中一样发出请求。如果您需要一个webhook来监听发送的内容,我只需要使用discord webhook,让一个bot在私有服务器中读取它们
机器人脚本
Webhook脚本
唯一的缺点是你不能得到非常具体的细节,但如果你只需要得到内容,它就可以很好地工作。使Bot和webhook成为现实。通过访问dev门户并将其邀请到私有服务器来创建bot,然后通过在任何文本频道的“集成”下创建webhook
Picture1
Picture2
相关问题 更多 >
编程相关推荐