AttributeError:“成员”对象没有属性“服务器”

时间:2019-10-18 02:22:09

标签: python discord discord.py

我正在使用以下代码:

def show_object(request, category, pk):
    # swap out `myapp` to your app name
    # if you don't care about url being friendly
    # you can use content type primary key instead of model name
    model = ContentType.objects.get(app_label="myapp", model=category).model_class()
    obj = model.objects.get(pk=pk)
    # ...

def show_all_objects(request, category):
    model = ContentType.objects.get(app_label="myapp", model=category).model_class()
    all_objects = model.objects.all()
    # ...

得到这个:

@ibot.event
async def on_member_join(member):
    role = discord.utils.get(member.server.roles, name="Test role")
    await ibot.add_roles(member, role)

0 个答案:

没有答案