Advertisement
Multimedia

Untitled

Feb 28th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # python irc_bot.py
  3. from irc_class import *
  4. import os
  5. import random
  6. import socket
  7.  
  8. ircbot=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  9.  
  10. ## IRC Config
  11. server="localhost" # Provide a valid server IP/Hostname
  12. port=5000
  13. channel="#Home"
  14. botnick="J__Bot"
  15. botnickpass="pass"
  16. botpass="<%= @guido_password %>"
  17. irc=IRC()
  18. irc.connect(server, port, channel, botnick, botpass, botnickpass)
  19.  
  20. while True:
  21. text=irc.get_response()
  22. print(text)
  23.  
  24. if "PRIVMSG" in text and channel in text and "hello" in text:
  25. irc.send(channel, "Hello!")
  26.  
  27.  
  28. File "./irc_bot.py", line 21, in <module>
  29. text=irc.get_response()
  30. File "/var/www/radio/Own-Bot/irc_class.py", line 37, in get_response
  31. self.irc.send(bytes('PONG ' + resp.split().decode("UTF-8") [1] + '\r\n', "UTF-8"))
  32. AttributeError: 'list' object has no attribute 'decode'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement