我需要帮助我的代码,我想让我的机器人发送一个消息从顶部的第一个渠道时,一个特定的成员加入,但我得到了错误与if member.id == *id*
@bot.event
async def on_member_join(member):
if member.id == *my id here, i just dont want to show it*
await message.channel.send('Nice guy joined the server!')
@bot.event
async def on_member_join(member):
from discord.ext import commands
from discord.ext import tasks
import random
import typing
from discord import Status
from discord import Activity, ActivityType
from discord import Member
from discord.ext.commands import Bot
from asyncio import sleep
intents = discord.Intents()
intents.members =
我使用事件on_member_join尝试创建新成员,但是当我用alt进行测试时,它没有发送消息。
@bot.event
async def on_member_join(member):
embed = discord.Embed(title="Welcome to my server!", description=None, color = discord.Color.magenta())
embed.add_field(name="To get started:", value="•Invite some friends!\n•Check
我正在尝试让我的机器人响应接受规则的DM消息。
这是我到目前为止所知道的:
@bot.event
async def on_member_join(member):
role = discord.utils.get(member.servers.roles, name='Newcomers') #get role
await bot.add_roles(member, role) #give the role to the user
await bot.member.send("Welcome to the Moderator Bot Server! I w
我有这样的东西。
from flask import Flask
from threading import Thread
import discord
from discord.ext import commands, tasks
from discord.utils import get
import requests
from Moderator.badwords import words
import time
import datetime
from Stats.uptime import data
help_command = commands.DefaultHelpComman
我尝试了很多其他人的解决方案,但都不起作用。那么,我如何获得一个在MS中显示ping的ping命令呢? 这是我的代码,我没有得到任何错误,尽管它只是不回应我的CMD。 import os
from keep_alive import keep_alive
from discord.ext import commands
import time
import random
bot = commands.Bot(
command_prefix="!", # Change to desired prefix
case_insensitive=True
我想让我的机器人发送一个直接的信息给加入我的服务器的人,并在30秒后给他们角色。我没有任何错误,我的机器人不会崩溃,但它什么也做不了。
我的代码:
@bot.event
async def on_member_join(member):
await member.send('Hi! Welcome to our server, in 30 seconds you will get "Verified" role, please read rules in that time.')
time.sleep(30)
await member.a
File "bot.py", line 17, in on_member_join
await channel.send('{.member} has joined the server')
AttributeError: 'NoneType' object has no attribute 'send' 我该怎么修复呢? PS。我已经有意向了 代码如下: async def on_member_join(member):
channel = bot.get_channel(xxxxxxx)
await
我正在尝试制造一个机器人,重新添加“静音”角色给那些在静默的时候重新加入服务器的人。以下是.py代码:
@bot.event
async def on_member_join(member):
with open('users.json', 'r') as fp:
data = json.load(fp)
mute = discord.utils.get(member.guild.roles, name = "mute role")
if member.id in data['mut
我想发送一个信息到一个特定的渠道,我遵循了不和谐的步骤如何做,我正确地遵循了他们的步骤,但这并不是工作。下面是我遵循的步骤
下面是我的代码:
@bot.event
async def on_member_join(member):
print("A member just joined and his name is" + member.name)
general = bot.get_channel(466675715333554179)
mid = member.id
await general.send('Welcome <@%