Documentation ¶
Index ¶
- Variables
- func SplitChannelMembershipPrefixes(target string) (prefixes string, name string)
- type Mode
- type ModeChange
- type ModeChanges
- type ModeOp
- type ModeSet
- func (set *ModeSet) AllModes() (result []Mode)
- func (set *ModeSet) Copy(other *ModeSet)
- func (set *ModeSet) HasMode(mode Mode) bool
- func (set *ModeSet) HighestChannelUserMode() (result Mode)
- func (set *ModeSet) Prefixes(isMultiPrefix bool) (prefixes string)
- func (set *ModeSet) SetMode(mode Mode, on bool) (applied bool)
- func (set *ModeSet) String() (result string)
- type Modes
Constants ¶
This section is empty.
Variables ¶
var ( // SupportedUserModes are the user modes that we actually support (modifying). SupportedUserModes = Modes{ Bot, Invisible, Operator, RegisteredOnly, ServerNotice, UserRoleplaying, } // SupportedChannelModes are the channel modes that we support. SupportedChannelModes = Modes{ BanMask, ChanRoleplaying, ExceptMask, InviteMask, InviteOnly, Key, Moderated, NoOutside, OpOnlyTopic, RegisteredOnly, Secret, UserLimit, } )
Functions ¶
func SplitChannelMembershipPrefixes ¶
SplitChannelMembershipPrefixes takes a target and returns the prefixes on it, then the name.
Types ¶
type Mode ¶
type Mode rune
Mode represents a user/channel/server mode
const ( Bot Mode = 'B' Invisible Mode = 'i' LocalOperator Mode = 'O' Operator Mode = 'o' Restricted Mode = 'r' RegisteredOnly Mode = 'R' ServerNotice Mode = 's' TLS Mode = 'Z' UserRoleplaying Mode = 'E' WallOps Mode = 'w' )
User Modes
const ( BanMask Mode = 'b' // arg ChanRoleplaying Mode = 'E' // flag ExceptMask Mode = 'e' // arg InviteMask Mode = 'I' // arg InviteOnly Mode = 'i' // flag Key Mode = 'k' // flag arg Moderated Mode = 'm' // flag NoOutside Mode = 'n' // flag OpOnlyTopic Mode = 't' // flag // RegisteredOnly mode is reused here from umode definition Secret Mode = 's' // flag UserLimit Mode = 'l' // flag arg )
Channel Modes
var ( ChannelFounder Mode = 'q' // arg ChannelAdmin Mode = 'a' // arg ChannelOperator Mode = 'o' // arg Halfop Mode = 'h' // arg Voice Mode = 'v' // arg // ChannelUserModes holds the list of all modes that can be applied to a user in a channel, // including Voice, in descending order of precedence ChannelUserModes = Modes{ ChannelFounder, ChannelAdmin, ChannelOperator, Halfop, Voice, } ChannelModePrefixes = map[Mode]string{ ChannelFounder: "~", ChannelAdmin: "&", ChannelOperator: "@", Halfop: "%", Voice: "+", } )
func GetLowestChannelModePrefix ¶
GetLowestChannelModePrefix returns the lowest channel prefix mode out of the given prefixes.
type ModeChange ¶
ModeChange is a single mode changing
func (*ModeChange) String ¶
func (change *ModeChange) String() (str string)
type ModeChanges ¶
type ModeChanges []ModeChange
ModeChanges are a collection of 'ModeChange's
func ParseChannelModeChanges ¶ added in v0.12.0
func ParseChannelModeChanges(params ...string) (ModeChanges, map[rune]bool)
ParseChannelModeChanges returns the valid changes, and the list of unknown chars.
func ParseUserModeChanges ¶
func ParseUserModeChanges(params ...string) (ModeChanges, map[rune]bool)
ParseUserModeChanges returns the valid changes, and the list of unknown chars.
func (ModeChanges) String ¶
func (changes ModeChanges) String() string
type ModeSet ¶
type ModeSet [2]uint32
ModeSet holds a set of modes.
func (*ModeSet) HighestChannelUserMode ¶ added in v1.1.0
HighestChannelUserMode returns the most privileged channel-user mode (e.g., ChannelFounder, Halfop, Voice) present in the ModeSet. If no such modes are present, or `set` is nil, returns the zero mode.