Channels module


This module provides channel related support for the bot. Without it you wont be able to make the bot join a channel or to save channel specific userfile information.

  1. Config file settings
  2. Tcl commands
  3. Tcl variables

1. Config file settings

Lines in bold are the lines that need to be included in the eggdrop config file if you want to use the share module.
Lines in bold italics are optional and only required if you wish to change the default behaviour for that particular feature.

Put this line into your eggdrop.conf file to load channel module:

loadmodule channels

There are also some variables you can to set in your config file:

set chanfile "LamestBot.chan"

Enter here the filename where dynmic channel settings are stored

set ban-time 120

Set here how long temporary bans will last (in minutes). If you set this setting to 0, the bot will never remove them.

Valid settings are 0-infinite

set exempt-time 60

Set here how long temporary exempts will last (in minutes). If you set this setting to 0, the bot will never remove them. The bot will check the exempts every X minutes, but will not remove the exempt if a ban is set on the channel that matches that exempt. Once the ban is removed then the exempt will be removed the next time the bot checks.

Please note that this is an IRCNET feature.

Valid settings are 0-infinite

set invite-time 60

Set here how long temporary invites will last (in minutes). If you set this setting to 0, the bot will never remove them. The bot will check the invites every X minutes, but will not remove the invite if a channel is set to +i. Once the channel is -i then the invite will be removed the next time the bot checks.

Please note that this is an IRCNET feature.

Valid settings are 0-infinite

set force-expire 0

Set this setting to 1 if you want your bot to expire bans/exempts/invites set by other opped bots on the channel

Valid settings are 0 and 1.

set share-greet 0

Set this setting to 1 if you want your bot to share user greets with other bots on the channel if sharing user data

Valid settings are 0 and 1.

set use-info 1

Set this setting to 1 if you want to allow users to store an info line

Valid settings are 0 and 1.

channel add #channel { SETTINGS }

Add each static channel you want your bot to sit in using this command. There are many different possible settings you can insert into this command.

chanmode +<modes>-<modes>

This setting makes the bot enforce some channel modes. It will add always the +<modes> modes and remove the -<modes> modes.

Example:

chanmode "+nt-likm"
This will make the bot enforce the use of t and n and the removal of l, i, k and m. The bot wont care about settings like s.

idle-kick 0

This setting will let the bot check every minute for x minutes idle users. Set this to 0 or leave it out to disable idle check.

stopnethack-mode 0

This setting will make the bot de-op anyone who enters the channel with serverops.

There are seven different modes for this setting:

0 turn off,
1 isoptest (allow serverop if registered op),
2 wasoptest (allow serverop if op before split)
3 allow serverop if isop or wasop
4 allow serverop if isop and wasop
5 if channel -bitch: see stopnethack-mode 3
   if channel +bitch: see stopnethack-mode 1
6 if channel -bitch: see stopnethack-mode 2
   if channel +bitch: see stopnethack-mode 4

need-op { putserv "PRIVMSG #lamest :op me cos i'm lame!" }

This setting will make the bot do the specified thing in the brackets if it becomes opless.
Attention, you cannot put anything that is longer than 120 chars in here!
Note that if you use scripts like get-ops, you don't need to set this setting.

need-invite { putserv "PRIVMSG #lamest :let me in!" }

This setting will make the bot do the specified thing in the brackets if it needs an invitation to the channel.
Attention, you cannot put anything that is longer than 120 chars in here!
Note that if you use scripts like get-ops, you don't need to set this setting.

need-key { putserv "PRIVMSG #lamest :let me in!" }

This setting will make the bot do the specified thing in the brackets if it needs a key to a channel.
Attention, you cannot put anything that is longer than 120 chars in here!
Note that if you use scripts like get-ops, you don't need to set this setting.

need-unban { putserv "PRIVMSG #lamest :let me in!" }

This setting will make the bot do the specified thing in the brackets if it becomes banned.
Attention, you cannot put anything that is longer than 120 chars in here!
Note that if you use scripts like get-ops, you don't need to set this setting.

need-limit { putserv "PRIVMSG #lamest :let me in!" }

This setting will make the bot do the specified thing in the brackets if it needs a limit raise.
Attention, you cannot put anything that is longer than 120 chars in here!
Note that if you use scripts like get-ops, you don't need to set this setting.

flood-chan 10:60

Set here how many channel messages in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against chan floods

flood-deop 3:10

Set here how many deops in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against deop floods

flood-kick 3:10

Set here how many kicks in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against kick floods

flood-join 5:60

Set here how many channel joins in how many seconds are recognized as a flood. Not specifying or using number = 0 will not check against join floods

flood-ctcp 3:60

Set here how many channel ctcps in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against ctcp floods

flood-nick 5:60

Set here how many nick changes in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against nick floods

channel set <chan> +/-<setting>

There are many different options for a channel which you can define. They can be enabled or disabled by a plus or minus infront of them.

Examples:

chanset #lamest +autoop

This will make the bot auto-op every registered op on join

