Skip to content

Modular (plugin-based) bot framework in Python.

Notifications You must be signed in to change notification settings

nhammond129/PsyfrBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PsyfrBot

Modular (plugin-based) bot framework in Python.

Designed to be easily implemented with various protocols, and let extensions written working with one protocol be easily transferrable to another. For example, with chatango chats using ch.py:

import ch
import _thread
from PsyfrBot import psyfrbot

BOTPRC=psyfrbot.botprocessor(commandSym=".")
BOTPRC.ignore("Hashbot") # Replace it with whatever your bot identifies as so it doesn't reply to itself.
BOTPRC.pluginManager.loadPlugins()
BOTPRC.loadconfig()
BOTPRC.loadusers()
BOTPRC.adduser("Nullspeaker",lvl=31337)

class botClass(ch.RoomManager):
  def onMessage(self, room, user, message):
    print(user.name+":"+message.body)
    # I know this is identical to BOTPRC.reply, but I'm nervous about
    #  having multiple rooms. 
    _thread.start_new_thread(
        room.message,(BOTPRC.get_response(message.body,user.name),)
      )
  
  def onFloodWarning(self, room):
    room.reconnect()

botClass.easy_start()
BOTPRC.saveconfig()
BOTPRC.saveusers()

About

Modular (plugin-based) bot framework in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages