Using Your Eggdrop

Log on to the partyline

Now that your bot is online, you’ll want to join the partyline to further use the bot. First, read what it tells you when you started it up:

STARTING BOT IN USERFILE CREATION MODE.
Telnet to the bot and enter 'NEW' as your nickname.
OR go to IRC and type:  /msg BotNick hello
This will make the bot recognize you as the master.

You can either telnet to the bot, or connect to the bot using DCC Chat. To telnet, you’ll either need a program like Putty (Windows), or you can do it from the command line of your shell using the telnet command:

telnet <IP of bot> <listen port>

You can find the IP and port the bot is listening on by a) remembering what you set in the config file ;) or b) reading the display the bot presented when it started up. Look for a line that looks similar to this:

Listening for telnet connections on 2.4.6.9:3183 (all).

This tells you that the bot is listening on IP 2.4.6.9, port 3183. If you see 0.0.0.0 listed, that means Eggdrop is listening on all available IPs on that particular host.

If you choose not to telnet to connect to the partyline, you can either /dcc chat BotNick or /ctcp BotNick chat. If one of those methods does not work for you, try the other. Once you’re on the bot for the first time, type .help for a short list of available commands, or .help all for a more thorough list.

Common first steps

To learn more about any of these commands, type .help <command> on the partyline. It will provide you the syntax you need, as well as a short description of how to use the command.

Join a Channel

To tell the Eggdrop to join a channel, use:

.+chan #channel

Add a User

To add a user to the bot, use:

.+user <handle>

Add a Host to a User

The handle is the name that the bot uses to track a user. No matter what nickname on IRC a user uses, a single handle is used to track the user by their hostmask. To add a hostmask of a user to a handle, use:

.+host <handle> <hostmask>

where the hostmask is in the format of <nick>!<ident>@hostname.com . Wildcards can be used; common formats are *!*@hostname.com for static hosts, or *!ident@*.foo.com for dynamic hostnames.

Assign Permission Flags

To assign an access level to a user, first read .help whois for a listing of possible access levels and their corresponding flags. Then, assign the desired flag to the user with:

.chattr <+flag> <handle>

So to grant a user the voice flag, you would do:

.chattr +v handle

It is important to note that, when on the partyline, you want to use the handle of the user, not their current nickname.

Configure Channel Settings

Finally, Eggdrop is often used to moderate and control channels. This is done via the .chanset command. To learn more about the (numerous!) settings that can be used to control a channel, read:

.help chaninfo

Common uses involve setting channels modes. This can be done with the chanmode channel setting:

.chanset #channel chanmode +snt

which will enforce the s, n, and t flags on a channel.

Automatically restarting an Eggdrop

A common question asked by users is, how can I configure Eggdrop to automatically restart should it die, such as after a reboot? Historically, Eggdrop relied on the host’s crontab system to run a script (called botchk) every ten minutes to see if the eggdrop is running. If the eggdrop is not running, the script will restart the bot, with an optional email sent to the user informing them of the action. Newer systems come with systemd, which can provide better real-time monitoring of processes such as Eggdrop. You probably want to use systemd if your system has it.

Crontab Method (Old)

  1. Enter the directory you installed your Eggdrop to. Most commonly, this is ~/eggdrop (also known as /home/<username>/eggdrop).

  2. Just humor us- run ./scripts/autobotchk without any arguments and read the options available to you. They’re listed there for a reason!

  3. If you don’t want to customize anything via the options listed in #2, you can install a crontab job to start Eggdrop simply by running:

    ./scripts/autobotchk yourEggdropConfigNameHere.conf
    
  4. Review the output of the script, and verify your new crontab entry by typing:

    crontab -l
    

By default, it should create an entry that looks similar to:

0,10,20,30,40,50 * * * * /home/user/bot/scripts/YourEggdrop.botchk 2>&1

This will run the generated botchk script every ten minutes and restart your Eggdrop if it is not running during the check. Also note that if you run autobotchk from the scripts directory, you’ll have to manually specify your config file location with the -dir option. To remove a crontab entry, use crontab -e to open the crontab file in your system’s default editor and remove the crontab line.

Systemd Method (Newer Systems)

  1. Enter the directory you installed your Eggdrop to. Most commonly, this is ~/eggdrop (also known as /home/<username>/eggdrop).

  2. Install the systemd job for Eggdrop simply by running:

    ./scripts/autobotchk yourEggdropConfigNameHere.conf -systemd
    
  3. Note the output at the end of the script informing you of the command you can use to start/stop the Eggdrop in thee future. For example, to manually start the Eggdrop, use:

    systemctl --user start <botname>.service
    

