Beispiel #1
0
 def load_commands(self, **options):
     self.commands[self.settings["command_name"].lower(
     ).replace("!", "").replace(" ", "")] = Command.raw_command(
         self.paid_timeout,
         can_execute_with_whisper=False,
         examples=[
             CommandExample(
                 None,
                 f"Timeout someone for {self.settings['timeout_length']} seconds",
                 chat=
                 f"user:!{self.settings['command_name']} paja\nbot>user: You just used {self.settings['cost']} points to time out paja for an additional {self.settings['timeout_length']} seconds.",
                 description="",
             ).parse()
         ],
     )
     if self.settings["second_command"]:
         self.commands[self.settings["command_name2"].lower(
         ).replace("!", "").replace(" ", "")] = Command.raw_command(
             self.paid_timeout2,
             can_execute_with_whisper=False,
             examples=[
                 CommandExample(
                     None,
                     f"Timeout someone for {self.settings['timeout_length2']} seconds",
                     chat=
                     f"user:!{self.settings['command_name2']} synderen\nbot>user: You just used {self.settings['cost2']} points to time out synderen for an additional {self.settings['timeout_length2']} seconds.",
                     description="",
                 ).parse()
             ],
         )
Beispiel #2
0
 def load_commands(self, **options):
     self.commands["circle"] = Command.raw_command(
         self.command_circle,
         level=100,
         delay_all=2,
         delay_user=0,
         can_execute_with_whisper=False,
         cost=self.settings["circle_cost"],
         description="Generate a circle",
     )
     self.commands["pyramid"] = Command.raw_command(
         self.command_pyramid,
         level=100,
         delay_all=5,
         delay_user=0,
         can_execute_with_whisper=False,
         cost=self.settings["circle_cost"],
         description="Generate a pyramid",
     )
     self.commands["reversepyramid"] = Command.raw_command(
         self.command_reverse,
         level=100,
         delay_all=5,
         delay_user=0,
         can_execute_with_whisper=False,
         cost=self.settings["circle_cost"],
         description="Generate a reverse pyramid",
     )
     self.commands["pyr"] = self.commands["pyramid"]
     self.commands["reversepyr"] = self.commands["reversepyramid"]
Beispiel #3
0
    def load_commands(self, **options):
        self.commands["setgame"] = Command.raw_command(
            self.update_game,
            level=500,
            description="Update the stream's game",
            examples=[
                CommandExample(
                    None,
                    'Update the game to "World of Warcraft"',
                    chat="user:!setgame World of Warcraft\n"
                    'bot>user:pajlada updated the game to "World of Warcraft"',
                ).parse()
            ],
        )

        self.commands["settitle"] = Command.raw_command(
            self.update_title,
            level=500,
            description="Update the stream's title",
            examples=[
                CommandExample(
                    None,
                    'Update the title to "Games and shit"',
                    chat="user:!settitle Games and shit\n"
                    'bot>user:pajlada updated the title to "Games and shit"',
                ).parse()
            ],
        )
Beispiel #4
0
 def load_commands(self, **options):
     self.commands['w'] = Command.raw_command(self.whisper,
             level=2000,
             description='Send a whisper from the bot')
     self.commands['level'] = Command.raw_command(self.level,
             level=1000,
             description='Set a users level')
Beispiel #5
0
    def load_commands(self, **options):
        self.commands["ignore"] = Command.raw_command(
            self.ignore_command,
            level=1000,
            description="Ignore a user, which means he can't run any commands",
            examples=[
                CommandExample(
                    None,
                    "Default usage",
                    chat="user:!ignore Karl_Kons\n"
                    "bot>user:Now ignoring Karl_Kons",
                    description="Ignore user Karl_Kons",
                ).parse()
            ],
        )

        self.commands["unignore"] = Command.raw_command(
            self.unignore_command,
            level=1000,
            description="Unignore a user",
            examples=[
                CommandExample(
                    None,
                    "Default usage",
                    chat="user:!unignore Karl_Kons\n"
                    "bot>user:No longer ignoring Karl_Kons",
                    description="Unignore user Karl_Kons",
                ).parse()
            ],
        )
Beispiel #6
0
 def load_commands(self, **options):
     self.commands[self.settings["subon_command_name"].lower().replace(
         "!", "").replace(" ", "")] = Command.raw_command(
             self.paid_subon, cost=self.settings["subon_cost"])
     self.commands[self.settings["suboff_command_name"].lower().replace(
         "!", "").replace(" ", "")] = Command.raw_command(
             self.paid_suboff, cost=self.settings["suboff_cost"])
Beispiel #7
0
    def load_commands(self, **options):
        setgame_trigger = self.settings["setgame_trigger"].lower().replace("!", "").replace(" ", "")
        self.commands[setgame_trigger] = Command.raw_command(
            self.update_game,
            level=self.settings["level"],
            description="Update the stream's game",
            examples=[
                CommandExample(
                    None,
                    'Update the game to "World of Warcraft"',
                    chat=f"user:!{setgame_trigger} World of Warcraft\n"
                    'bot>user:pajlada updated the game to "World of Warcraft"',
                ).parse()
            ],
        )

        settitle_trigger = self.settings["settitle_trigger"].lower().replace("!", "").replace(" ", "")
        self.commands[settitle_trigger] = Command.raw_command(
            self.update_title,
            level=self.settings["level"],
            description="Update the stream's title",
            examples=[
                CommandExample(
                    None,
                    'Update the title to "Games and shit"',
                    chat=f"user:!{settitle_trigger} Games and shit\n"
                    'bot>user:pajlada updated the title to "Games and shit"',
                ).parse()
            ],
        )
Beispiel #8
0
    def load_commands(self, **options):
        cmd_reload_bttv_emotes = self.reload_cmd(
            self.bot.emote_manager.bttv_emote_manager if self.
            bot else BTTVEmoteManager)
        cmd_reload_ffz_emotes = self.reload_cmd(
            self.bot.emote_manager.ffz_emote_manager if self.
            bot else FFZEmoteManager)
        cmd_reload_twitch_emotes = self.reload_cmd(
            self.bot.emote_manager.twitch_emote_manager if self.
            bot else TwitchEmoteManager)
        cmd_print_bttv_emotes = self.print_cmd(
            self.bot.emote_manager.bttv_emote_manager
            if self.bot else BTTVEmoteManager, "forsenPls gachiGASM")
        cmd_print_ffz_emotes = self.print_cmd(
            self.bot.emote_manager.ffz_emote_manager
            if self.bot else FFZEmoteManager, "FeelsOkayMan Kapp LULW")

        # The ' ' is there to make things look good in the
        # web interface.
        if self.settings["enable_bttvemotes"]:
            self.commands["bttvemotes"] = Command.multiaction_command(
                delay_all=self.settings["global_cd"],
                delay_user=self.settings["user_cd"],
                level=self.settings["level"],
                default=" ",
                fallback=" ",
                command="bttvemotes",
                commands={
                    "reload": cmd_reload_bttv_emotes,
                    " ": cmd_print_bttv_emotes
                },
            )

        if self.settings["enable_ffzemotes"]:
            self.commands["ffzemotes"] = Command.multiaction_command(
                delay_all=self.settings["global_cd"],
                delay_user=self.settings["user_cd"],
                level=self.settings["level"],
                default=" ",
                fallback=" ",
                command="ffzemotes",
                commands={
                    "reload": cmd_reload_ffz_emotes,
                    " ": cmd_print_ffz_emotes
                },
            )

        if self.settings["enable_subemotes"]:
            self.commands["subemotes"] = Command.multiaction_command(
                delay_all=self.settings["global_cd"],
                delay_user=self.settings["user_cd"],
                level=self.settings["level"],
                default=" ",
                fallback=" ",
                command="subemotes",
                commands={
                    "reload": cmd_reload_twitch_emotes,
                    " ": self.print_twitch_cmd()
                },
            )
Beispiel #9
0
    def load_commands(self, **options):
        self.commands["permaban"] = Command.raw_command(
            self.permaban_command,
            level=1000,
            description=
            "Permanently ban a user. Every time the user types in chat, he will be permanently banned again",
            examples=[
                CommandExample(
                    None,
                    "Default usage",
                    chat="user:!permaban Karl_Kons\n"
                    "bot>user:Karl_Kons has now been permabanned",
                    description="Permanently ban Karl_Kons from the chat",
                ).parse()
            ],
        )

        self.commands["unpermaban"] = Command.raw_command(
            self.unpermaban_command,
            level=1000,
            description="Remove a permanent ban from a user",
            examples=[
                CommandExample(
                    None,
                    "Default usage",
                    chat="user:!unpermaban Karl_Kons\n"
                    "bot>user:Karl_Kons is no longer permabanned",
                    description="Remove permanent ban from Karl_Kons",
                ).parse()
            ],
        )
Beispiel #10
0
 def load_commands(self, **options):
     self.commands[self.settings['command_name'].lower(
     ).replace('!', '').replace(' ', '')] = Command.raw_command(
         self.paid_timeout,
         cost=self.settings['cost'],
         examples=[
             CommandExample(
                 None,
                 'Timeout someone for {0} seconds'.format(
                     self.settings['timeout_length']),
                 chat='user:!{0} paja\n'
                 'bot>user: You just used {1} points to time out paja for an additional {2} seconds.'
                 .format(self.settings['command_name'],
                         self.settings['cost'],
                         self.settings['timeout_length']),
                 description='').parse(),
         ])
     if self.settings['second_command']:
         self.commands[self.settings['command_name2'].lower(
         ).replace('!', '').replace(' ', '')] = Command.raw_command(
             self.paid_timeout2,
             cost=self.settings['cost2'],
             examples=[
                 CommandExample(
                     None,
                     'Timeout someone for {0} seconds'.format(
                         self.settings['timeout_length2']),
                     chat='user:!{0} paja\n'
                     'bot>user: You just used {1} points to time out paja for an additional {2} seconds.'
                     .format(self.settings['command_name2'],
                             self.settings['cost2'],
                             self.settings['timeout_length2']),
                     description='').parse(),
             ])
Beispiel #11
0
 def load_commands(self, **options):
     self.commands['debug'] = Command.multiaction_command(
         level=250,
         delay_all=0,
         delay_user=0,
         default=None,
         commands={
             'command':
             Command.raw_command(
                 self.debug_command,
                 level=250,
                 description='Debug a command',
                 examples=[
                     CommandExample(
                         None,
                         'Debug a command',
                         chat='user:!debug command ping\n'
                         'bot>user: id=210, level=100, type=message, cost=0, cd_all=10, cd_user=30, mod_only=False, response=Snusbot has been online for $(tb:bot_uptime)',
                         description='').parse(),
                 ]),
             'user':
             Command.raw_command(
                 self.debug_user,
                 level=250,
                 description='Debug a user',
                 examples=[
                     CommandExample(
                         None,
                         'Debug a user',
                         chat='user:!debug user snusbot\n'
                         'bot>user: id=123, level=100, num_lines=45, points=225,  last_seen=2016-04-05 17:56:23 CEST, last_active=2016-04-05 17:56:07 CEST, ignored=False, banned=False, tokens=0',
                         description='').parse(),
                 ]),
         })
Beispiel #12
0
 def load_commands(self, **options):
     self.commands["rq"] = Command.raw_command(self.random_quote, delay_all=2, delay_user=5)
     self.commands["randomquote"] = self.commands["rq"]
     self.commands["lastquote"] = Command.raw_command(self.last_quote, delay_all=2, delay_user=5)
     self.commands["lq"] = self.commands["lastquote"]
     self.commands["lastmessage"] = self.commands["lastquote"]
     self.commands["lastmessage"] = self.commands["lastquote"]
Beispiel #13
0
    def load_commands(self, **options):
        get_cmd = Command.raw_command(self.get_bttv_emotes,
                level=100,
                delay_all=3,
                delay_user=6,
                examples=[
                    CommandExample(None, 'Show all active bttv emotes for this channel.',
                        chat='user: !bttvemotes\n'
                        'bot: Active BTTV Emotes in chat: forsenPls gachiGASM',
                        description='').parse(),
                    ])

        reload_cmd = Command.raw_command(self.reload_bttv_emotes,
                level=500,
                delay_all=10,
                delay_user=20,
                examples=[
                    CommandExample(None, 'Reload all active bttv emotes for this channel.',
                        chat='user: !bttvemotes reload\n'
                        'bot>user: Reloading bttv emotes...',
                        description='').parse(),
                    ])

        # The ' ' is there to make things look good in the
        # web interface.
        self.commands['bttvemotes'] = Command.multiaction_command(
                level=100,
                default=' ',
                fallback=' ',
                command='bttvemotes',
                commands={
                    'reload': reload_cmd,
                    ' ': get_cmd,
                    }
                )
Beispiel #14
0
 def load_commands(self, **options):
     self.commands['predict'] = Command.raw_command(
         self.predict,
         delay_all=0,
         delay_user=10,
         sub_only=True,
         can_execute_with_whisper=True,
         description='Predict how many wins will occur in the ' +
         self.settings['challenge_name'] + ' challenge')
     self.commands['newpredict'] = Command.raw_command(
         self.new_predict,
         delay_all=10,
         delay_user=10,
         description='Starts a new ' + self.settings['challenge_name'] +
         ' run',
         level=750)
     self.commands['endpredict'] = Command.raw_command(
         self.end_predict,
         delay_all=10,
         delay_user=10,
         description='Ends a ' + self.settings['challenge_name'] + ' run',
         level=750)
     self.commands['closepredict'] = Command.raw_command(
         self.close_predict,
         delay_all=10,
         delay_user=10,
         description='Close submissions to the latest ' +
         self.settings['challenge_name'] + ' run',
         level=750)
Beispiel #15
0
    def load_commands(self, **options):
        self.commands["trivia"] = Command.multiaction_command(
            level=100,
            delay_all=0,
            delay_user=0,
            can_execute_with_whisper=True,
            commands={
                "start":
                Command.raw_command(self.command_start,
                                    level=100,
                                    delay_all=0,
                                    delay_user=60,
                                    can_execute_with_whisper=True),
                "stop":
                Command.raw_command(self.command_stop,
                                    level=420,
                                    delay_all=0,
                                    delay_user=0,
                                    can_execute_with_whisper=True),
                "skip":
                Command.raw_command(self.command_skip,
                                    level=420,
                                    delay_all=0,
                                    delay_user=0,
                                    can_execute_with_whisper=True),
            },
        )

        self.commands["leakanswers"] = Command.raw_command(
            self.command_leak,
            level=500,
            description="Log the answers to stdout")
Beispiel #16
0
 def load_commands(self, **options):
     self.commands['circle'] = Command.raw_command(self.command_circle,
         level = 100,
         delay_all = 2,
         delay_user = 0,
         can_execute_with_whisper = False,
         cost = self.settings['circle_cost'],
         description='Generate a circle'
         )
     self.commands['pyramid'] = Command.raw_command(self.command_pyramid,
         level = 100,
         delay_all = 5,
         delay_user = 0,
         can_execute_with_whisper = False,
         cost = self.settings['circle_cost'],
         description='Generate a pyramid'
         )
     self.commands['reversepyramid'] = Command.raw_command(self.command_reverse,
         level = 100,
         delay_all = 5,
         delay_user = 0,
         can_execute_with_whisper = False,
         cost = self.settings['circle_cost'],
         description='Generate a reverse pyramid'
         )
     self.commands['pyr'] = self.commands['pyramid']
     self.commands['reversepyr'] = self.commands['reversepyramid']
Beispiel #17
0
 def load_commands(self, **options):
     self.commands['raffle'] = Command.raw_command(self.raffle,
             delay_all=0,
             delay_user=0,
             level=500,
             description='Start a raffle for points',
             examples=[
                 CommandExample(None, 'Start a raffle for 69 points',
                     chat='user:!raffle 69\n'
                     'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in in 60 seconds.',
                     description='Start a 60-second raffle for 69 points').parse(),
                 CommandExample(None, 'Start a raffle for the default value of {} points',
                     chat='user:!raffle 69 30\n'
                     'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in in 30 seconds.',
                     description='Start a 30-second raffle for 69 points').parse(),
                 ],
             )
     self.commands['join'] = Command.raw_command(self.join,
             delay_all=0,
             delay_user=5,
             description='Join a running raffle',
             examples=[
                 CommandExample(None, 'Join a running raffle',
                     chat='user:!join',
                     description='You don\'t get confirmation whether you joined the raffle or not.').parse(),
                 ],
             )
Beispiel #18
0
 def load_commands(self, **options):
     self.commands["showemote"] = Command.raw_command(
         self.show_emote,
         notify_on_error=True,
         cost=self.settings["point_cost"],
         description="Show an emote on stream!",
         sub_only=self.settings["sub_only"],
         can_execute_with_whisper=self.settings["can_whisper"],
         delay_all=self.settings["cooldown_global"],
         delay_user=self.settings["cooldown_per_user"],
         examples=[
             CommandExample(
                 None,
                 "Show an emote on stream.",
                 chat="user:!showemote Keepo\n"
                 "bot>user: Successfully sent the emote Keepo to the stream!",
                 description="",
             ).parse()
         ],
     )
     self.commands["disableshowemote"] = Command.raw_command(
         self.disable_showemote,
         cost=self.settings["disable_cost"],
         description="Disables show emote",
         delay_all=self.settings["disable_cooldown"],
     )
Beispiel #19
0
    def load_commands(self, **options):
        self.commands['permaban'] = Command.raw_command(
            self.permaban_command,
            level=1000,
            description=
            'Permanently ban a user. Every time the user types in chat, he will be permanently banned again',
            examples=[
                CommandExample(
                    None,
                    'Default usage',
                    chat='user:!permaban Karl_Kons\n'
                    'bot>user:Karl_Kons has now been permabanned',
                    description='Permanently ban Karl_Kons from the chat').
                parse(),
            ])

        self.commands['unpermaban'] = Command.raw_command(
            self.unpermaban_command,
            level=1000,
            description='Remove a permanent ban from a user',
            examples=[
                CommandExample(
                    None,
                    'Default usage',
                    chat='user:!unpermaban Karl_Kons\n'
                    'bot>user:Karl_Kons is no longer permabanned',
                    description='Remove permanent ban from Karl_Kons').parse(),
            ])
Beispiel #20
0
 def load_commands(self, **options):
     self.commands['hsbet'] = Command.multiaction_command(
             level=100,
             default='bet',
             fallback='bet',
             delay_all=0,
             delay_user=0,
             can_execute_with_whisper=True,
             commands={
                 'bet': Command.raw_command(
                     self.command_bet,
                     delay_all=0,
                     delay_user=10,
                     can_execute_with_whisper=True,
                     ),
                 'open': Command.raw_command(
                     self.command_open,
                     level=500,
                     delay_all=0,
                     delay_user=0,
                     can_execute_with_whisper=True,
                     ),
                 'close': Command.raw_command(
                     self.command_close,
                     level=500,
                     delay_all=0,
                     delay_user=0,
                     can_execute_with_whisper=True,
                     ),
                 })
Beispiel #21
0
 def load_commands(self, **rest):
     self.commands["hsbet"] = Command.multiaction_command(
         level=100,
         default="bet",
         fallback="bet",
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=True,
         commands={
             "bet":
             Command.raw_command(self.command_bet,
                                 delay_all=0,
                                 delay_user=10,
                                 can_execute_with_whisper=True),
             "open":
             Command.raw_command(self.command_open,
                                 level=500,
                                 delay_all=0,
                                 delay_user=0,
                                 can_execute_with_whisper=True),
             "close":
             Command.raw_command(self.command_close,
                                 level=500,
                                 delay_all=0,
                                 delay_user=0,
                                 can_execute_with_whisper=True),
             "stats":
             Command.raw_command(self.command_stats,
                                 level=100,
                                 delay_all=0,
                                 delay_user=10,
                                 can_execute_with_whisper=True),
         },
     )
Beispiel #22
0
 def load_commands(self, **options):
     self.commands["trivia"] = Command.multiaction_command(
         level=100,
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=True,
         commands={
             "start":
             Command.raw_command(self.command_start,
                                 level=420,
                                 delay_all=0,
                                 delay_user=10,
                                 can_execute_with_whisper=True),
             "stop":
             Command.raw_command(self.command_stop,
                                 level=420,
                                 delay_all=0,
                                 delay_user=0,
                                 can_execute_with_whisper=True),
             "skip":
             Command.raw_command(self.command_skip,
                                 level=420,
                                 delay_all=0,
                                 delay_user=0,
                                 can_execute_with_whisper=True),
         },
     )
Beispiel #23
0
 def load_commands(self, **options):
     self.commands[self.settings['subon_command_name'].lower().replace(
         '!', '').replace(' ', '')] = Command.raw_command(
             self.paid_subon, cost=self.settings['subon_cost'])
     self.commands[self.settings['suboff_command_name'].lower().replace(
         '!', '').replace(' ', '')] = Command.raw_command(
             self.paid_suboff, cost=self.settings['suboff_cost'])
Beispiel #24
0
 def load_commands(self, **options):
     self.commands['hsbet'] = Command.multiaction_command(
         level=100,
         default='bet',
         fallback='bet',
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=True,
         commands={
             'bet':
             Command.raw_command(
                 self.command_bet,
                 delay_all=0,
                 delay_user=10,
                 can_execute_with_whisper=True,
             ),
             'open':
             Command.raw_command(
                 self.command_open,
                 level=500,
                 delay_all=0,
                 delay_user=0,
                 can_execute_with_whisper=True,
             ),
             'close':
             Command.raw_command(
                 self.command_close,
                 level=500,
                 delay_all=0,
                 delay_user=0,
                 can_execute_with_whisper=True,
             ),
         })
Beispiel #25
0
 def load_commands(self, **options):
     self.commands[
         self.settings["subon_command_name"].lower().replace("!", "").replace(" ", "")
     ] = Command.raw_command(self.paid_subon, cost=self.settings["subon_cost"])
     self.commands[
         self.settings["suboff_command_name"].lower().replace("!", "").replace(" ", "")
     ] = Command.raw_command(self.paid_suboff, cost=self.settings["suboff_cost"])
Beispiel #26
0
    def load_commands(self, **options):
        self.commands['reload'] = Command.raw_command(self.reload,
                level=1000,
                description='Reload a bunch of data from the database')

        self.commands['commit'] = Command.raw_command(self.commit,
                level=1000,
                description='Commit data from the bot to the database')
Beispiel #27
0
    def load_commands(self, **options):
        self.commands['add'] = Command.multiaction_command(
                level=100,
                delay_all=0,
                delay_user=0,
                default=None,
                command='add',
                commands={
                    'banphrase': Command.raw_command(self.add_banphrase,
                        level=500,
                        description='Add a banphrase!',
                        examples=[
                            CommandExample(None, 'Create a banphrase',
                                chat='user:!add banphrase testman123\n'
                                'bot>user:Inserted your banphrase (ID: 83)',
                                description='This creates a banphrase with the default settings. Whenever a non-moderator types testman123 in chat they will be timed out for 300 seconds and notified through a whisper that they said something they shouldn\'t have said').parse(),
                            CommandExample(None, 'Create a banphrase that permabans people',
                                chat='user:!add banphrase testman123 --perma\n'
                                'bot>user:Inserted your banphrase (ID: 83)',
                                description='This creates a banphrase that permabans the user who types testman123 in chat. The user will be notified through a whisper that they said something they shouldn\'t have said').parse(),
                            CommandExample(None, 'Create a banphrase that permabans people without a notification',
                                chat='user:!add banphrase testman123 --perma --no-notify\n'
                                'bot>user:Inserted your banphrase (ID: 83)',
                                description='This creates a banphrase that permabans the user who types testman123 in chat').parse(),
                            CommandExample(None, 'Change the default timeout length for a banphrase',
                                chat='user:!add banphrase testman123 --time 123\n'
                                'bot>user:Updated the given banphrase (ID: 83) with (time, extra_args)',
                                description='Changes the default timeout length to a custom time of 123 seconds').parse(),
                            CommandExample(None, 'Make it so a banphrase cannot be triggered by subs',
                                chat='user:!add banphrase testman123 --subimmunity\n'
                                'bot>user:Updated the given banphrase (ID: 83) with (sub_immunity)',
                                description='Changes a command so that the banphrase can only be triggered by people who are not subscribed to the channel.').parse(),
                            ]),
                        }
                )

        self.commands['remove'] = Command.multiaction_command(
                level=100,
                delay_all=0,
                delay_user=0,
                default=None,
                command='remove',
                commands={
                    'banphrase': Command.raw_command(self.remove_banphrase,
                        level=500,
                        description='Remove a banphrase!',
                        examples=[
                            CommandExample(None, 'Remove a banphrase',
                                chat='user:!remove banphrase KeepoKeepo\n'
                                'bot>user:Successfully removed banphrase with id 33',
                                description='Removes a banphrase with the trigger KeepoKeepo.').parse(),
                            CommandExample(None, 'Remove a banphrase with the given ID.',
                                chat='user:!remove banphrase 25\n'
                                'bot>user:Successfully removed banphrase with id 25',
                                description='Removes a banphrase with id 25').parse(),
                            ]),
                    }
                )
Beispiel #28
0
 def load_commands(self, **options):
     self.commands["debug"] = Command.multiaction_command(
         level=100,
         delay_all=0,
         delay_user=0,
         default=None,
         commands={
             "command":
             Command.raw_command(
                 self.debug_command,
                 level=250,
                 description="Debug a command",
                 examples=[
                     CommandExample(
                         None,
                         "Debug a command",
                         chat="user:!debug command ping\n"
                         "bot>user: id=210, level=100, type=message, cost=0, cd_all=10, cd_user=30, mod_only=False, response=Snusbot has been online for $(tb:bot_uptime)",
                         description="",
                     ).parse()
                 ],
             ),
             "user":
             Command.raw_command(
                 self.debug_user,
                 level=250,
                 description="Debug a user",
                 examples=[
                     CommandExample(
                         None,
                         "Debug a user",
                         chat="user:!debug user snusbot\n"
                         "bot>user: id=123, level=100, num_lines=45, points=225,  last_seen=2016-04-05 17:56:23 CEST, last_active=2016-04-05 17:56:07 CEST, ignored=False, banned=False, tokens=0",
                         description="",
                     ).parse()
                 ],
             ),
             "tags":
             Command.raw_command(
                 self.debug_tags,
                 level=100,
                 delay_all=0,
                 delay_user=5,
                 description="Debug tags for a user",
                 examples=[
                     CommandExample(
                         None,
                         "Debug tags for a user",
                         chat="user:!debug tags pajbot\n"
                         "bot>user: pajbot has the following tags: pajlada_sub until 2016-04-28",
                         description="",
                     ).parse()
                 ],
             ),
         },
     )
Beispiel #29
0
    def load_commands(self, **options):
        self.commands["reload"] = Command.raw_command(
            self.reload,
            level=1000,
            description="Reload a bunch of data from the database")

        self.commands["commit"] = Command.raw_command(
            self.commit,
            level=1000,
            description="Commit data from the bot to the database")
Beispiel #30
0
    def load_commands(self, **options):
        self.commands['reload'] = Command.raw_command(
            self.reload,
            level=1000,
            description='Reload a bunch of data from the database')

        self.commands['commit'] = Command.raw_command(
            self.commit,
            level=1000,
            description='Commit data from the bot to the database')
Beispiel #31
0
 def load_commands(self, **options):
     self.commands['rq'] = Command.raw_command(self.random_quote,
                                               delay_all=2,
                                               delay_user=5)
     self.commands['randomquote'] = self.commands['rq']
     self.commands['lastquote'] = Command.raw_command(self.last_quote,
                                                      delay_all=2,
                                                      delay_user=5)
     self.commands['lq'] = self.commands['lastquote']
     self.commands['lastmessage'] = self.commands['lastquote']
     self.commands['lastmessage'] = self.commands['lastquote']
Beispiel #32
0
    def load_commands(self, **options):
        self.commands['singleraffle'] = Command.raw_command(self.raffle,
                delay_all=0,
                delay_user=0,
                level=500,
                description='Start a raffle for points',
                command='raffle',
                examples=[
                    CommandExample(None, 'Start a raffle for 69 points',
                        chat='user:!raffle 69\n'
                        'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 60 seconds.',
                        description='Start a 60-second raffle for 69 points').parse(),
                    CommandExample(None, 'Start a raffle with a different length',
                        chat='user:!raffle 69 30\n'
                        'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 30 seconds.',
                        description='Start a 30-second raffle for 69 points').parse(),
                    ],
                )
        self.commands['sraffle'] = self.commands['singleraffle']
        self.commands['join'] = Command.raw_command(self.join,
                delay_all=0,
                delay_user=5,
                description='Join a running raffle',
                examples=[
                    CommandExample(None, 'Join a running raffle',
                        chat='user:!join',
                        description='You don\'t get confirmation whether you joined the raffle or not.').parse(),
                    ],
                )
        if self.settings['multi_enabled']:
            self.commands['multiraffle'] = Command.raw_command(self.multi_raffle,
                    delay_all=0,
                    delay_user=0,
                    level=500,
                    description='Start a multi-raffle for points',
                    command='multiraffle',
                    examples=[
                        CommandExample(None, 'Start a multi-raffle for 69 points',
                            chat='user:!multiraffle 69\n'
                            'bot:A multi-raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 60 seconds.',
                            description='Start a 60-second raffle for 69 points').parse(),
                        CommandExample(None, 'Start a multi-raffle with a different length',
                            chat='user:!multiraffle 69 30\n'
                            'bot:A multi-raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 30 seconds.',
                            description='Start a 30-second multi-raffle for 69 points').parse(),
                        ],
                    )
            self.commands['mraffle'] = self.commands['multiraffle']

        if self.settings['default_raffle_type'] == 'Multi Raffle' and self.settings['multi_enabled']:
            self.commands['raffle'] = self.commands['multiraffle']
        else:
            self.commands['raffle'] = self.commands['singleraffle']
Beispiel #33
0
    def load_commands(self, **options):
        self.commands['singleraffle'] = Command.raw_command(self.raffle,
                delay_all=0,
                delay_user=0,
                level=500,
                description='Start a raffle for points',
                command='raffle',
                examples=[
                    CommandExample(None, 'Start a raffle for 69 points',
                        chat='user:!raffle 69\n'
                        'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 60 seconds.',
                        description='Start a 60-second raffle for 69 points').parse(),
                    CommandExample(None, 'Start a raffle with a different length',
                        chat='user:!raffle 69 30\n'
                        'bot:A raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 30 seconds.',
                        description='Start a 30-second raffle for 69 points').parse(),
                    ],
                )
        self.commands['sraffle'] = self.commands['singleraffle']
        self.commands['join'] = Command.raw_command(self.join,
                delay_all=0,
                delay_user=5,
                description='Join a running raffle',
                examples=[
                    CommandExample(None, 'Join a running raffle',
                        chat='user:!join',
                        description='You don\'t get confirmation whether you joined the raffle or not.').parse(),
                    ],
                )
        if self.settings['multi_enabled']:
            self.commands['multiraffle'] = Command.raw_command(self.multi_raffle,
                    delay_all=0,
                    delay_user=0,
                    level=500,
                    description='Start a multi-raffle for points',
                    command='multiraffle',
                    examples=[
                        CommandExample(None, 'Start a multi-raffle for 69 points',
                            chat='user:!multiraffle 69\n'
                            'bot:A multi-raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 60 seconds.',
                            description='Start a 60-second raffle for 69 points').parse(),
                        CommandExample(None, 'Start a multi-raffle with a different length',
                            chat='user:!multiraffle 69 30\n'
                            'bot:A multi-raffle has begun for 69 points. Type !join to join the raffle! The raffle will end in 30 seconds.',
                            description='Start a 30-second multi-raffle for 69 points').parse(),
                        ],
                    )
            self.commands['mraffle'] = self.commands['multiraffle']

        if self.settings['default_raffle_type'] == 'Multi Raffle' and self.settings['multi_enabled']:
            self.commands['raffle'] = self.commands['multiraffle']
        else:
            self.commands['raffle'] = self.commands['singleraffle']
Beispiel #34
0
    def load_commands(self, **options):
        if self.settings["enable_topchatters"]:
            self.commands["topchatters"] = Command.raw_command(self.top_chatters)

        if self.settings["enable_topwatchers"]:
            self.commands["topwatchers"] = Command.raw_command(self.top_watchers)

        if self.settings["enable_topoffline"]:
            self.commands["topoffline"] = Command.raw_command(self.top_offline)

        if self.settings["enable_toppoints"]:
            self.commands["toppoints"] = Command.raw_command(self.top_points)
Beispiel #35
0
 def load_commands(self, **options):
     self.commands["processtax"] = Command.raw_command(
         self.process_tax,
         level=1000,
         description=
         f"Processes the tax for the last {self.settings['default_process_time_days']} days"
     )
     self.commands["calculatetax"] = Command.raw_command(
         self.calculate_tax,
         level=1000,
         description=
         f"Calculates the tax for the last {self.settings['default_process_time_days']} days"
     )
Beispiel #36
0
    def load_commands(self, **options):
        cmd_reload_bttv_emotes = self.reload_cmd(
            self.bot.emote_manager.bttv_emote_manager if self.
            bot else BTTVEmoteManager)
        cmd_reload_ffz_emotes = self.reload_cmd(
            self.bot.emote_manager.ffz_emote_manager if self.
            bot else FFZEmoteManager)
        cmd_reload_twitch_emotes = self.reload_cmd(
            self.bot.emote_manager.twitch_emote_manager if self.
            bot else TwitchEmoteManager)
        cmd_print_bttv_emotes = self.print_cmd(
            self.bot.emote_manager.bttv_emote_manager
            if self.bot else BTTVEmoteManager, "TriKool gachiBASS")
        cmd_print_ffz_emotes = self.print_cmd(
            self.bot.emote_manager.ffz_emote_manager
            if self.bot else FFZEmoteManager, "FeelsOkayMan Krappa LULW")

        # The ' ' is there to make things look good in the
        # web interface.
        self.commands["bttvemotes"] = Command.multiaction_command(
            level=100,
            default=" ",
            fallback=" ",
            command="bttvemotes",
            commands={
                "reload": cmd_reload_bttv_emotes,
                " ": cmd_print_bttv_emotes
            },
        )

        self.commands["ffzemotes"] = Command.multiaction_command(
            level=100,
            default=" ",
            fallback=" ",
            command="ffzemotes",
            commands={
                "reload": cmd_reload_ffz_emotes,
                " ": cmd_print_ffz_emotes
            },
        )

        self.commands["subemotes"] = Command.multiaction_command(
            level=100,
            default=" ",
            fallback=" ",
            command="subemotes",
            commands={
                "reload": cmd_reload_twitch_emotes,
                " ": self.print_twitch_cmd()
            },
        )
Beispiel #37
0
    def load_commands(self, **options):
        # TODO: Have delay modifiable in settings

        self.commands['followage'] = Command.raw_command(self.follow_age,
                delay_all=4,
                delay_user=8,
                description='Check your or someone elses follow age for a channel',
                examples=[
                    CommandExample(None, 'Check your own follow age',
                        chat='user:!followage\n'
                        'bot:pajlada, you have been following Karl_Kons for 4 months and 24 days',
                        description='Check how long you have been following the current streamer (Karl_Kons in this case)').parse(),
                    CommandExample(None, 'Check someone elses follow age',
                        chat='user:!followage NightNacht\n'
                        'bot:pajlada, NightNacht has been following Karl_Kons for 5 months and 4 days',
                        description='Check how long any user has been following the current streamer (Karl_Kons in this case)').parse(),
                    CommandExample(None, 'Check someones follow age for a certain streamer',
                        chat='user:!followage NightNacht forsenlol\n'
                        'bot:pajlada, NightNacht has been following forsenlol for 1 year and 4 months',
                        description='Check how long NightNacht has been following forsenlol').parse(),
                    CommandExample(None, 'Check your own follow age for a certain streamer',
                        chat='user:!followage pajlada forsenlol\n'
                        'bot:pajlada, you have been following forsenlol for 1 year and 3 months',
                        description='Check how long you have been following forsenlol').parse(),
                    ],
                )

        self.commands['followsince'] = Command.raw_command(self.follow_since,
                delay_all=4,
                delay_user=8,
                description='Check from when you or someone else first followed a channel',
                examples=[
                    CommandExample(None, 'Check your own follow since',
                        chat='user:!followsince\n'
                        'bot:pajlada, you have been following Karl_Kons since 04 March 2015, 07:02:01 UTC',
                        description='Check when you first followed the current streamer (Karl_Kons in this case)').parse(),
                    CommandExample(None, 'Check someone elses follow since',
                        chat='user:!followsince NightNacht\n'
                        'bot:pajlada, NightNacht has been following Karl_Kons since 03 July 2014, 04:12:42 UTC',
                        description='Check when NightNacht first followed the current streamer (Karl_Kons in this case)').parse(),
                    CommandExample(None, 'Check someone elses follow since for another streamer',
                        chat='user:!followsince NightNacht forsenlol\n'
                        'bot:pajlada, NightNacht has been following forsenlol since 13 June 2013, 13:10:51 UTC',
                        description='Check when NightNacht first followed the given streamer (forsenlol)').parse(),
                    CommandExample(None, 'Check your follow since for another streamer',
                        chat='user:!followsince pajlada forsenlol\n'
                        'bot:pajlada, you have been following forsenlol since 16 December 1990, 03:06:51 UTC',
                        description='Check when you first followed the given streamer (forsenlol)').parse(),
                    ],
                )
Beispiel #38
0
 def load_commands(self, **options):
     self.commands['pointlottery'] = Command.raw_command(
             self.lottery,
             delay_all=0,
             delay_user=5,
             description='Lottery for points',
             examples=[
                 CommandExample(None,
                                'Lottery start',
                                chat='user:!pointlottery start\n'
                                     'bot:A Lottery has begun. Type !pointlottery join {points} to join the lottery!',
                                description='Start lottery',
                                ).parse(),
                 CommandExample(None,
                                'Lottery join',
                                chat='user:!pointlottery join {}',
                                description='You don\'t get confirmation whether you joined the lottery or not.',
                                ).parse(),
                 CommandExample(None,
                                'Lottery stop',
                                chat='user:!pointlottery stop\n'
                                     'bot:The lottery has finished! {} won {} points',
                                description='Finish lottery',
                                ).parse(),
                 CommandExample(None,
                                'Lottery join',
                                chat='user:!pointlottery {}',
                                description='You don\'t get confirmation whether you joined the lottery or not.',
                                ).parse(),
             ],
     )
