Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # python irc_bot.py
- from irc_class import *
- import os
- import random
- import socket
- ircbot=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- ## IRC Config
- server="localhost" # Provide a valid server IP/Hostname
- port=5000
- channel="#Home"
- botnick="J__Bot"
- botnickpass="pass"
- botpass="<%= @guido_password %>"
- irc=IRC()
- irc.connect(server, port, channel, botnick, botpass, botnickpass)
- while True:
- text=irc.get_response()
- print(text)
- if "PRIVMSG" in text and channel in text and "hello" in text:
- irc.send(channel, "Hello!")
- File "./irc_bot.py", line 21, in <module>
- text=irc.get_response()
- File "/var/www/radio/Own-Bot/irc_class.py", line 37, in get_response
- self.irc.send(bytes('PONG ' + resp.split().decode("UTF-8") [1] + '\r\n', "UTF-8"))
- AttributeError: 'list' object has no attribute 'decode'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement