GuildHandle
Defined in: packages/core/src/handles.ts:117
A guild, by id. Made by bot.guild(id).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GuildHandle(
bot,id):GuildHandle
Defined in: packages/core/src/handles.ts:118
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”GuildHandle
Properties
Section titled “Properties”
readonlyid:string
Defined in: packages/core/src/handles.ts:120
Accessors
Section titled “Accessors”channels
Section titled “channels”Get Signature
Section titled “Get Signature”get channels():
Collection<string,Channel>
Defined in: packages/core/src/handles.ts:142
The cached channels of this guild, as a snapshot taken when you read it.
Returns
Section titled “Returns”Collection<string, Channel>
members
Section titled “members”Get Signature
Section titled “Get Signature”get members():
Collection<string,GuildMember>
Defined in: packages/core/src/handles.ts:134
The cached members, live: it changes as the Gateway updates them.
Returns
Section titled “Returns”Collection<string, GuildMember>
Get Signature
Section titled “Get Signature”get roles():
Collection<string,Role>
Defined in: packages/core/src/handles.ts:138
The cached roles, live.
Returns
Section titled “Returns”Collection<string, Role>
Methods
Section titled “Methods”ban(
userId,options?):Promise<void>
Defined in: packages/core/src/handles.ts:174
Bans a user, whether or not they are a member.
Parameters
Section titled “Parameters”userId
Section titled “userId”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
channel()
Section titled “channel()”channel(
channelId):ChannelHandle
Defined in: packages/core/src/handles.ts:154
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Returns
Section titled “Returns”createChannel()
Section titled “createChannel()”createChannel<
O>(options):Promise<ChannelOfKind<O["kind"]>>
Defined in: packages/core/src/handles.ts:163
Creates a channel. kind decides which other options apply, and the
result is typed to match: a "voice" option gives a VoiceChannel.
Type Parameters
Section titled “Type Parameters”O extends CreateChannelOptions
Parameters
Section titled “Parameters”options
Section titled “options”O
Returns
Section titled “Returns”Promise<ChannelOfKind<O["kind"]>>
Example
Section titled “Example”await bot.guild(id).createChannel({ kind: "text", name: "general", parent: categoryId });edit()
Section titled “edit()”edit(
options):Promise<Guild>
Defined in: packages/core/src/handles.ts:182
Changes the guild’s settings; reason is the audit-log reason.
Parameters
Section titled “Parameters”options
Section titled “options”GuildEditOptions
Returns
Section titled “Returns”Promise<Guild>
fetch()
Section titled “fetch()”fetch():
Promise<Guild>
Defined in: packages/core/src/handles.ts:129
Returns
Section titled “Returns”Promise<Guild>
Implementation of
Section titled “Implementation of”get():
Promise<Guild>
Defined in: packages/core/src/handles.ts:126
Returns
Section titled “Returns”Promise<Guild>
Implementation of
Section titled “Implementation of”leave()
Section titled “leave()”leave():
Promise<void>
Defined in: packages/core/src/handles.ts:186
Makes the bot leave the guild.
Returns
Section titled “Returns”Promise<void>
member()
Section titled “member()”member(
userId):MemberHandle
Defined in: packages/core/src/handles.ts:148
Parameters
Section titled “Parameters”userId
Section titled “userId”string
Returns
Section titled “Returns”peek()
Section titled “peek()”peek():
Guild|undefined
Defined in: packages/core/src/handles.ts:123
Returns
Section titled “Returns”Guild | undefined
Implementation of
Section titled “Implementation of”role()
Section titled “role()”role(
roleId):RoleHandle
Defined in: packages/core/src/handles.ts:151
Parameters
Section titled “Parameters”roleId
Section titled “roleId”string
Returns
Section titled “Returns”unban()
Section titled “unban()”unban(
userId,reason?):Promise<void>
Defined in: packages/core/src/handles.ts:178
Lifts a ban.
Parameters
Section titled “Parameters”userId
Section titled “userId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>