Eggdrop Documentation - 3. Channel commands

30-12-2010 10:34

3. Channel commands

channel add <name> [option-list]

Description: adds a channel record for the bot to monitor. The full list of possible options are given in doc/settings/mod.channels. Note that the channel options must be in a list (enclosed in {}).

Returns: nothing

Module: channels

channel set <name> <options...>

Description: sets options for the channel specified. The full list of possible options are given in doc/settings/mod.channels.

Returns: nothing

Module: channels

channel info <name>

Returns: a list of info about the specified channel's settings.

Module: channels

channel get <name> <setting>

Returns: The value of the setting you specify. For flags, a value of 0 means it is disabled (-), and non-zero means enabled (+).

Module: channels

channel remove <name>

Description: removes a channel record from the bot and makes the bot no longer monitor the channel

Returns: nothing

Module: channels

savechannels

Description: saves the channel settings to the channel-file if one is defined.

Returns: nothing

Module: channels

loadchannels

Description: reloads the channel settings from the channel-file if one is defined.

Returns: nothing

Module: channels

channels

Returns: a list of the channels the bot has a channel record for

Module: channels

channame2dname <channel-name>
chandname2name <channel-dname>

Description: these two functions are important to correctly support !channels. The bot differentiates between channel description names (chan dnames) and real channel names (chan names). The chan dnames are what you would normally call the channel, such as "!channel". The chan names are what the IRC server uses to identify the channel. They consist of the chan dname prefixed with an ID; such as "!ABCDEchannel".

For bot functions like isop, isvoice, etc. you need to know the chan dnames. If you communicate with the server, you usually get the chan name, though. That's what you need the channame2dname function for.

If you only have the chan dname and want to directly send raw server commands, use the chandname2name command.

For non-!channels, chan dname and chan name are the same.

Module: irc

isbotnick <nick>

Returns: 1 if the nick matches the botnick; 0 otherwise

Module: server

botisop [channel]

Returns: 1 if the bot has ops on the specified channel (or any channel if no channel is specified); 0 otherwise

Module: irc

botishalfop [channel]

Returns: 1 if the bot has halfops on the specified channel (or any channel if no channel is specified); 0 otherwise

Module: irc

botisvoice [channel]

Returns: 1 if the bot has a voice on the specified channel (or any channel if no channel is specified); 0 otherwise

Module: irc

botonchan [channel]

Returns: 1 if the bot is on the specified channel (or any channel if no channel is specified); 0 otherwise

Module: irc

isop <nickname> [channel]

Returns: 1 if someone by the specified nickname is on the channel (or any channel if no channel name is specified) and has ops; 0 otherwise

Module: irc

ishalfop <nickname> [channel]

Returns: 1 if someone by the specified nickname is on the channel (or any channel if no channel name is specified) and has halfops; 0 otherwise

Module: irc

wasop <nickname> <channel>

Returns: 1 if someone that just got opped/deopped in the chan had op before the modechange; 0 otherwise

Module: irc

washalfop <nickname> <channel>

Returns: 1 if someone that just got halfopped/dehalopped in the chan had halfop before the modechange; 0 otherwise

Module: irc

isvoice <nickname> [channel]

Returns: 1 if someone by that nickname is on the channel (or any channel if no channel is specified) and has voice (+v); 0 otherwise

Module: irc

onchan <nickname> [channel]

Returns: 1 if someone by that nickname is on the specified channel (or any channel if none is specified); 0 otherwise

Module: irc

nick2hand <nickname> [channel]

Returns: the handle of a nickname on a channel. If a channel is not specified, the bot will check all of its channels. If the nick is not found, "" is returned. If the nick is found but does not have a handle, "*" is returned.

Module: irc

hand2nick <handle> [channel]

Returns: nickname of the first person on the specified channel (if one is specified) whose nick!user@host matches the given handle; "" is returned if no match is found. If no channel is specified, all channels are checked.

Module: irc

handonchan <handle> [channel]

Returns: 1 if the the nick!user@host for someone on the channel (or any channel if no channel name is specified) matches for the handle given; 0 otherwise

Module: irc

ischanban <ban> <channel>

Returns: 1 if the specified ban is on the given channel's ban list (not the bot's banlist for the channel)

