mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
might as well fix all bots
This commit is contained in:
1 parent
464299a6af
commit
1019270dc2
6 files changed
+42
-42
No files matched your search
+10
-10
@@ -22,11 +22,11 @@ parser.add_option("-n", "--nick", dest="nick", default='quote_bot',
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
def ping():
|
||||
ircsock.send("PONG :pingis\n")
|
||||
def ping(pong):
|
||||
ircsock.send("PONG {}\n".format(pong))
|
||||
|
||||
def sendmsg(chan , msg):
|
||||
ircsock.send("PRIVMSG "+ chan +" :"+ msg +"\n")
|
||||
ircsock.send("PRIVMSG "+ chan +" :"+ msg +"\n")
|
||||
|
||||
def joinchan(chan):
|
||||
ircsock.send("JOIN "+ chan +"\n")
|
||||
@@ -74,21 +74,21 @@ def say_chatty(channel):
|
||||
for line in chattyOut:
|
||||
if line:
|
||||
ircsock.send("PRIVMSG "+ channel + " :" + line + "\n")
|
||||
|
||||
|
||||
def listen():
|
||||
while 1:
|
||||
|
||||
ircmsg = ircsock.recv(2048)
|
||||
ircmsg = ircmsg.strip('\n\r')
|
||||
|
||||
if ircmsg.find("PING :") != -1:
|
||||
ping()
|
||||
|
||||
if ircmsg[:4] == "PING":
|
||||
ping(ircmsg.split(" ")[1])
|
||||
|
||||
formatted = formatter.format_message(ircmsg)
|
||||
|
||||
if "" == formatted:
|
||||
continue
|
||||
|
||||
|
||||
print formatted
|
||||
|
||||
split = formatted.split("\t")
|
||||
@@ -108,8 +108,8 @@ def listen():
|
||||
if ircmsg.find(":!haiku") != -1:
|
||||
haiku(options.channel)
|
||||
|
||||
if ircmsg.find("PING :") != -1:
|
||||
ping()
|
||||
if ircmsg[:4] == "PING":
|
||||
ping(ircmsg.split(" ")[1])
|
||||
|
||||
sys.stdout.flush()
|
||||
time.sleep(1)
|
||||
|
||||
Reference in new issue
Block a user