To stop Eggdrop, use:

systemctl --user stop <botname>.service

To rehash (not reload) Eggdrop, use:

systemctl --user reload <botname>.service

(Yes, we acknowledge the confusion that the systemd reload command will execute the Eggdrop ‘.rehash’ command, not the ‘.reload’ command. Unfortunately, systemd did not consult us when choosing its commands!)

To prevent Eggdrop from automatically running after a system start, use:

systemctl --user disable <botname>.service

To re-enable Eggdrop automatically starting after a system start, use:

systemctl --user enable <botname>.service

Authenticating with NickServ

Many IRC features require you to authenticate with NickServ to use them. You can do this from your config file by searching for the line:

#  putserv "PRIVMSG NickServ :identify <password>"

in your config file. Uncomment it by removing the ‘#’ sign and then replace <password> with your password. Your bot will now authenticate with NickServ each time it joins a server.

Setting up SASL authentication

Simple Authentication and Security Layer (SASL) is becoming a prevalant method of authenticating with IRC services such as NickServ prior to your client finalizing a connection to the IRC server, eliminating the need to /msg NickServ to identify yourself. In other words, you can authenticate with NickServ and do things like receive a cloaked hostmask before your client ever appears on the IRC server. Eggdrop supports three methods of SASL authentication, set via the sasl-mechanism setting:

  • PLAIN: To use this method, set sasl-mechanism to 0. This method passes the username and password (set in the sasl-username and sasl-password config file settings) to the IRC server in plaintext. If you only connect to the IRC server using a connection protected by SSL/TLS this is a generally safe method of authentication; however you probably want to avoid this method if you connect to a server on a non-protected port as the exchange itself is not encrypted.

  • ECDSA-NIST256P-CHALLENGE: To use this method, set sasl-method to 1. This method uses a public/private keypair to authenticate, so no username/password is required. Not all servers support this method. If your server does support this, you you must generate a certificate pair using:

    openssl ecparam -genkey -name prime256v1 -out eggdrop-ecdsa.pem
    

    You will need to determine your public key fingerprint by using:

    openssl ec -noout -text -conv_form compressed -in eggdrop-ecdsa.pem | grep '^pub:' -A 3 | tail -n 3 | tr -d ' \n:' | xxd -r -p | base64
    

    Then, authenticate with your NickServ service and register your public certificate with NickServ. You can view your public key On Libera for example, it is done by:

    /msg NickServ set pubkey <fingerprint string from above goes here>
    
  • EXTERNAL: To use this method, set sasl-method to 2. This method allows you to use other TLS certificates to connect to the IRC server, if the IRC server supports it. An EXTERNAL authentication method usually requires you to connect to the IRC server using SSL/TLS. There are many ways to generate certificates; one such way is generating your own certificate using:

    openssl req -new -x509 -nodes -keyout eggdrop.key -out eggdrop.crt
    

You will need to determine yoru public key fingerprint by using:

openssl x509 -in eggdrop.crt -outform der | sha1sum -b | cut -d' ' -f1

Then, ensure you have those keys loaded in the ssl-privatekey and ssl-certificate settings in the config file. Finally, to add this certificate to your NickServ account, type:

/msg NickServ cert add <fingerprint string from above goes here>

DCC Chat and the Party Line

The great majority of Eggdrop's functions are controlled in a DCC chat session with the bot. DCC chat with the bot has two purposes - to use as a console for entering Eggdrop commands, and to use as a chat area. Simply DCC chat to the bot just like you would a normal user. You can also make the bot initiate the DCC session by typing /ctcp <botnick> CHAT, where <botnick> is the nick of your bot. This method is particularly useful if you're behind a firewall which prevents you from initiating the DCC session.

When you've established a connection to the bot, you will be prompted for your password, and then automatically placed on the party line (the main chat area). You type in Eggdrop commands by preceding them with a period (e.g. .help, .bots, .whom, .+chan, etc.). Anything not preceded with a period is sent out to other users on the party line, just like a message sent to an IRC channel. There are also other 'channels' on the bot (other than the party line) which you and others can switch to, and in this way the bot can act a bit like an IRC server.

Telnet

You can also access the command console and party line via a telnet session to the bot. To telnet to the bot, you simply enter its hostname and port (as specified by the 'listen' command in the config file) in your telnet client. You will be asked for your nickname and password on connecting. Once connected, you'll be at the console and on the party line just as you would if you'd opened a DCC session. Telnet is particularly useful if you need to connect to the bot but aren't able to DCC to it (e.g. when the bot isn't on IRC).

