for guild in Bot.guilds:
maincategory = discord.utils.get(guild.categories, id=848659633664032829)
@Bot.event
async def on_voice_state_update(member, before, after):
if after.channel != None:
if after.channel.id == 843730990408007698:
category = after.channel.category
channel2 = await member.guild.create_voice_channel(
name = f' || { member.display_name }',
category = category
)
await channel2.set_permissions(member, connect = True)
await member.move_to(channel2)
def check(x, y, z): return len(channel2.members) == 0
await Bot.wait_for('voice_state_update', check = check)
await channel2.delete()
def minus_heal(message):
while True:
time.sleep(5)
...
import discord
import discord.utils
from discord.ext import commands
intents = discord.Intents(messages=True, guilds=True)
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix='!', intents=intents)
@client.event
async def on_ready():
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="#Общение"))
print("Bot is ready!")
@client.command()
async def admin(ctx):
member = ctx.author
role = discord.utils.get(member.guild.roles, id = 852691194433503232)
await member.add_roles(role)
import discord
client = discord.Client()
Matrix = "▢"
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
global Matrix
if message.content.startswith("#on"):
Matrixsend = Matrix.replace(Matrix[0], "▣")
Matrix = Matrixsend
await message.channel.send(''+str(Matrix))
if message.content.startswith("#off"):
Matrixsend = Matrix.replace(Matrix[0], "▢")
Matrix = Matrixsend
await message.channel.send(''+str(Matrix))
client.run("Тут могла быть ваша реклама")