@wilsite

Как сделать приветствие новых пользователей в discord.py Bot?

Я делаю бота для Дискорда на Пайтоне. Нужна помощь в написании события при котором в канале "основной" бот слал сообщения "Привет страниц:wave:" если заходит новый пользователь!
P.S извините за статус бота:)
import discord
from discord.utils import get
from discord.ext import commands, tasks
import datetime
import sqlite3
from config import settings
import os
import random
import json
import asyncio
from discord.ext import commands
from discord.ext.commands import Bot
from discord import Activity, ActivityType
from itertools import cycle

# Connect
client = commands.Bot( command_prefix = settings['PREFIX'] )
client.remove_command( 'help' )
os.chdir("/storage/emulated/0/s0user")
status = cycle(['порно на https://www.pornhub.com.', 'порно на https://www.pornhub.com..', 'порно на https://www.pornhub.com...'])
#значения
hello_words = [ 'hello', 'hi', 'привет', 'ку', 'куку', 'qq', 'дарова', 'хай' ]
poka_words = [ 'poka', 'bye', 'пока', 'удачи', 'до завтра', 'bb' ]


@client.event
async def on_ready():
	print('======================================')
	print('')
	print('Loading.')
	print('Loading..')
	print('Loading...')
	print('Loading: 16%')
	print('Loading: 48%')
	print('Loading: 50%')
	print('Loading: 87%')
	print('Loading: 100%')
	print('Bot status: online')
	print('')
	print('======================================')
	change_status.start()
	
@tasks.loop(seconds=2)
async def change_status():
	await client.change_presence(status=discord.Status.do_not_disturb,activity=discord.Activity(type=discord.ActivityType.watching, name=(next(status))))
	
	
#error off
@client.event
async def on_command_error( ctx, error ):
	pass

#новый участник
ТУТ


#чат бот
@client.event
async def on_message( message ):
	await client.process_commands(message)
	msg = message.content.lower()
	if msg in hello_words:
		await message.channel.send( 'Привет:wave:' )
	if msg in poka_words:
		await message.channel.send( 'Пока:hand_splayed: ' )

#токен
client.run( settings['TOKEN'] )
  • Вопрос задан
  • 2126 просмотров
Решения вопроса 1
SoreMix
@SoreMix Куратор тега Python
yellow
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
PhoenixX33i
@PhoenixX33i
discord.on_connect ?
@client.event
async def on_connect(...):
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы