Пример #1
0
 def load_commands(self, **options):
     if self.settings["mod_role_id"]:
         self.commands["modpride"] = Command.raw_command(
             self.modpride,
             command="modpride",
             delay_all=0,
             delay_user=0,
             cost=self.settings["cost_mod_pride"],
             can_execute_with_whisper=False,
             description="KappaPride Mods",
         )
     if self.settings["dank_role_id"]:
         self.commands["dank"] = Command.raw_command(
             self.dank,
             command="dank",
             delay_all=self.settings["dank_cooldown"],
             delay_user=self.settings["dank_cooldown"],
             cost=self.settings["cost_dank"],
             can_execute_with_whisper=False,
             description="Messes with the dank roles color",
         )
     self.commands["vroom"] = Command.raw_command(
         self.vroom,
         command="vroom",
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=False,
         description="VROOOOOOOOOOM",
     )
Пример #2
0
 def load_commands(self, **options):
     self.commands["message"] = Command.raw_command(
         self.querymessage,
         level=int(self.settings["level_to_query"]),
         can_execute_with_whisper=True,
         description="Queries a message",
     )
Пример #3
0
    def load_commands(self, **options):
        self.commands["movienight"] = Command.raw_command(
            self.movienight,
            delay_all=0,
            delay_user=0,
            can_execute_with_whisper=False,
            channels=json.dumps(self.settings["valid_channels"].split(" ")),
            description="Shows thge movienight links",
        )
        self.commands["moviestart"] = Command.multiaction_command(
            delay_all=0,
            delay_user=0,
            default=None,
            can_execute_with_whisper=False,
            level=self.settings["level"],
            command="moviestart",
            commands={
                "ull": Command.raw_command(
                    self.moviestart_ull,
                    command="moviestart ull",
                    delay_all=0,
                    delay_user=0,
                    level=self.settings["level"],
                    can_execute_with_whisper=False,
                    channels=json.dumps(self.settings["valid_channels"].split(" ")),
                    description="Creates an ultra-low-latency target (lowest latency, source quality only)",
                ),
                "cdn": Command.raw_command(
                    self.moviestart_cdn,
                    command="moviestart cdn",
                    delay_all=0,
                    delay_user=0,
                    level=self.settings["level"],
                    can_execute_with_whisper=False,
                    channels=json.dumps(self.settings["valid_channels"].split(" ")),
                    description="Starts a normal cdn target with transcoder (higher latency, adaptive bitrate)",
                ),
            },
        ) 
        if not self.bot:
            return

        if not self.bot.movienight_api.active:
            log.error("API is not running!")
            return
Пример #4
0
 def load_commands(self, **options):
     self.commands["remindme"] = Command.raw_command(
         self.create_reminder,
         command="remindme",
         delay_all=0,
         delay_user=0,
         cost=int(self.settings["cost"]),
         can_execute_with_whisper=False,
         description="Creates a reminder",
     )
     self.commands["forgetme"] = Command.raw_command(
         self.forgetme,
         command="forgetme",
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=False,
         description="Creates a reminder",
     )
Пример #5
0
 def load_commands(self, **options):
     self.commands["module"] = Command.raw_command(
         self.cmd_module,
         level=500,
         description="Modify module",
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=True,
     )
Пример #6
0
 def load_commands(self, **options):
     self.commands["addrolelevel"] = Command.raw_command(
         self.add_role_level,
         command="addrolelevel",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level"]),
         can_execute_with_whisper=True,
         description="Adds Level to role",
     )
     self.commands["removerolelevel"] = Command.raw_command(
         self.remove_role_level,
         command="removerolelevel",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level"]),
         can_execute_with_whisper=True,
         description="Removes Level from role",
     )
Пример #7
0
 def load_commands(self, **options):
     self.commands["chatchart"] = Command.raw_command(
         self.chatchart,
         command="chatchart",
         delay_all=0,
         delay_user=0,
         can_execute_with_whisper=False,
         description=
         "Generates a pie chart, representing messages in the specified channel.",
     )
Пример #8
0
 def load_commands(self, **options):
     self.commands["timeout"] = Command.raw_command(
         self.timeout_user,
         command="timeout",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level_for_command"]),
         can_execute_with_whisper=False,
         description="Adds a timeout to a user",
     )
     self.commands["untimeout"] = Command.raw_command(
         self.untimeout_user,
         command="untimeout",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level_for_command"]),
         can_execute_with_whisper=False,
         description="Removes a timeout on a user",
     )
     self.commands["timeouts"] = Command.raw_command(
         self.query_timeouts,
         command="timeouts",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level_for_command"]),
         can_execute_with_whisper=False,
         description="Queries timeouts of a user",
     )
     self.commands["istimedout"] = Command.raw_command(
         self.is_timedout,
         command="istimedout",
         delay_all=0,
         delay_user=0,
         level=int(self.settings["level_for_command"]),
         can_execute_with_whisper=False,
         description="Checks if the user is currently timedout",
     )
