Esempio n. 1
0
File: jc.py Progetto: Farthen/OTFBot
class Plugin(chatMod.chatMod):

    def __init__(self, bot):
        self.bot = bot

    def start(self):
        self.game = Game()
        self.gamechannel = ""

    def query(self, user, channel, msg):
        if " " in msg:
            (command, options) = msg.split(" ", 1)
            self.command(user, self.gamechannel, command, options)

    def command(self, user, channel, command, options):
        user = user.split("!")[0]
        if command == "newgame":
            self.gamechannel = channel
        if command in ['nimm', 'zweifel', 'ich', 'remove', 'newgame', 'startgame', 'zahl']:
            lines = self.game.input(user, command, options)
            for line in lines:
                if line[1] == True:
                    self.bot.sendmsg(channel, line[0])
                else:
                    self.bot.sendmsg(user, line[0])
Esempio n. 2
0
File: jc.py Progetto: Farthen/OTFBot
 def start(self):
     self.game = Game()
     self.gamechannel = ""