Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.84k stars 3.76k forks source link

how I can get guild object with ID of server? #1327

Closed katmai1 closed 6 years ago

katmai1 commented 6 years ago

I need get a list of users with a specific role of a specific server, but I only can get this info when message is sent from channel but I want all commands via private messages... if I have a server (guild) id and role name, how I can get a list users (IDs)? Sorry but I'm trying find it 2hours ago, I'm blocked... thanks

Harmon758 commented 6 years ago

https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.get_server https://discordpy.readthedocs.io/en/latest/api.html#discord.Server.roles https://discordpy.readthedocs.io/en/latest/api.html#discord.Member.roles

For the rewrite branch: https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Client.get_guild https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Guild.roles https://discordpy.readthedocs.io/en/rewrite/api.html#discord.Role.members

For future questions like this, you should join either the official discord.py server or the Discord API server for help, as the README recommends.

katmai1 commented 6 years ago

thanks for info and sorry for use github to questions...