예제 #1
0
def setup():
    global client
    global user

    client = IRCClient()
    user = Bot(client)
    user.identify()
예제 #2
0
파일: bot.py 프로젝트: GunioRobot/tofbot
 def run(self, host=None):
   if host == None and not hasattr(self,'host'):
     raise Exception("run: no host set or given")
   if self.nick == None:
     raise Exception("run: no nick set")
   if self.name == None:
     raise Exception("run: no name set")
   self.host = host or self.host
   Bot.run(self, self.host)
예제 #3
0
파일: bot.py 프로젝트: GunioRobot/tofbot
 def __init__(self, nick=None, name=None, channels=None, password=None, debug=True):
     Bot.__init__(self, nick, name, channels, password)
     self.joined = False
     self.autoTofadeThreshold = 98
     self.riddleMaxDist = 2
     self.debug = debug
     self.TGtime = 5
     self.pings = {}
     self.memoryDepth = 20
     self.lolRateDepth = 8
     self.msgMemory = []
     self.cron = Cron()
     self.plugins = self.load_plugins()
예제 #4
0
 def __init__(self, nick=None, name=None, channels=None, password=None,
              debug=True):
     Bot.__init__(self, nick, name, channels, password)
     self.joined = False
     self.autoTofadeThreshold = 98
     self.riddleMaxDist = 2
     self.debug = debug
     self.TGtime = 5
     self.lolRateDepth = 8
     self.cron = Cron()
     self.lastTGtofbot = 0
     self.memoryDepth = 50
     self.last_interaction = int(time.time())
     self.plugins = self.load_plugins()
예제 #5
0
파일: bot.py 프로젝트: chmduquesne/tofbot
 def __init__(self, nick=None, name=None, channels=None, password=None,
              debug=True):
     Bot.__init__(self, nick, name, channels, password)
     self.joined = False
     self.autoTofadeThreshold = 98
     self.riddleMaxDist = 2
     self.debug = debug
     self.TGtime = 5
     self.lolRateDepth = 8
     self.cron = Cron()
     self.lastTGtofbot = 0
     self.memoryDepth = 50
     self.last_interaction = int(time.time())
     self.plugins = self.load_plugins()
예제 #6
0
from config import Config
from irc import Bot
from treestatus import (
    TreeStatus,
    UnknownBranch,
)
from pulse_dispatch import PulseDispatcher
import os


config = Config('pulsebot.cfg')

treestatus = TreeStatus(config.treestatus.server)

bot = Bot(config)

dispatcher = PulseDispatcher(bot.msg, config)

for command, where, nick in bot:
    verb, args = command[0], command[1:]
    if verb == 'status':
        if len(args) != 1:
            bot.msg(where, nick, 'Try again with "status <branch>"')
        else:
            branch = args[0]
            try:
                status = treestatus.current_status(branch)
                bot.msg(
                    where, nick,
                    '%s is %s' % (status['tree'], status['status'].upper())
예제 #7
0
파일: bot.py 프로젝트: GunioRobot/tofbot
 def msg(self, chan, msg):
     for m in msg.split("\n"):
         Bot.msg(self, chan, m)
예제 #8
0
파일: bot.py 프로젝트: TaTaaaa/tofbot
 def msg(self, chan, msg):
     for m in msg.split("\n"):
         Bot.msg(self, chan, m)
예제 #9
0
파일: __main__.py 프로젝트: tp-tc/pulsebot
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from config import Config
from irc import Bot
from treestatus import (
    TreeStatus,
    UnknownBranch,
)
from pulse_dispatch import PulseDispatcher
import os

config = Config('pulsebot.cfg')

treestatus = TreeStatus(config.treestatus.server)

bot = Bot(config)

dispatcher = PulseDispatcher(bot.msg, config)

for command, where, nick in bot:
    verb, args = command[0], command[1:]
    if verb == 'status':
        if len(args) != 1:
            bot.msg(where, nick, 'Try again with "status <branch>"')
        else:
            branch = args[0]
            try:
                status = treestatus.current_status(branch)
                bot.msg(
                    where, nick,
                    '%s is %s' % (status['tree'], status['status'].upper()))