Уже неделю мучаюсь этой ошибкой, серьезно не понимаю в чем дело, help plz объект int не имеет атрибута id вот мой код:
import discord
import random
import asyncio
from discord import Member
from discord.utils import get
from discord.ext import commands
from discord.ext.commands import Bot
from discord.ext.commands import check
from discord.ext.commands import has_role
ROLE = 730459135170183170
bot = commands.Bot(command_prefix='$')
@bot.command(pass_context = True)
@commands.has_role(730459135170183170)
async def use_shovel(ctx,user: discord.Member):
x = random.randint(1,50)
role = get(user.guild.roles, name =ROLE)
if x == 1:
await ctx.send("You've found REQUIEM ARROW!")
await bot.author.add_roles(731166197030322216)
else:
await ctx.send("meh, nothing")
await user.remove_roles(731166197030322216)
bot.run(TOKEN)
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "use_shove" is not found
Ignoring exception in command use_shovel:
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\ext\commands\core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "meh.py", line 24, in use_shovel
await user.remove_roles(731166197030322216)
File "C:\Python\lib\site-packages\discord\member.py", line 685, in remove_roles
await req(guild_id, user_id, role.id, reason=reason)
AttributeError: 'int' object has no attribute 'id'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "C:\Python\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'int' object has no attribute 'id'
Я действительно не могу понять, почему произошла эта ошибка. Итак, как я могу это исправить? Я