Пример #9
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={
                "link": Command.multiaction_command(
                    command="add link",
                    level=500,
                    delay_all=0,
                    delay_user=0,
                    default=None,
                    commands={
                        "blacklist": Command.raw_command(
                            self.add_link_blacklist,
                            command="add link blacklist",
                            level=500,
                            delay_all=0,
                            delay_user=0,
                            description="Blacklist a link",
                            examples=[
                                CommandExample(
                                    None,
                                    "Add a link to the blacklist for a shallow search",
                                    chat="user:!add link blacklist --shallow scamlink.lonk/\n"
                                    "bot>user:Successfully added your links",
                                    description="Added the link scamlink.lonk/ to the blacklist for a shallow search",
                                ).parse(),
                                CommandExample(
                                    None,
                                    "Add a link to the blacklist for a deep search",
                                    chat="user:!add link blacklist --deep scamlink.lonk/\n"
                                    "bot>user:Successfully added your links",
                                    description="Added the link scamlink.lonk/ to the blacklist for a deep search",
                                ).parse(),
                            ],
                        ),
                        "whitelist": Command.raw_command(
                            self.add_link_whitelist,
                            command="add link whitelist",
                            level=500,
                            delay_all=0,
                            delay_user=0,
                            description="Whitelist a link",
                            examples=[
                                CommandExample(
                                    None,
                                    "Add a link to the whitelist",
                                    chat="user:!add link whitelink safelink.lonk/\n"
                                    "bot>user:Successfully added your links",
                                    description="Added the link safelink.lonk/ to the whitelist",
                                ).parse()
                            ],
                        ),
                    },
                )
            },
        )

        self.commands["remove"] = Command.multiaction_command(
            level=100,
            delay_all=0,
            delay_user=0,
            default=None,
            command="remove",
            commands={
                "link": Command.multiaction_command(
                    command="remove link",
                    level=500,
                    delay_all=0,
                    delay_user=0,
                    default=None,
                    commands={
                        "blacklist": Command.raw_command(
                            self.remove_link_blacklist,
                            command="remove link blacklist",
                            level=500,
                            delay_all=0,
                            delay_user=0,
                            description="Remove a link from the blacklist.",
                            examples=[
                                CommandExample(
                                    None,
                                    "Remove a link from the blacklist.",
                                    chat="user:!remove link blacklist 20\n"
                                    "bot>user:Successfully removed blacklisted link with id 20",
                                    description="Remove a link from the blacklist with an ID",
                                ).parse()
                            ],
                        ),
                        "whitelist": Command.raw_command(
                            self.remove_link_whitelist,
                            command="remove link whitelist",
                            level=500,
                            delay_all=0,
                            delay_user=0,
                            description="Remove a link from the whitelist.",
                            examples=[
                                CommandExample(
                                    None,
                                    "Remove a link from the whitelist.",
                                    chat="user:!remove link whitelist 12\n"
                                    "bot>user:Successfully removed blacklisted link with id 12",
                                    description="Remove a link from the whitelist with an ID",
                                ).parse()
                            ],
                        ),
                    },
                )
            },
        )
Пример #10
0
 def load_commands(self, **options):
     self.commands["giveaway"] = Command.multiaction_command(
         delay_all=0,
         delay_user=0,
         default="join",
         can_execute_with_whisper=False,
         command="giveaway",
         commands={
             "join":
             Command.raw_command(
                 self.giveaway_join,
                 command="giveaway join",
                 delay_all=0,
                 delay_user=0,
                 channels=json.dumps(
                     self.settings["valid_channels"].split(" ")),
                 can_execute_with_whisper=False,
                 description="Joins the current giveaway",
             ),
             "info":
             Command.raw_command(
                 self.giveaway_info,
                 command="giveaway info",
                 delay_all=0,
                 delay_user=0,
                 channels=json.dumps(
                     self.settings["valid_channels"].split(" ")),
                 can_execute_with_whisper=False,
                 description="Info about the current giveaway",
             )
         },
     )
     self.commands["startgiveaway"] = Command.raw_command(
         self.giveaway_start,
         command="startgiveaway",
         delay_all=0,
         delay_user=0,
         level=self.settings["level"],
         channels=json.dumps(self.settings["valid_channels"].split(" ")),
         can_execute_with_whisper=False,
         description="Start a giveaway",
     )
     self.commands["wipegiveaway"] = Command.raw_command(
         self.giveaway_wipe,
         command="wipegiveaway",
         delay_all=0,
         delay_user=0,
         level=self.settings["level"],
         channels=json.dumps(self.settings["valid_channels"].split(" ")),
         can_execute_with_whisper=False,
         description="Clears the current giveaway",
     )
     self.commands["giveawaywinner"] = Command.raw_command(
         self.giveaway_winner,
         command="giveawaywinner",
         delay_all=0,
         delay_user=0,
         level=self.settings["level"],
         channels=json.dumps(self.settings["valid_channels"].split(" ")),
         can_execute_with_whisper=False,
         description="Chooses a winner(s) for the current giveaway",
     )
     self.commands["lockgiveaway"] = Command.raw_command(
         self.giveaway_lock,
         command="lockgiveaway",
         delay_all=0,
         delay_user=0,
         level=self.settings["level"],
         channels=json.dumps(self.settings["valid_channels"].split(" ")),
         can_execute_with_whisper=False,
         description="Locks the current giveaway",
     )
     self.commands["unlockgiveaway"] = Command.raw_command(
         self.giveaway_unlock,
         command="unlockgiveaway",
         delay_all=0,
         delay_user=0,
         level=self.settings["level"],
         channels=json.dumps(self.settings["valid_channels"].split(" ")),
         can_execute_with_whisper=False,
         description="Unlocks the current giveaway",
     )