Struct ChannelPermissions
- Namespace
- HeyBox
- Assembly
- HeyBox.Net.Core.dll
表示一个频道的权限集。
public struct ChannelPermissions
- Inherited Members
Constructors
ChannelPermissions(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool)
使用指定的权限位信息创建一个 ChannelPermissions 结构的新实例。
public ChannelPermissions(bool viewChannel = false, bool manageChannels = false, bool createInvites = false, bool sendMessages = false, bool mentionEveryone = false, bool manageMessages = false, bool createTeamUpInvitations = false, bool connect = false, bool speak = false, bool useVoiceActivity = false, bool muteMembers = false, bool playSoundPacks = false, bool shareAudio = false, bool shareScreen = false, bool useBotCommands = false)
Parameters
viewChannelbool查看频道。
manageChannelsbool管理频道。
createInvitesbool创建邀请。
sendMessagesbool发送消息。
mentionEveryonebool@全体、@在线和所有权限组。
manageMessagesbool管理消息。
createTeamUpInvitationsbool创建开黑邀约。
connectbool加入语音频道。
speakbool语音频道内说话。
useVoiceActivitybool允许直接讲话。
muteMembersbool静音成员。
playSoundPacksbool播放语音包。
shareAudiobool播放伴奏。
shareScreenbool共享屏幕。
useBotCommandsbool使用机器人命令。
ChannelPermissions(ulong)
使用指定的权限原始值创建一个 ChannelPermissions 结构的新实例。
public ChannelPermissions(ulong rawValue)
Parameters
rawValueulong权限原始值。
Fields
Category
获取一个包含所有可以为分组频道设置的权限的 ChannelPermissions。
public static readonly ChannelPermissions Category
Field Value
None
获取一个空的 ChannelPermissions,不包含任何权限。
public static readonly ChannelPermissions None
Field Value
Text
获取一个包含所有可以为文字频道设置的权限的 ChannelPermissions。
public static readonly ChannelPermissions Text
Field Value
Voice
获取一个包含所有可以为语音频道设置的权限的 ChannelPermissions。
public static readonly ChannelPermissions Voice
Field Value
Properties
Connect
获取此权限集的相关用户是否可以加入语音频道。
public bool Connect { get; }
Property Value
CreateInvites
获取此权限集的相关用户是否可以创建邀请。
public bool CreateInvites { get; }
Property Value
CreateTeamUpInvitations
获取此权限集的相关用户是否可以创建开黑邀约。
public bool CreateTeamUpInvitations { get; }
Property Value
ManageChannels
获取此权限集的相关用户是否可以管理频道。
public bool ManageChannels { get; }
Property Value
ManageMessages
获取此权限集的相关用户是否可以管理消息。
public bool ManageMessages { get; }
Property Value
MentionEveryone
获取此权限集的相关用户是否可以 @全体、@在线和所有权限组。
public bool MentionEveryone { get; }
Property Value
MuteMembers
获取此权限集的相关用户是否可以静音成员。
public bool MuteMembers { get; }
Property Value
PlaySoundPacks
获取此权限集的相关用户是否可以播放语音包。
public bool PlaySoundPacks { get; }
Property Value
RawValue
获取此权限集的原始值。
public readonly ulong RawValue { get; }
Property Value
SendMessages
获取此权限集的相关用户是否可以发送消息。
public bool SendMessages { get; }
Property Value
ShareAudio
获取此权限集的相关用户是否可以播放伴奏。
public bool ShareAudio { get; }
Property Value
ShareScreen
获取此权限集的相关用户是否可以共享屏幕。
public bool ShareScreen { get; }
Property Value
Speak
获取此权限集的相关用户是否可以语音频道内说话。
public bool Speak { get; }
Property Value
UseBotCommands
获取此权限集的相关用户是否可以使用机器人命令。
public bool UseBotCommands { get; }
Property Value
UseVoiceActivity
获取此权限集的相关用户是否可以允许直接讲话。
public bool UseVoiceActivity { get; }
Property Value
ViewChannel
获取此权限集的相关用户是否可以查看频道。
public bool ViewChannel { get; }
Property Value
Methods
All(IChannel)
为指定的频道根据其类型获取一个包含所有权限的 ChannelPermissions。
public static ChannelPermissions All(IChannel channel)
Parameters
channelIChannel要获取其包含所有权限的频道。
Returns
- ChannelPermissions
一个包含所有该频道可以拥有的权限的 ChannelPermissions。
Exceptions
- ArgumentException
未知的频道类型。
Has(ChannelPermission)
获取当前权限集是否包含指定的权限。
public bool Has(ChannelPermission permission)
Parameters
permissionChannelPermission要检查的权限。
Returns
- bool
如果当前权限集包含了所有指定的权限信息,则为
true;否则为false。
Modify(bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?, bool?)
以当前权限集为基础,更改指定的权限,返回一个 ChannelPermissions 结构的新实例。
public ChannelPermissions Modify(bool? viewChannel = null, bool? manageChannels = null, bool? createInvites = null, bool? sendMessages = null, bool? mentionEveryone = null, bool? manageMessages = null, bool? createTeamUpInvitations = null, bool? connect = null, bool? speak = null, bool? useVoiceActivity = null, bool? muteMembers = null, bool? playSoundPacks = null, bool? shareAudio = null, bool? shareScreen = null, bool? useBotCommands = null)
Parameters
viewChannelbool?查看频道。
manageChannelsbool?管理频道。
createInvitesbool?创建邀请。
sendMessagesbool?发送消息。
mentionEveryonebool?@全体、@在线和所有权限组。
manageMessagesbool?管理消息。
createTeamUpInvitationsbool?创建开黑邀约。
connectbool?加入语音频道。
speakbool?语音频道内说话。
useVoiceActivitybool?允许直接讲话。
muteMembersbool?静音成员。
playSoundPacksbool?播放语音包。
shareAudiobool?播放伴奏。
shareScreenbool?共享屏幕。
useBotCommandsbool?使用机器人命令。
Returns
- ChannelPermissions
更改了指定权限的新的权限集。
ToList()
获取一个包含当前权限集所包含的所有已设置的 ChannelPermission 独立位标志枚举值的集合。
public List<ChannelPermission> ToList()
Returns
- List<ChannelPermission>
一个包含当前权限集所包含的所有已设置的 ChannelPermission 独立位标志枚举值的集合;如果当前权限集未包含任何已设置的权限位,则会返回一个空集合。
ToString()
获取此权限集原始值的字符串表示。
public override string ToString()
Returns
- string
此权限集原始值的字符串表示。