好的,所以我希望我的机器人向加入我的 Discord 服务器的每个人发送一个 PM,在查看了 Stackoverflow 和文档后,我想不出这不能按预期工作的原因。没有错误行或类似内容。
import discord
import os
import requests
import json
import random
from discord.ext import commands
import ffmpeg
bot = commands.Bot(command_prefix='§')
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.event
async def on_member_join(ctx):
member = ctx.author
await member.send("Dies ist ein Test, begeben Sie sich in Deckung!")
bot.run(os.getenv("TOKEN"))
答案 0 :(得分:2)