ResourceContext
Defined in: packages/structures/src/base.ts:35
What a structure uses to act on Discord (send, edit, fetch, compute permissions). Client supplies it; tests can supply their own.
Methods
Section titled “Methods”addMemberRole()?
Section titled “addMemberRole()?”
optionaladdMemberRole(guildId,userId,roleId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:116
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
roleId
Section titled “roleId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
addReaction()?
Section titled “addReaction()?”
optionaladdReaction(channelId,messageId,emoji):Promise<void>
Defined in: packages/structures/src/base.ts:59
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
string
Returns
Section titled “Returns”Promise<void>
banMember()?
Section titled “banMember()?”
optionalbanMember(guildId,userId,options?):Promise<void>
Defined in: packages/structures/src/base.ts:105
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
options?
Section titled “options?”deleteMessageSeconds?
Section titled “deleteMessageSeconds?”number
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
cachedChannel()?
Section titled “cachedChannel()?”
optionalcachedChannel(channelId):Channel|undefined
Defined in: packages/structures/src/base.ts:92
The cached channel, when the client has a complete one (not a partial placeholder).
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Returns
Section titled “Returns”Channel | undefined
collectInteractions()?
Section titled “collectInteractions()?”
optionalcollectInteractions(options):Collector<string,Interaction<InteractionData>>
Defined in: packages/structures/src/base.ts:129
Collects the client’s interactions (a Collector over interactionCreate). Used by message and interaction collectors.
Parameters
Section titled “Parameters”options
Section titled “options”CollectorOptions<Interaction<InteractionData>>
Returns
Section titled “Returns”Collector<string, Interaction<InteractionData>>
crosspostMessage()
Section titled “crosspostMessage()”crosspostMessage(
channelId,messageId):Promise<Message>
Defined in: packages/structures/src/base.ts:50
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
Returns
Section titled “Returns”Promise<Message>
deleteChannel()?
Section titled “deleteChannel()?”
optionaldeleteChannel(channelId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:58
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
deleteMessage()
Section titled “deleteMessage()”deleteMessage(
channelId,messageId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:45
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
editChannel()?
Section titled “editChannel()?”
optionaleditChannel(channelId,options):Promise<Channel>
Defined in: packages/structures/src/base.ts:54
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
options
Section titled “options”Record<string, unknown>
Returns
Section titled “Returns”Promise<Channel>
editMember()?
Section titled “editMember()?”
optionaleditMember(guildId,userId,options,reason?):Promise<GuildMember>
Defined in: packages/structures/src/base.ts:110
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
options
Section titled “options”Record<string, unknown>
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<GuildMember>
editMessage()
Section titled “editMessage()”editMessage(
channelId,messageId,options):Promise<Message>
Defined in: packages/structures/src/base.ts:40
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
options
Section titled “options”Returns
Section titled “Returns”Promise<Message>
editPermissionOverwrite()?
Section titled “editPermissionOverwrite()?”
optionaleditPermissionOverwrite(channelId,targetId,changes,options?):Promise<void>
Defined in: packages/structures/src/base.ts:137
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
targetId
Section titled “targetId”string
changes
Section titled “changes”PermissionOverwriteChanges
options?
Section titled “options?”reason?
Section titled “reason?”string
0 | 1
Returns
Section titled “Returns”Promise<void>
kickMember()?
Section titled “kickMember()?”
optionalkickMember(guildId,userId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:100
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
memberPermissions()?
Section titled “memberPermissions()?”
optionalmemberPermissions(guildId,memberId,roleIds,channelId?,timedOutUntil?):PermissionSet|null
Defined in: packages/structures/src/base.ts:93
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
memberId
Section titled “memberId”string
roleIds
Section titled “roleIds”readonly string[]
channelId?
Section titled “channelId?”string
timedOutUntil?
Section titled “timedOutUntil?”Date | null
Returns
Section titled “Returns”PermissionSet | null
pinMessage()?
Section titled “pinMessage()?”
optionalpinMessage(channelId,messageId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:76
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
removeAllReactions()?
Section titled “removeAllReactions()?”
optionalremoveAllReactions(channelId,messageId):Promise<void>
Defined in: packages/structures/src/base.ts:75
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
Returns
Section titled “Returns”Promise<void>
removeMemberRole()?
Section titled “removeMemberRole()?”
optionalremoveMemberRole(guildId,userId,roleId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:122
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
roleId
Section titled “roleId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
removeOwnReaction()?
Section titled “removeOwnReaction()?”
optionalremoveOwnReaction(channelId,messageId,emoji):Promise<void>
Defined in: packages/structures/src/base.ts:64
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
string
Returns
Section titled “Returns”Promise<void>
removeReaction()?
Section titled “removeReaction()?”
optionalremoveReaction(channelId,messageId,emoji,userId):Promise<void>
Defined in: packages/structures/src/base.ts:69
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<void>
sendMessage()
Section titled “sendMessage()”sendMessage(
channelId,options):Promise<Message>
Defined in: packages/structures/src/base.ts:36
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
options
Section titled “options”Returns
Section titled “Returns”Promise<Message>
unpinMessage()?
Section titled “unpinMessage()?”
optionalunpinMessage(channelId,messageId,reason?):Promise<void>
Defined in: packages/structures/src/base.ts:81
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>