If the text output appears incorrectly during the telnet session (e.g. each new line is indented by the length of the previous line), you may need to enable some type of "new line mode" in your telnet client's options. In PuTTY, for example, you would enable Implicit CR in every LF under Terminal.

Using the Console

Eggdrop has a comprehensive internal help system. The first thing you should do when you've opened a DCC chat session with the bot is type .help. This will display most of the commands you can use. For more info about a particular command, you type .help <command>.

The DCC chat session not only allows you to speak to users on the party line (and other internal 'channels') and use Eggdrop commands, but also lets you monitor your bot. Using the .console command, you can change the types of information displayed to you, e.g. you can choose to view commands used by others, view msgs and notices sent to the bot, view public messages to a channel, and so on. Your console settings also determine what IRC channel you're working with. For example, if your bot is on #donkeys and #horses, you can set your console to either one of those channels. Many of Eggdrop's commands will apply to your current console channel, e.g. if your console is set to #donkeys and you use the command .op saddle, the bot will op 'saddle' on #donkeys. You can change your current console channel using .console <#channel>. You may save your current console settings using .save.

Msg Commands

Eggdrop has a limited number of commands performed via msg, but a few of them are quite important, such as the op command and ident command. For a list of msg commands, type /msg <botnick> help. Additional msg commands may be added by certain Tcl scripts. Be very careful when using msg commands that include your password - if you usually type /msg <command> <password> in a channel window in your IRC client, you will eventually end up accidentally msging your password to the channel for everyone to see.

Public Commands

Eggdrop has no built-in public commands (i.e. commands you type in the channel) except for 'seen'. If you have the seen module loaded (i.e. loadmodule seen in the config file) and the channel is set to +seen, then the bot will respond to the seen <nick> command in the channel. There are several Tcl scripts out there that add public commands to Eggdrop. For certain functions, such as info commands and games, this is fine. But using public commands for functions such as giving ops, adding users, jumping the bot to a new server, and so on can be insecure. Such scripts could allow malicious users to take control of your channel or Eggdrop, so a good public commands script for these types of functions must have a good authorisation system built-in, and preferably only make the commands available to users who are opped on the channel. Although some people think it looks cool to be able to use public commands without being opped, it is less secure.

The Userfile

Your Eggdrop's userfile controls which users can access the bot, and the level of access each of these users has. The userfile also contains the ban lists and ignore lists. Userfile management is one of the fundamental things you need to learn in order to use your Eggdrop effectively.

When you first start your Eggdrop and introduce yourself using the hello command or equivalent, you will be added as the first user and be given all owner privileges (if you have learn-users switched off, the hello command will be deactivated once you've introduced yourself as owner). To display your userfile entry, type .whois <yournick> in the console. You will see a display similar to the following:

HANDLE    PASS NOTES FLAGS            LAST
YourNick  yes      0 fjmnoptx        19:57 (partyline )
#donkeys             fmno            18:44
#horses              fmno            14 Apr
HOSTS: *!mynick@*.nice.net, *!mynick@207.324.333.*

The information above displays the user's handle (the handle is simply the user's nickname on the bot), whether or not they have a password set, how many notes they have, their global and channel flags, where and when they were last seen by the bot, and their hostmasks. Below you'll learn how to manipulate the userfile.

Displaying all users

To display all the users in your bot's userfile, type .match * 999. This will display a record similar to the one shown above for each user.

Adding/removing users

