-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathirc_bot.rb
More file actions
21 lines (17 loc) · 1.11 KB
/
irc_bot.rb
File metadata and controls
21 lines (17 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# customize the name of your bot on the following line
@name = "nerdinand-bot"
# This method gets called, whenever a message is sent to our IRC channel. In it you can react to
# the users' inputs in whatever way you like...
def handle_privmsg(sender, recipient, chat_message)
# In here you can react to messages that appear in the channel or are sent to your bot privately.
# You get these 3 pieces of information:
# * sender: This is the user name that sent the message to your bot.
# * recipient: This is who the message was sent to. It can either be the name of a channel
# that your bot has joined (e.g. "#rubymonstas"), or it is the name of your bot,
# in which case this is a private message sent directly to your bot.
# * chat_message: This is the content of the message that the user has typed.
# Here you can write code that handles this information to interact with the users.
# You can let the bot send messages by calling the `send_privmsg` method, for example like this:
# send_privmsg("#rubymonstas", "Hi everyone!")
end
require_relative './irc_magic.rb'