Module: irc

ischanexempt <exempt> <channel>

Returns: 1 if the specified exempt is on the given channel's exempt list (not the bot's exemptlist for the channel)

Module: irc

ischaninvite <invite> <channel>

Returns: 1 if the specified invite is on the given channel's invite list (not the bot's invitelist for the channel)

Module: irc

chanbans <channel>

Returns: a list of the current bans on the channel. Each element is a sublist of the form {<ban> <bywho> <age>}. age is seconds from the bot's point of view

Module: irc

chanexempts <channel>

Returns: a list of the current exempts on the channel. Each element is a sublist of the form {<exempts> <bywho> <age>}. age is seconds from the bot's point of view

Module: irc

chaninvites <channel>

Returns: a list of the current invites on the channel. Each element is a sublist of the form {<invites> <bywho> <age>}. age is seconds from the bot's point of view

Module: irc

resetbans <channel>

Description: removes all bans on the channel that aren't in the bot's ban list and refreshes any bans that should be on the channel but aren't

Returns: nothing

Module: irc

resetexempts [channel]

Description: removes all exempt on the channel that aren't in the bot's exempt list and refreshes any exempts that should be on the channel but aren't

Returns: nothing

Module: irc

resetinvites [channel]

Description: removes all invites on the channel that aren't in the bot's invite list and refreshes any invites that should be on the channel but aren't

Returns: nothing

Module: irc

resetchan <channel>

Description:

Returns: rereads in the channel info from the server

Module: irc

getchanhost <nickname> [channel]

Returns: user@host of the specified nickname (the nickname is not included in the returned host). If a channel is not specified, bot will check all of its channels. If the nickname is not on the channel(s), "" is returned.

Module: irc

getchanjoin <nickname> <channel>

Returns: timestamp (unixtime format) of when the specified nickname joined the channel

Module: irc

onchansplit <nick> [channel]

Returns: 1 if that nick is split from the channel (or any channel if no channel is specified); 0 otherwise

Module: irc

chanlist <channel> [flags[&chanflags]]

Description: flags are any global flags; the '&' denotes to look for channel specific flags. Examples:

n

Global Owner

&n

Channel Owner

o&m

Global Op, Channel Master

Returns: list of nicknames currently on the bot's channel that have all of the flags specified;. If no flags are given, all of the nicknames are returned. Please note that if you're executing chanlist after a part or sign bind, the gone user will still be listed, so you can check for wasop, isop, etc.

Module: irc

getchanidle <nickname> <channel>

Returns: number of minutes that person has been idle; 0 if the specified user isn't on the channel

Module: irc

getchanmode <channel>

Returns: string of the type "+ntik key" for the channel specified

Module: irc

jump [server [port [password]]]

Description: jumps to the server specified, or (if none is specified) the next server in the bot's serverlist

Returns: nothing

Module: server

pushmode <channel> <mode> [arg]

Description: sends out a channel mode change (ex: pushmode #lame +o goober) through the bot's queuing system. All the mode changes will be sent out at once (combined into one line as much as possible) after the script finishes, or when 'flushmode' is called.

Returns: nothing

Module: irc

flushmode <channel>

Description: forces all previously pushed channel mode changes to be sent to the server, instead of when the script is finished (just for the channel specified)

Returns: nothing

Module: irc

topic <channel>

Returns: string containing the current topic of the specified channel

Module: irc

validchan <channel>

Description: checks if the bot has a channel record for the specified channel. Note that this does not necessarily mean that the bot is ON the channel.

Returns: 1 if the channel exists, 0 if not

Module: nothing

isdynamic <channel>

Returns: 1 if the channel is a dynamic channel; 0 otherwise

Module: channels

setudef <flag/int/str> <name>

Description: initializes a user defined channel flag, string, or integer setting. You can use it like any other flag/setting. IMPORTANT: Don't forget to reinitialize your flags/settings after a restart, or it'll be lost.

Returns: nothing

Module: channels

renudef <flag/int/str> <oldname> <newname>

Description: renames a user defined channel flag, string, or integer setting.

Returns: nothing

Module: channels

deludef <flag/int/str> <name>

Description: deletes a user defined channel flag, string, or integer setting.

Returns: nothing

Module: channels