chanset #lamest +autoop -userbans

This will make the bot auto-op every registered op on join and enforce all bans to be made through the bots console

A complete list of all available channel settings:

enforcebans

when a ban is set, kick people who are on the channel and match the new ban? (ie, they were on the channel before the ban)

dynamicbans

only activate bans on the channel when necessary? (this keeps the channel's ban list from getting excessively long. The bot still remembers every ban, but it only activates a ban on the channel when it sees someone join who matches that ban.)

userbans

allow bans to be made by users directly? (if turned off, the bot will require all bans to be made through the bot's console)

dynamicexempts

only activate exempts on the channel when necessary? (this keeps the channel's exempt list from getting excessively long. The bot still remembers every exempt, but it only activates a exempt on the channel when it sees a ban set matching the exempt. The exempt remains active on the channel for as long as the ban is still active.

userexempts

allow exempts to be made by users directly? (if turned off, the bot will require all exempts to be made through the bot's console)

dynamicinvites

only activate invites on the channel when necessary? (this keeps the channel's invite list from getting excessively long. The bot still remembers every invite, but the invites are only activated when the channel is set to invite only and a user joins after requesting an invite. Once set the invite remains until the channel goes to -i

userinvites

allow invites to be made by users directly? (if turned off, the bot will require all invites to be made through the bot's console)

autoop

op users with the +o (op) flag as soon as they join the channel?
(hint: this is a BAD IDEA)

bitch

only let users with +o (op) flag be channel ops?

greet

show a user's info line when they join the channel?

protectops

re-op a user with the +o (op) flag if they get deopped?

protectfriends

re-op a user with the +f (friend) flag if they get deopped?

statuslog

log the channel status line every 5 minutes? (some people think it's annoying; i think it's neat)

revenge

remember people who deop/kick/ban the bot or valid ops, and punish them? Users with +f (friend) flag are exempt from revenge

autovoice

voice users with +v (voice) flag when they join the channel?

secret

prevent this channel from being listed on the botnet? (for paranoid people)

shared

share user channel info for this channel?

cycle

cycle the channel when it becomes op-less?

dontkickops

do you want the bot not to be able to kick +o flag users ? letting them kick-flood for instance, to protect the channel agaisnt clone attacks

inactive

prevents the bot from joining the channel (or makes it leave the channel if it is already there). Can be useful to make the bot leave a channel without loosing it's settings (flood settings, all these "channel set" settings), user flags for this channel, bans for this channel, and without affecting any sharing

seen

respond to seen requests in the channel? (seen module must be loaded)

nodesynch

allow non-ops to perform channel modes? (Stops bot from fighting with services such as ChanServ)

The following setting are used as default values when you .+chan #chan or .tcl channel add #chan. Look in the section above for explanation on every option.

set global-flood-chan 10:60
set global-flood-deop 3:10
set global-flood-kick 3:10
set global-flood-join 5:60
set global-flood-ctcp 3:60
set global-flood-nick 5:60

set global-chanset {
  -nodesynch -enforcebans
  +dynamicbans +userbans
  -autoop -bitch
  +greet +protectops
  +statuslog -revenge
  -secret -autovoice
  +cycle +dontkickops
  -inactive -protectfriends
  +shared -seen
  +userexempts +dynamicexempts
  +userinvites +dynamicinvites
}

set global-chanmode "nt-likm"

set global-stopnethack-mode 0


2. Tcl commands

channel add <name> <option-list>

adds a channel record for the bot to monitor; the full list of possible options is given in the "eggdrop.conf" sample config file; note that the channel options must be in a list (enclosed in {})

returns: nothing

channel set <name> <options...>

sets options for the channel specified; the full list of possible options is given in the "eggdrop.conf" sample config file

returns: nothing

channel info <name>

returns: list of info about that channel record: enforced mode, idle kick limit, need-op script, need-invite script, and then various +/- options as seen in the config file

channel remove <name>

destroys a channel record for the bot and makes the bot no longer monitor that channel

returns: nothing

savechannels

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

returns: nothing

loadchannels

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

returns: nothing

channels

returns: list of the channels the bot is monitoring (or trying to)

validchan <channel>

checks if the bot is monitoring that channel

returns: 1 if the channel exists, 0 if not

isdynamic <channel>

returns: 1 if the channel is an existing dynamic channel, 0 if not

newchanban <channel> <ban> <creator> <comment> [lifetime] [options]

adds a ban to the enforced ban list of a channel; creator is given credit for the ban in the ban list; lifetime is specified in minutes; if lifetime is not specified, ban-time (usually 60) is used; setting the lifetime to 0 makes it a permanent ban; valid options are:

sticky

forces the ban to be always active on a channel, even with dynamic bans on.Prefacing the comment with a * has the same effect.

none

no effect

returns: nothing

newban <ban> <creator> <comment> [lifetime] [options]

adds a ban to the global ban list (which takes effect on all channels); other arguments work exactly like newchanban

returns: nothing

killchanban <channel> <ban>

removes a ban from the enforced ban list for a channel

returns: "1" if successful, "0" otherwise

killban <ban>

removes a ban from the global ban list

returns: "1" if successful, "0" otherwise

isban <ban> [channel]

returns: "1" if that ban is in the global ban list, "0" otherwise; if a channel is specified, that channel's ban list is checked too

ispermban <ban> [channel]

returns: "1" if that ban is in the global ban list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's ban list is checked too

matchban <nick!user@host> [channel]

returns: "1" if that user address matches a ban in the global ban list, "0" otherwise; if a channel is specified, that channel's ban list is checked too

banlist [channel]

returns: list of global bans, or (if a channel is specified) list of channel-specific bans; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format)

newchanexempt <channel> <exempt> <creator> <comment> [lifetime] [options]

adds a exempt to the exempt list of a channel; creator is given credit for the exempt in the exempt list; lifetime is specified in minutes; if lifetime is not specified, exempt-time (usually 60) is used; setting the lifetime to 0 makes it a permanent exempt; valid options are:

sticky

forces the exempt to be always active on a channel, even with dynamic exempts on. Prefacing the comment with a * has the same effect.

none

no effect

returns: nothing

newexempt <exempt> <creator> <comment> [lifetime] [options]

adds a exempt to the global exempt list (which takes effect on all channels); other arguments work exactly like newchanexempt

returns: nothing

killchanexempt <channel> <exempt>

removes a exempt from the exempt list for a channel

returns: "1" if successful, "0" otherwise

killexempt <exempt>

removes a exempt from the global exempt list

returns: "1" if successful, "0" otherwise

isexempt <exempt> [channel]

returns: "1" if that exempt is in the global exempt list, "0" otherwise; if a channel is specified, that channel's exempt list is checked too

ispermexempt <exempt> [channel]

returns: "1" if that exempt is in the global exempt list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's exempt list is checked too

matchexempt <nick!user@host> [channel]

returns: "1" if that user address matches a exempt in the global exempt list, "0" otherwise; if a channel is specified, that channel's exempt list is checked too

exemptlist [channel]

returns: list of global exempts, or (if a channel is specified) list of channel-specific exempts; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format)

newchaninvite <channel> <invite> <creator> <comment> [lifetime] [options]

adds a invite to the invite list of a channel; creator is given credit for the invite in the invite list; lifetime is specified in minutes; if lifetime is not specified, invite-time (usually 60) is used; setting the lifetime to 0 makes it a permanent invite; valid options are:

sticky

forces the invite to be always active on a channel, even with dynamic invites on. Prefacing the comment with a * has the same effect.

none

no effect

returns: nothing

newinvite <invite> <creator> <comment> [lifetime] [options]

adds a invite to the global invite list (which takes effect on all channels); other arguments work exactly like newchaninvite

returns: nothing

killchaninvite <channel> <invite>

removes a invite from the invite list for a channel

returns: "1" if successful, "0" otherwise

killinvite <invite>

removes a invite from the global invite list

returns: "1" if successful, "0" otherwise

isinvite <invite> [channel]

returns: "1" if that invite is in the global invite list, "0" otherwise; if a channel is specified, that channel's invite list is checked too

isperminvite <invite> [channel]

returns: "1" if that invite is in the global invite list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's invite list is checked too

matchinvite <nick!user@host> [channel]

returns: "1" if that user address matches a invite in the global invite list, "0" otherwise; if a channel is specified, that channel's invite list is checked too

invitelist [channel]

returns: list of global invites, or (if a channel is specified) list of channel-specific invites; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format)

addchanrec <handle> <channel>

add a channel record for the user

returns: "1" on success, "0" if the user does not exist or if there isn't such a channel

delchanrec <handle> <channel>

removes a channel record for the user; this includes all associated channel flags

returns: "1" on success, "0" if the user does not exist or if there isn't such a channel

getchaninfo <handle> <channel>

returns: info line for a specific channel (behaves just like 'getinfo')

setchaninfo <handle> <channel> <info>

sets the info line on a specific channel for a user

returns: nothing

setlaston <handle> [channel] [time]

sets the laston time for a user, if a channel is specified then the channel laston time is set, otherwise the global one is set, if no time is given the current time is used.

setudef <flag/int> <name>

initializes a user defined channel flag 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.

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

renames a user defined channel flag or integer setting.

deludef <flag/int> <name>

deletes a user defined channel flag or integer setting.


3. Tcl variables

share-greet 0/1

If sharing userfiles, share info lines?

use-info 0/1

Allow use of global & channel info lines

ban-time <mins>

Set the time a ban will be kept on a dynamicbans channel

exempt-time <mins>

Set the time an exempt will be kept on a dynamicexempts channel

invite-time <mins>

Set the time an invite will be kept on a dynamicinvites channel

chanfile

Where to store settings set using +/-chan, settings in this file OVERRIDE config file settings. If you want the config file settings to override, set this to ""


© 1997 Robey Pointer
© 1999,2000 Eggheads