import disnake
from disnake import Intents
TOKEN = 'token'
CHANNEL_ID = 1234567890 # Замените на ID канала, в который вы хотите отправлять сообщения
client = disnake.Client()
Intents.members = True
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_member_join(member):
channel = client.get_channel(CHANNEL_ID)
if channel:
await channel.send(f'{member.name} joined the server.')
@client.event
async def on_member_remove(member):
channel = client.get_channel(CHANNEL_ID)
if channel:
await channel.send(f'{member.name} left the server.')
client.run(TOKEN)
client = disnake.Client()
Intents.members = True