Get a Discord Role by Id

前端 未结 2 1730
不思量自难忘°
不思量自难忘° 2021-01-20 01:46

I\'m making a Discord bot but just ran into a problem.

I want to modify a role. A specific role. I know how to do that with edit_role, but I need to get

2条回答
  •  萌比男神i
    2021-01-20 01:59

    You can simply use Guild.get_role(role_id) to get the role if you have the id.

    role_id = 2134532534
    role = my_server.get_role(role_id)
    

提交回复
热议问题