DiscordGuildChannel
public protocol DiscordGuildChannel : DiscordChannel
Protocol that declares a type will be a Discord guild channel.
-
The snowflake id of the guild this channel is on.
Declaration
Swift
var guildId: GuildID
-
The name of this channel.
Declaration
Swift
var name: String
-
The parent category for this channel.
Declaration
Swift
var parentId: ChannelID?
-
The position of this channel. Mostly for UI purpose.
Declaration
Swift
var position: Int
-
The permissions specific to this channel.
Declaration
Swift
var permissionOverwrites: [OverwriteID: DiscordPermissionOverwrite]
-
canMember(_:_:)
Extension methodDetermines whether this user has the specified permission on this channel.
Declaration
Swift
public func canMember(_ member: DiscordGuildMember, _ permission: DiscordPermission) -> Bool
Parameters
member
The member to check.
permission
The permission to check for.
Return Value
Whether the user has this permission in this channel.
-
deletePermission(_:)
Extension methodDeletes a permission overwrite from this channel.
Declaration
Swift
public func deletePermission(_ overwrite: DiscordPermissionOverwrite)
Parameters
overwrite
The permission overwrite to delete
-
editPermission(_:)
Extension methodEdits a permission overwrite on this channel.
Declaration
Swift
public func editPermission(_ overwrite: DiscordPermissionOverwrite)
Parameters
overwrite
The permission overwrite to edit
-
overwrites(for:)
Extension methodGets the permission overwrites for a user.
Declaration
Swift
public func overwrites(for member: DiscordGuildMember) -> [DiscordPermissionOverwrite]
Parameters
for
The member to get permission overwrites for.
Return Value
The permission overwrites this member has.
-
permissions(for:)
Extension methodGets the permissions for this member on this channel.
Takes into consideration whether they are the owner, admin, and any roles and permission overwrites they have.
Declaration
Swift
public func permissions(for member: DiscordGuildMember) -> DiscordPermission
Parameters
member
The member to check.
Return Value
The permissions that this user has, OR’d together.