Skip to content
SQKo edited this page Jul 25, 2021 · 30 revisions

Guilds are part of Discord.

Guilds are known as 'Discord Servers' in the Discord application.

getInvites

getInvites(): Promise(Collection[Invite]) Retrieves a list of invites in the guild. Returns a collection of invites in a promise.

unban

unban(User|string $user) Unbans a member. Alias for $guild->bans->unban($user)

getVoiceRegions

getVoiceRegions(): Promise(Collection[object]) Retrieves a list of valid voice regions. Returns a collection of objects describing voice regions in a promise.

createRole

createRole(array $data): Promise(Role) Creates a role in the guild with a given array of attributes. Returns the created role in a promise.

transferOwnership

transferOwnership(Member|snowflake $member): Promise Transfers the ownership of the guild to another member. The bot must be the owner of the guild. Returns a promise with no data.

$guild->bans: Ban[]

$guild->channels: Channel[]

$guild->emojis: Emoji[]

$guild->invites: Invite[]

$guild->members: Member[]

$guild->roles: Role[]

Requires GUILD intent:

  • GUILD_CREATE
  • GUILD_DELETE
  • GUILD_UPDATE
  • GUILD_ROLE_CREATE
  • GUILD_ROLE_UPDATE
  • GUILD_ROLE_DELETE

Requires GUILD_MEMBERS intent:

  • GUILD_MEMBER_ADD
  • GUILD_MEMBER_REMOVE
  • GUILD_MEMBER_UPDATE

Requires GUILD_BANS intent:

  • GUILD_BAN_ADD
  • GUILD_BAN_REMOVE

Requires GUILD_EMOJIS intent:

  • GUILD_EMOJIS_UPDATE

Requires GUILD_INTEGRATIONS intent:

  • GUILD_INTEGRATIONS_UPDATE

Get a Specific Guild

Your BOT must be member of the guild

Change 123123123123123123 below with the Guild ID you want to retrieve

Cached:

$guild = $discord->guilds->get('id', '123123123123123123');

If the code above returns null, you may need to fetch it first:

$discord->guilds->fetch('123123123123123123')->done(function (Guild $guild) {
    // ...
});

Clone this wiki locally