@Bot.event
async def on_member_join(member):
if role := member.guild.get_role(418187634689139935):
await member.add_roles(role)
import discord
from discord.ext import commands
from config import settings
bot = commands.Bot(command_prefix = settings['prefix'])
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=',', intents=intents)
@bot.event
async def on_ready():
print("[+] Бот успешно включен! Версия: 1.0.0")
@bot.event
async def on_member_join(member):
if role := member.guild.get_role(941019881221009498):
await member.add_roles(role)
bot.run(settings['token']) # Обращаемся к словарю settings с ключом token, для получения токена
import discord
from discord.ext import commands
from config import settings
instents = discord.Intents.default()
instents.members = True
bot = commands.Bot(command_prefix=',', instents=instents)
@bot.event
async def on_ready():
print("[+] Бот успешно включен! Версия: 1.0.0")
# Авто-выдача роли.
@bot.event
async def on_member_join(member):
if role := member.guild.get_role(941019881221009498):
await member.add_roles(role)
bot.run(settings['token']) # Обращаемся к словарю settings с ключом token, для получения токена
@bot.event
async def on_member_join(member):
role = 418187634689139935
await member.add_roles(role)
import discord
from discord.ext import commands
from config import settings
instents = discord.Intents.all()
instents.members = True
bot = commands.Bot(command_prefix=',', instents=instents)
@bot.event
async def on_ready():
print("[+] Бот успешно включен! Версия: 1.0.0")
# Авто-выдача роли.
@bot.event
async def on_member_join(member):
role = 941019881221009498
await member.add_roles(role)
bot.run(settings['token']) # Обращаемся к словарю settings с ключом token, для получения токена
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=',', intents=discord.Intents.all())
bot_ver = '1.0.0'
@bot.event
async def on_ready():
print(f"Бот успешно включен! Версия: {bot_ver}")
# Авто-выдача роли.
@bot.event
async def on_member_join(member):
role = member.guild.get_role(role_id=941019881221009498)
await member.add_roles(role)
token = '(ВСТАВИТЬ ТОКЕН!)'
bot.run(token)
import discord
from discord.ext import commands
from discord.ext import tasks
from config import settings
prefix = settings['prefix']
bot = commands.Bot(command_prefix = settings['prefix'], intents = discord.Intents.all())
bot.remove_command('help')
@bot.event
async def on_ready():
print("[+] Бот успешно включен! Версия: 1.0.1")
# Авто-выдача роли.
@bot.event
async def on_member_join(member):
member_id = member.id
channel = bot.get_channel(settings['welcome_channel'])
role = discord.utils.get(member.guild.roles, id=settings['start_role'])
user = bot.get_user(member_id)
await member.add_roles(role)
await channel.send(embed=discord.Embed(description=f'Пользователь {member.name}, присоединился к нам!',
color=0x37ff00))
# Connect
bot.run(settings['token'])