Python Forum
IRC bot written in Python - join channel function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IRC bot written in Python - join channel function
#8
replace bytes with str.encode

def joinchan(channel):
  ircsock.send(str.encode("JOIN "+ channel + "\n"))
  
def join():
  ircsock.send(str.encode("JOIN %s"))
It would also be better to replace all your string concatenations with format method such as
def joinchan(channel):
  ircsock.send(str.encode("JOIN {}\n".format(channel)))
Recommended Tutorials:
Reply


Messages In This Thread
RE: IRC bot written in Python - join channel function - by metulburr - Sep-14-2017, 02:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020