IRC, which stands for Internet Relay Chat, was the primary was people talked on the internet, before the app revolution produced the likes of Whatsapp, Telegram and Skype. Despite the falling userbase, IRC is still incredibly effective when it comes to large group chats, due the ease with which it can be set up, the anonymity it offers, and it's promise of fast messaging and negligibly small data usage. While IRC is in no way a substitute for modern chat-apps, some of the unique features are really handy. IRC bots are among them. (Telegram allows for bots as well)
Bots are easy to make, can be coded in a variety of programming languages, and can do everything from moderating a channel to playing a group game, in a way you can never do in an average Whatsapp group. Watch this video tutorial narrated by me (Yes, I know my accent isn't great. I'm working on it.) to learn just how simple making an IRC bot in Python is.
Full source code of the bot, as used in the video:
Bots are easy to make, can be coded in a variety of programming languages, and can do everything from moderating a channel to playing a group game, in a way you can never do in an average Whatsapp group. Watch this video tutorial narrated by me (Yes, I know my accent isn't great. I'm working on it.) to learn just how simple making an IRC bot in Python is.
Full source code of the bot, as used in the video:
import sys
import time
import socket
server="irc.freenode.net"
botnick="thorsWarhammer"
channel="##testchanneloneagz"
#Establish connection
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((server,6667))
irc.setblocking(False)
time.sleep(1)
irc.send("USER "+botnick+" "+botnick+" "+botnick+" :Hello! I am a test bot!\r\n")
time.sleep(1)
irc.send("NICK "+botnick+"\n")
time.sleep(1)
irc.send("JOIN "+channel+"\n")
while 1:
time.sleep(0.1)
try:
text=irc.recv(2040)
print(text)
except Exception:
pass
if text.find("PING")!=-1:
irc.send("PONG "+text.split()[1]+"\r\n")
if text.lower().find(":@hi")!=-1:
irc.send("PRIVMSG "+channel+" :Hello!\r\n")
text=""
input()
IRC Documentation: https://meta.wikimedia.org/wiki/IRC/Instructions
In the above link, you can find commands to kick/ban a user, and perform various other operations with your bot or your user account.
That's all for now folks! For those who cannot watch the video I shall be updating this post with a written tutorial in a few days time.
This comment has been removed by a blog administrator.
ReplyDeletehttps://github.com/lil5/SlowDownBot
ReplyDeleteI've made a bot inspired from your code. I hope you don't mind the License (MLP-2.0)
it doesn't work for me it gives errors update your irc and make a new video
ReplyDelete