Beispiel #39
0
 def load_commands(self, **options):
     # TODO: Aliases should be set in settings?
     #       This way, it can be run alongside other modules
     self.commands['rank'] = Command.raw_command(self.league_rank,
             delay_all=15,
             delay_user=30,
             description='Check streamer\'s or other players League of Legends rank in chat.',
             examples=[
                 CommandExample(None, 'Check streamer\'s rank',
                     chat='user:!rank\n'
                     'bot: The Summoner Moregain Freeman on region EUW is currently in PLATINUM IV with 62 LP 4Head',
                     description='Bot says broadcaster\'s region, League-tier, division and LP').parse(),
                 CommandExample(None, 'Check other player\'s rank on default region',
                     chat='user:!rank forsen\n'
                     'bot: The Summoner forsen on region EUW is currently in SILVER IV with 36 LP 4Head',
                     description='Bot says player\'s region, League-tier, division and LP').parse(),
                 CommandExample(None, 'Check other player\'s rank on another region',
                     chat='user:!rank imaqtpie na\n'
                     'bot: The Summoner Imaqtpie on region NA is currently in CHALLENGER I with 441 LP 4Head',
                     description='Bot says player\'s region, League-tier, division and LP. Other regions to use as arguments: euw, eune, na, oce, br, kr, las, lan, ru, tr').parse(),
                 ],
             )
     self.commands['lolrank'] = self.commands['rank']
     self.commands['ranklol'] = self.commands['rank']
     self.commands['leaguerank'] = self.commands['rank']
Beispiel #40
0
 def load_commands(self, **options):
     self.commands['#showemote'] = Command.raw_command(
             self.show_emote,
             tokens_cost=1,
             description='Show an emote on stream! Costs 1 token.',
             can_execute_with_whisper=True,
             )
Beispiel #41
0
 def load_commands(self, **options):
     self.commands["math"] = Command.raw_command(
         self.math,
         delay_all=self.settings["online_global_cd"],
         delay_user=self.settings["online_user_cd"],
         description="Calculate some simple math",
         examples=[],
     )
Beispiel #42
0
 def load_commands(self, **options):
     self.command_name = self.settings['command_name'].lower().replace('!', '').replace(' ', '')
     self.commands[self.command_name] = Command.raw_command(
             self.give_points,
             sub_only=self.settings['source_requires_sub'],
             delay_all=0,
             delay_user=0,
             can_execute_with_whisper=True,
             )
Beispiel #43
0
    def load_commands(self, **options):
        # TODO: Have delay modifiable in settings

        self.commands['math'] = Command.raw_command(self.math,
                delay_all=2,
                delay_user=6,
                description='Calculate some simple math',
                examples=[
                    ],
                )
Beispiel #44
0
 def load_commands(self, **options):
     self.commands['#playsound'] = Command.raw_command(
             self.play_sound,
             tokens_cost=3,
             sub_only=True,
             description='Play a sound on stream! Costs 3 tokens, sub only for now.',
             can_execute_with_whisper=True,
             )
     html_valid_samples = ''.join(['<tr><td class="command-sample">!#playsound {0.command}</td><td><script>var snd{0.command} = new Audio("{0.href}");</script><button onclick="snd{0.command}.play();" type="button">Play</button></td></tr>'.format(sample) for sample in Samples.all_samples])
     self.commands['#playsound'].long_description = '<h3>Valid samples</h3><table>{}</table>'.format(html_valid_samples)
Beispiel #45
0
    def load_commands(self, **options):
        if self.settings['enable_topchatters']:
            self.commands['topchatters'] = Command.raw_command(
                    self.top_chatters,
                    )

        if self.settings['enable_topwatchers']:
            self.commands['topwatchers'] = Command.raw_command(
                    self.top_watchers,
                    )

        if self.settings['enable_topoffline']:
            self.commands['topoffline'] = Command.raw_command(
                    self.top_offline,
                    )

        if self.settings['enable_toppoints']:
            self.commands['toppoints'] = Command.raw_command(
                    self.top_points,
                    )
Beispiel #46
0
    def load_commands(self, **options):
        self.commands['ignore'] = Command.raw_command(self.ignore_command,
                level=1000,
                description='Ignore a user, which means he can\'t run any commands',
                examples=[
                    CommandExample(None, 'Default usage',
                        chat='user:!ignore Karl_Kons\n'
                        'bot>user:Now ignoring Karl_Kons',
                        description='Ignore user Karl_Kons').parse(),
                    ])

        self.commands['unignore'] = Command.raw_command(self.unignore_command,
                level=1000,
                description='Unignore a user',
                examples=[
                    CommandExample(None, 'Default usage',
                        chat='user:!unignore Karl_Kons\n'
                        'bot>user:No longer ignoring Karl_Kons',
                        description='Unignore user Karl_Kons').parse(),
                    ])
Beispiel #47
0
    def create_command(self, alias_str, **options):
        aliases = alias_str.lower().replace('!', '').split('|')
        for alias in aliases:
            if alias in self.data:
                return self.data[alias], False, alias

        command = Command(command=alias_str, **options)
        command.data = CommandData(command.id, **options)
        self.add_db_command_aliases(command)
        with DBManager.create_session_scope(expire_on_commit=False) as db_session:
            db_session.add(command)
            db_session.add(command.data)
            db_session.commit()
            db_session.expunge(command)
            db_session.expunge(command.data)
        self.db_session.add(command.data)
        self.commit()

        self.rebuild()
        return command, True, ''
Beispiel #48
0
 def load_commands(self, **options):
     self.commands['roulette'] = Command.raw_command(self.roulette,
             delay_all=self.settings['online_global_cd'],
             delay_user=self.settings['online_user_cd'],
             description='Roulette for points',
             examples=[
                 CommandExample(None, 'Roulette for 69 points',
                     chat='user:!roulette 69\n'
                     'bot:pajlada won 69 points in roulette! FeelsGoodMan',
                     description='Do a roulette for 69 points').parse(),
                 ],
             )
Beispiel #49
0
 def load_commands(self, **options):
     self.commands['roulette'] = Command.raw_command(self.roulette,
             delay_all=self.settings['online_global_cd'],
             delay_user=self.settings['online_user_cd'],
             description='Roulette for points',
             examples=[
                 CommandExample(None, 'Roulette for 69 points',
                     chat='user:!roulette 69\n'
                     'bot:You have challenged Karl_Kons for 0 points',
                     description='Duel Karl_Kons for 0 points').parse(),
                 ],
             )
Beispiel #50
0
 def load_commands(self, **options):
     self.commands['8ball'] = Command.raw_command(self.eightball_command,
             delay_all=self.settings['online_global_cd'],
             delay_user=self.settings['online_user_cd'],
             description='Need help with a decision? Use the !8ball command!',
             examples=[
                 CommandExample(None, '!8ball',
                     chat='user:!8ball Should I listen to gachimuchi?\n'
                     'bot:pajlada, the 8-ball says... Of course you should!',
                     description='Ask the 8ball an important question').parse(),
                 ],
             )
Beispiel #51
0
    def load_commands(self, **options):
        self.commands['myprogress'] = Command.raw_command(
                self.my_progress,
                can_execute_with_whisper=True,
                delay_all=0,
                delay_user=10,
                )
        self.commands['currentquest'] = Command.raw_command(
                self.get_current_quest,
                can_execute_with_whisper=True,
                delay_all=2,
                delay_user=10,
                )
        self.commands['tokens'] = Command.raw_command(
                self.get_user_tokens,
                can_execute_with_whisper=True,
                delay_all=0,
                delay_user=10,
                )

        self.commands['quest'] = self.commands['currentquest']
Beispiel #52
0
 def load_commands(self, **options):
     self.commands['#showemote'] = Command.raw_command(
             self.show_emote,
             tokens_cost=1,
             description='Show an emote on stream! Costs 1 token.',
             can_execute_with_whisper=True,
             examples=[
                 CommandExample(None, 'Show an emote on stream.',
                     chat='user:!#showemote Keepo\n'
                     'bot>user: Successfully sent the emote Keepo to the stream!',
                     description='').parse(),
                 ])
Beispiel #53
0
 def load_commands(self, **options):
     self.commands['duel'] = Command.raw_command(self.initiate_duel,
             delay_all=self.settings['online_global_cd'],
             delay_user=self.settings['online_user_cd'],
             description='Initiate a duel with a user',
             examples=[
                 CommandExample(None, '0-point duel',
                     chat='user:!duel Karl_Kons\n'
                     'bot>user:You have challenged Karl_Kons for 0 points',
                     description='Duel Karl_Kons for 0 points').parse(),
                 CommandExample(None, '69-point duel',
                     chat='user:!duel Karl_Kons 69\n'
                     'bot>user:You have challenged Karl_Kons for 69 points',
                     description='Duel Karl_Kons for 69 points').parse(),
                 ],
             )
     self.commands['cancelduel'] = Command.raw_command(self.cancel_duel,
             delay_all=0,
             delay_user=10)
     self.commands['accept'] = Command.raw_command(self.accept_duel,
             delay_all=0,
             delay_user=0)
     self.commands['decline'] = Command.raw_command(self.decline_duel,
             delay_all=0,
             delay_user=0)
     self.commands['deny'] = self.commands['decline']
     self.commands['duelstatus'] = Command.raw_command(self.status_duel,
             delay_all=0,
             delay_user=5)
     self.commands['duelstats'] = Command.raw_command(self.get_duel_stats,
             delay_all=0,
             delay_user=120)
Beispiel #54
0
 def load_commands(self, **options):
     self.commands['predict'] = Command.raw_command(self.predict,
             delay_all=0,
             delay_user=10,
             sub_only=True,
             can_execute_with_whisper=True,
             description='Predict how many wins will occur in the ' + self.settings['challenge_name'] + ' challenge')
     self.commands['newpredict'] = Command.raw_command(self.new_predict,
             delay_all=10,
             delay_user=10,
             description='Starts a new ' + self.settings['challenge_name'] + ' run',
             level=750)
     self.commands['endpredict'] = Command.raw_command(self.end_predict,
             delay_all=10,
             delay_user=10,
             description='Ends a ' + self.settings['challenge_name'] + ' run',
             level=750)
     self.commands['closepredict'] = Command.raw_command(self.close_predict,
             delay_all=10,
             delay_user=10,
             description='Close submissions to the latest ' + self.settings['challenge_name'] + ' run',
             level=750)
Beispiel #55
0
 def load_commands(self, **options):
     self.command_name = self.settings['command_name'].lower().replace('!', '').replace(' ', '')
     self.commands[self.command_name] = Command.raw_command(
             self.give_points,
             sub_only=self.settings['source_requires_sub'],
             delay_all=0,
             delay_user=0,
             can_execute_with_whisper=True,
             examples=[
                 CommandExample(None, 'Show an emote on stream.',
                     chat='user:!{0} pajapaja 4444\n'
                     'bot>user: Successfully gave away 4444 points to pajapaja'.format(self.command_name),
                     description='').parse(),
                 ])
Beispiel #56
0
 def load_commands(self, **options):
     self.commands['trivia'] = Command.multiaction_command(
             level=100,
             delay_all=0,
             delay_user=0,
             can_execute_with_whisper=True,
             commands={
                 'start': Command.raw_command(
                     self.command_start,
                     level=500,
                     delay_all=0,
                     delay_user=10,
                     can_execute_with_whisper=True,
                     ),
                 'stop': Command.raw_command(
                     self.command_stop,
                     level=500,
                     delay_all=0,
                     delay_user=0,
                     can_execute_with_whisper=True,
                     ),
                 }
             )
Beispiel #57
0
 def load_commands(self, **options):
     self.commands['debug'] = Command.multiaction_command(
             level=100,
             delay_all=0,
             delay_user=0,
             default=None,
             commands={
                 'command': Command.raw_command(self.debug_command,
                     level=250,
                     description='Debug a command',
                     examples=[
                         CommandExample(None, 'Debug a command',
                             chat='user:!debug command ping\n'
                             'bot>user: id=210, level=100, type=message, cost=0, cd_all=10, cd_user=30, mod_only=False, response=Snusbot has been online for $(tb:bot_uptime)',
                             description='').parse(),
                         ]),
                 'user': Command.raw_command(self.debug_user,
                     level=250,
                     description='Debug a user',
                     examples=[
                         CommandExample(None, 'Debug a user',
                             chat='user:!debug user snusbot\n'
                             'bot>user: id=123, level=100, num_lines=45, points=225,  last_seen=2016-04-05 17:56:23 CEST, last_active=2016-04-05 17:56:07 CEST, ignored=False, banned=False, tokens=0',
                             description='').parse(),
                         ]),
                 'tags': Command.raw_command(self.debug_tags,
                     level=100,
                     delay_all=0,
                     delay_user=5,
                     description='Debug tags for a user',
                     examples=[
                         CommandExample(None, 'Debug tags for a user',
                             chat='user:!debug tags pajbot\n'
                             'bot>user: pajbot have the following tags: pajlada_sub until 2016-04-28',
                             description='').parse(),
                         ])
                 })
Beispiel #58
0
 def load_commands(self, **options):
     self.commands['pointsreset'] = Command.raw_command(
             self.points_reset,
             delay_all=0,
             delay_user=5,
             level=500,
             description='Reset points from a user with negative points.',
             can_execute_with_whisper=1,
             command='pointsreset',
             examples=[
                 CommandExample(None, 'Reset points from a user with negative points.',
                     chat='user:!pointsreset pajtest\n'
                     'bot>user:You changed the points for pajtest from -10000 to 0 points',
                     description='').parse(),
                 ])