There are three ways a user can be added to the bot. If you have learn-users enabled in the config file, anyone can msg the hello command to the bot and the bot will add them with the default flags (as set in the config file's default-flags setting). Otherwise, you may add a user using either the .adduser or .+user command in the console. If the user you want to add is in one of the bot's channels, then .adduser is the most convenient command. Make sure the channel the user is in is your current console channel (read Using the Console again if you're not sure about this), then type .adduser <nick>, where <nick> is the nickname of the user you want to add. The user will be added to the bot's userfile with the default flags, and their hostmask will automatically be added. The .+user command should be used when the person you want to add is not on IRC. Type .+user <nick> <hostmask> to add the user with the specified nickname and hostmask.

Once a user has been added, they will need to set a password using the pass command. Tell the user to type /msg <botnick> pass <password> to set their password. You may instead wish to set a password for them using the .chpass command (explained below).

To remove a user from the bot, simply type .-user <handle>.

Changing a user's password

To set a password for a user or change their password, type .chpass <handle> <password>. You can unset the password by doing .chpass <handle> without specifying a password.

User flags

User flags determine what privileges a user has, e.g. whether or not they can get ops on a channel, which bot commands they can use, etc. All built-in flags are lower case alphabet letters. You can list all the flags by typing .help whois, but for now you only need to know the most important flags:

  • v - voice
  • o - op
  • m - master
  • n - owner
  • f - friend
  • p - partyline access

Many of the user flags are separated into two categories - global and channel - while some flags are global only. The v, o, m, n, and f flags are examples of flags that may be global or channel-specific, while the p flag is global-only. Channel flags only apply to a specific channel, e.g. if you give someone the o flag on #donkeys, the user will only be able to get ops on #donkeys, but if you give the user a global o flag, they will be able to get ops on all channels the bot is on. Global flags are also more powerful in nature, in that they give the user access to more powerful bot commands than the equivalent channel flags.

Flags are added to or removed from a user using the .chattr command. To add a global o flag, for example, you would type .chattr <handle> +o. To add a channel specific o flag, you would do .chattr <handle> +o <#channel>. Removing flags is much the same - to remove a global o it's .chattr <handle> -o, and to remove a channel o it's .chattr <handle> -o <#channel>. You can also add/remove multiple flags in one command, e.g. .chattr <handle> +fo will give the user the f and o flags.

Be very careful when giving out a global n (owner) flag. This will give the user access to virtually all the commands on your bot, and depending on how you have the bot configured it may also give the user access to your shell account via the .tcl command.

Bans, Invites, and Exempts

I assume that you know how bans work on IRC. Eggdrop handles bans, exempts and invites in various ways, and this file is intended to help clarify how these modes are used within the bot. From here on, ‘mode’ applies to all three modes (bans, exempts, and invites) unless otherwise specified. There are three types of modes:

Global modes

These modes will be active on every channel the bot monitors. Some will “expire” after a while (be removed automatically). Others are considered “permanent” and can only be removed by a master.

Channel modes

These modes are active only on one channel, and are almost always temporary modes that expire after an hour or so (depending on how long you’ve specified in the config file). Usually they’re created by a Tcl script of some sort.

Non-bot modes

These are modes that were not placed by the bot. They can be removed by anyone on the channel. The other two types of modes are protected by the bot (unless the channel settings specify otherwise), and have to be removed via the bot.

Bans can also be either sticky or unsticky:

Sticky

These modes are usually set by a user using the “.stick” command. Modes with this attribute are attempted to be kept active on the channel at all times by the bot, even if the channel is set to use dynamic modes. Obviously, if the channel isn’t set to use dynamic modes, this won’t have any effect.

Un-sticky

These modes are the style that Eggdrop sets by default when a user uses one of the commands that result in a mode. This attribute means that the ban will be removed if using dynamic modes after a certain time. If a mode is “sticky” and you wish to set it to be “un-sticky”, use the “.unstick” command.

Mode behavior:

Bans

If the channel is supporting dynamic bans, then the ban is set when a user with a matching hostmask joins the channel; otherwise, the modes are permanently set. On a channel with dynamic bans, the ban expires after ‘ban-time’ minutes (which is specified in the config file).

Exempts

If the channel is not supporting dynamic exempts, then they are set at all times. Otherwise, the exemption is set when a ban is placed whose host includes that covered by the exempt. The exempt will remain in place for at least ‘exempt-time’ minutes (defined in config file) or until after the corresponding ban has been removed, whichever happens last.

Invites

If the channel does not support dynamic invites, then they are set at all times. Otherwise, the invite is set when the channel is +i and a user requests an invite into the channel. The invite then remains set for ‘invite-time’ minutes (defined in config file) or until the channel goes -i again, whichever happens last.

Adding/removing hostmasks

The .+host <handle> <hostmask> command allows you to add hostmasks to a user, e.g. .+host hyena *!hyena@*.africa.net. To remove a hostmask from a user, use .-host <handle> <hostmask>.

The Ban List

The ban list is a part of the Eggdrop's userfile specifically for storing bans. Bans are added to the bot's internal ban list (also called the enforced or permanent ban list) using the .+ban command. They may also be added automatically by the bot (e.g. in response to a flood) or by a Tcl script. Internal bans can either be global (they apply to all channels the bot is on) or channel-specific. A ban may be permanent or expire automatically after a set amount of time, and it may optionally be 'sticky' (the bot makes sure the ban is always active on the channel).

Note that if you're using +dynamicbans in a channel's settings, a ban set in the bots internal ban list will be removed from the channel after ban-time minutes (as set in the config file), but it will remain in the internal ban list and will be reactivated whenever someone matching the ban joins the channel. If you're using +dynamicbans but want a ban to be active on the channel around the clock, you should make the ban sticky.

Displaying the ban list

Type .bans to display all currently active global bans and channel bans (for the current console channel). To display both active and inactive bans, type .bans all. These lists will also display bans that are active on the channel but not in the bot's internal ban list (such bans will be preceded by an asterisk).

Adding/removing bans

Global bans are added using the command .+ban <banmask> (e.g. .+ban *!*lamer@*.isp.net). You can add a channel ban using .+ban <banmask> <#channel>. Bans added using these commands will be permanent (i.e. they will remain in the bot's internal ban list until someone manually removes the ban).

You can remove a ban in one of two ways - using the banmask or reference number. The output of .bans all will display a reference number before each ban. If you want to remove ban number 4, for example, you would type .-ban 4. Keep in mind that a ban's reference number can change depending on the console channel you're using (e.g. if you type .console #horses, then .bans all, then .console #donkey, then .bans all, the reference numbers for bans may be different in the two lists you displayed). To remove a ban by its banmask, simply use .-ban <banmask>.

Making a ban sticky

You can make a ban sticky by using the .stick command with either the reference number or banmask, i.e. .stick <number> or .stick <banmask>. A sticky ban will be reactivated by the bot if anyone removes it from the channel.

Channel Settings

The way your Eggdrop acts and responds to events in your channel is largely affected by channel settings. Eggdrop has many built-in channel settings, and you can set different settings for each channel, allowing for extreme flexibility. When you first created your Eggdrop's config file and added entries for each channel the bot was to reside on, you would have encountered channel settings for the first time. In the setup guide, you may remember having seen the following:

channel add #horses {
  options
}

channel set #horses +option -option

You will notice that there are two types of channel settings. The first type are ones you set between the curly braces, such as idle-kick and flood protection settings (e.g. flood-join, etc.). The second type are on/off switches you set as part of a channel set command. These switches include options such as autoop, dynamicbans, revenge, etc. These settings are preceded by a + or - sign to specify whether or not you want the option to be active or inactive respectively.

For more information about each channel setting and its function, refer to the example config file(s) included with the bot.

Dynamic channel settings

If you want to add a channel to your bot or change a channel's settings, you don't actually need to edit the config file. Eggdrop has built-in DCC commands that allow you to add/remove channels and change channel settings via the console. To add a channel, simply type .+chan #channel. Removing a channel is as simple as .-chan #channel.

Channel settings are modified using the .chanset command. This works in different ways depending on whether you're changing a on/off switches such as autoop, dynamicbans, etc., or changing a channel option such as idle-kick. Below are some examples of how the .chanset command is used:

.chanset #channel +enforcebans will enable the enforcebans option.

.chanset #channel -dynamicbans +autoop will disable dynamicbans, and enable autoop.

.chanset #channel chanmode +sntk green will change the channel's chanmode setting to "+sntk green".

.chanset #channel idle-kick 60 will set the channel's idle-kick setting to 60.

To view all current channel settings for a channel, type .chaninfo #channel.

The chanfile

Because the bot cannot modify its own config file, channels added with the .+chan command and channel settings modified with the .chanset command need to be stored in a special file called the chanfile. You may remember specifying the chanfile in your bot's config file (e.g. set chanfile "mybot.chan"). The chanfile ensures any changes you make using the DCC commands will be remembered even if the bot is shut down and restarted.

There is a downside to having a channel file. Whenever the bot starts, it will first read from its config file, followed by the chanfile. Any channel settings you've specified in the config file will be overwritten by those in the chanfile - if you make changes to a channel's settings in the config file, they will not take effect. In order to change a channel's settings, you have to use the DCC commands. This can often result in a channel's actual settings being out of sync with those specified in the config file. As a result, some people chose not to add channels in the config file at all, instead using exclusively the DCC commands for adding channels and modifying their settings.

You can chose not to have a chanfile by setting it to "" in the bot's config file (e.g. set chanfile ""). This will allow you to make all changes to channel settings in the config file, but any changes you make using the DCC commands will not be remembered permanently by the bot.

  • eggdrop commands
  • 163 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

How to install IRC Defender

IRC Defender is a piece of IRC software (a bot) that is used to help ban proxies and keep your...

-bash: ./sc_serv: No such file or directory

SHOUTcast is a complete suite of products to power internet radio stations into the future....

How To Install EggDrop

Eggdrop is the most advanced, most popular, and best supported IRC bot. If you’ve never used a...

How to Install SHOUTCast Radio Server on Linux?

SHOUTcast is a free, open source and cross-platform software application that can be used to...

Frequently Asked Questions

Eggdrop FAQ How to start my eggdrop? How do I make the bot auto-op people? How do I make the...

Powered by WHMCompleteSolution