isupport

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultChanTypes = []rune("#&")
View Source
var DefaultPrefixLetters = []rune("vo")
View Source
var DefaultPrefixSymbols = []rune("+@")

Functions

func SplitIrcPrefix

func SplitIrcPrefix(s string, availablePrefixes []rune) (prefixes []rune, rest string)

Types

type ChanMode

type ChanMode struct {
	Type ChanModeType
	Mode rune
}

type ChanModeType

type ChanModeType byte
const (
	// Mode that adds or removes a nick or address to a list.
	// Always has a parameter.
	ChanModeType_List ChanModeType = iota

	// Mode that changes a setting.
	// Always has a parameter.
	ChanModeType_Setting

	// Mode that changes a setting.
	// Only has a parameter when set.
	ChanModeType_Setting_ParamWhenSet

	// Mode that changes a setting.
	// Never has a parameter.
	ChanModeType_Setting_NoParam
)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func New

func New(b bot.Bot) *Plugin

Creates a new plugin instance.

func Register

func Register(b bot.Bot) *Plugin

Registers this plugin with the bot.

func (*Plugin) IsChannel

func (p *Plugin) IsChannel(target string) (ok bool, prefixes []rune, name string)

Returns whether the target is a channel.

func (*Plugin) Supports

func (plugin *Plugin) Supports() *Support

Returns the table of things the server reported to the bot as supported.

type Prefixes

type Prefixes struct {
	Letters []rune
	Symbols []rune
}

func (*Prefixes) LetterToSymbol

func (p *Prefixes) LetterToSymbol(letter rune) (retval rune, ok bool)

func (*Prefixes) SymbolToLetter

func (p *Prefixes) SymbolToLetter(symbol rune) (retval rune, ok bool)

type Support

type Support struct {
	Data map[string]string
}

func (*Support) CaseMapping

func (s *Support) CaseMapping() (retval string, ok bool)

Case mapping used for nick- and channel name comparing.

Current possible values:

  • ascii: The chars [a-z] are lowercase of [A-Z].
  • rfc1459: ascii with additional {}|~ the lowercase of []\^.
  • strict-rfc1459: ascii with additional {}| the lowercase of []\.

Note: RFC1459 forgot to mention the ~ and ^ although in all known implementations those are considered equivalent too.

func (*Support) ChanLimit

func (s *Support) ChanLimit() (retval map[rune]uint64, ok bool)

Maximum number of channels allowed to join by channel prefix.

func (*Support) ChanModes

func (s *Support) ChanModes() (retval []ChanMode, ok bool)

Returns the list of channel modes according to 4 types. They are documented with the ChanModeType constants.

func (*Support) ChanTypes

func (s *Support) ChanTypes() (retval []rune, ok bool)

Returns the supported channel prefixes.

func (*Support) Excepts

func (s *Support) Excepts() (retval rune, ok bool)

The server supports ban exceptions (e mode). See RFC 2811 for more information.

func (*Support) InviteExcepts

func (s *Support) InviteExcepts() (retval rune, ok bool)

The server supports invite exceptions (+I mode). See RFC 2811 for more information.

func (*Support) MaxBans

func (s *Support) MaxBans() (retval uint64, ok bool)

Maximum number of bans per channel.

Note: This has been replaced by MAXLIST.

func (*Support) MaxChannels

func (s *Support) MaxChannels() (retval uint64, ok bool)

Maximum number of channels allowed to join.

Note: This has been replaced by CHANLIMIT.

func (*Support) MaxList

func (s *Support) MaxList() (retval map[rune]uint64, ok bool)

Maximum number entries in the list per mode.

func (*Support) Modes

func (s *Support) Modes() (retval uint64, ok bool)

Returns maximum number of channel modes with parameter allowed per MODE command.

func (*Support) Prefix

func (s *Support) Prefix() (retval *Prefixes, ok bool)

Returns a list of channel modes a person can get and the respective prefix a channel or nickname will get in case the person has it. The order of the modes goes from most powerful to least powerful. Those prefixes are shown in the output of the WHOIS, WHO and NAMES command.

Note: Some servers only show the most powerful, others may show all of them.

func (*Support) StatusMsg

func (s *Support) StatusMsg() (retval []rune, ok bool)

The server supports messaging channel member who have a certain status or higher. The status is one of the letters from PREFIX.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL