Py chatbot help

FrostByte

Beta member
Messages
5
Location
Mesa, AZ
Hello, I'm having issues getting my Chatbot to work. It's based on chatango.
I'm trying to get it to respond to set message after a period of time(Delay)

Example:

User says "Dice"
5
4
3
2
1
Bot responds ".dice20

I've tried trial and error. But, it seems to fail. If you could help me fix it to work.
Feel free to test it yourself.

Chatango.com

Original ch library: ################################################################ # File: ch.py - Pastebin.com

Current code:

Code:
import ch
class TestBot(ch.RoomManager):
  def onConnect(self, room):
    print("Connected")
    
  def onReconnect(self, room):
    print("Reconnected")
    
  def onDisconnect(self, room):
    print("Disconnected")
  
  def onMessage(self, room, user, message):
    print(user.name+":"+message.body)
    if message.body.startswith("Dice"): # Ugh, I should write something proper. Don't do this, folks!
      room.message(".dice20")

  def onFloodWarning(self, room):
    room.reconnect("STOP")
  
  def onPMMessage(self, pm, user, body):
    pm.message(user, body) # echo

if __name__ == "__main__":
  TestBot.easy_start()

Thanks!

-FrostByte-

Bot name: FrostyBot saved as .py
 
Last edited:
Back
Top Bottom