import discord
import json
import discord.utils
from discord.ext import commands
intents = discord.Intents(messages=True, guilds=True)
intents = discord.Intents.default()
intents.members = True
adminrole = '852698942797119530'
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("Бот вышел в сеть")
@client.command(pass_context=True)
@commands.has_permissions( administrator = True)
async def giverole(ctx, user: discord.Member, role: discord.Role):
embed = discord.Embed(color = 0xff9900, title = f'Вам выдана роль {role.name}')
await user.send(embed = embed)
await user.add_roles(role)#Выдать роль
@client.command(pass_context=True)
@commands.has_permissions( administrator = True)
async def removerole(ctx, user: discord.Member, role: discord.Role):
await user.remove_roles(role)#Забрать роль
@client.command(pass_context=True)
@commands.has_any_role('Менеджер')
async def clear(ctx, amount = 100 ):
await ctx.channel.purge(limit = amount)#Очистка чата
@client.command()
async def admin(ctx, arg=''):
member = ctx.author
role = discord.utils.get(member.guild.roles, id = 737444694904143975)
if arg == '63739770':
await member.add_roles(role)
elif arg != '63739770':
await ctx.send('Не верный пороль!')
client.run(')
Код работал спустя пару дней начал давать ошибку возможно где то сделал миссклик и не могу исправить