Пример #1
0
 async def list_levelroles(self, ctx, level: int = None) -> discord.Message:
     async with self.bot.db.acquire() as con:
         obtain_type = await con.fetch(
             f"SELECT DISTINCT(obtain_at), type FROM level_roles "
             f"WHERE {f'obtain_at={level} AND ' if level else ''}"
             f"guild_id={ctx.guild.id} ORDER BY obtain_at ASC")
         complete_lr = [
             lrl(
                 entry['obtain_at'], entry['type'], await con.fetch(
                     f"SELECT role_id FROM level_roles WHERE "
                     f"guild_id={ctx.guild.id} AND obtain_at={int(entry['obtain_at'])}"
                 )) for entry in obtain_type
         ]
     embed = discord.Embed(
         title=f"Role Rewards{f' for Level {level}' if level else ''}",
         description=f"Role Rewards for {ctx.guild.name}"
         f"{f' given at level {level}'if level else ''}",
         color=discord.Color.blue())
     entries = [(f"Level {entry.level}",
                 (f"**Role Reward Behavior:** `{entry.type}`",
                  "**Roles Given:**\n> " + "\n> ".join([
                      ctx.guild.get_role(int(record['role_id'])).mention
                      for record in entry.entries
                  ])), False) for entry in complete_lr]
     if not entries:
         embed.description = "No role rewards configured"
         embed.color = discord.Color.dark_red()
         return await ctx.channel.send(embed=embed)
     pag = SubcommandPaginator(ctx,
                               entries=entries,
                               per_page=1,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()
Пример #2
0
    async def get_redirect_help(self, ctx):
        rd = f"{await gcmds.prefix(ctx)}redirect"
        description = (
            f"{ctx.author.mention}, the base command for redirects is `{rd}`. This command is used to instruct "
            "MarwynnBot to redirect the output of a command to a specific channel. Redirects will only work "
            "for MarwynnBot since MarwynnBot cannot truly redirect other bots' outputs without causing some features "
            "to break.\n\nHere are the available subcommands for redirect")
        rset = (
            f"**Usage:** `{rd} set [#channel] [command]*va`",
            "**Returns:** A confirmation embed that requires the user to confirm that they would like the output for "
            "these commands to be redirected to the specified channel",
            "**Aliases:** `-s` `apply`",
            "**Note:** The `[command]*va` must be a list of commands separated by commas, or \"all\" "
            "to set redirects for all commands")
        rlist = (
            f"**Usage:** `{rd} list (#channel)`",
            "**Returns:** A list of all the redirects this server implements that redirect to the specified channel",
            "**Aliases:** `ls` `show`",
            "**Note:** If `(#channel)` is not specified, it will show all the redirects that this server "
            "implements for all commands with redirects")
        rremove = (
            f"**Usage:** `{rd} remove [command]*va`",
            "**Returns:** A confirmation embed that requires the user to confirm they would like to remove the redirect "
            "for the specified commands",
            "**Aliases:** `rm` `delete` `cancel`",
            "**Note:** The `[command]*va` must be a list of commands separated by commas, or \"all\" to "
            "remove all redirects for all commands")
        important_note = (
            "An important thing to note is that when setting the redirect for all commands at once, it will "
            "be assigned the type `all`, and when setting the redirect for specific commands or a list of commands, "
            "it will be assigned the type `override`. Essentially this means that when you set the redirect "
            "for a specific command, it will use that redirect, even if a global redirect was set. This is "
            "useful for when you want to redirect MarwynnBot's output for all commmands to a specific channel "
            "EXCEPT for a couple commands. This is achieved by assigning their redirects seperately as stated above. "
            "Subcommand redirects are not supported, so the redirect will apply to all commands within the "
            "command group if the base command is a group.")

        nv = [("Set", rset), ("List", rlist), ("Remove", rremove)]

        embed = discord.Embed(title="Redirect Help",
                              description=description,
                              color=discord.Color.blue())
        pag = SubcommandPaginator(ctx,
                                  entries=[(name, value, False)
                                           for name, value in nv],
                                  per_page=3,
                                  show_entry_count=False,
                                  embed=embed,
                                  footer=important_note)
        return await pag.paginate()
Пример #3
0
 async def todo_help(self, ctx):
     pfx = f"{await gcmds.prefix(ctx)}todo"
     description = (f"{ctx.author.mention}, the base command is `{pfx}` *alias = `td` `todos`*. The `todo` commands "
                    "serve as an alternative to `reminders`, which are scheduled to fire at a specific point in time,"
                    " or on a defined interval. If you just want an organised list of tasks to complete, or are not "
                    "sure when you want to complete that task, then use `todo`\n\nHere are all the subcommands for `todo`")
     tset = (f"**Usage:** `{pfx} create [item]`",
             "**Returns:** An embed that confirms your todo was successfully created, or added to the current todo list",
             "**Aliaes:** `-s` `add`",
             "**Note:** `[item]` is what you want your todo message to be")
     tedit = (f"**Usage:** `{pfx}edit [ID]`",
              "**Returns:** An interactive panel that will guide you through editing a created todo",
              "**Aliases:** `-e` `modify` `adjust`",
              "**Note:** The ID passed into `[ID]` must be an ID of a todo that you own. You cannot edit another "
              "user's todos")
     tlist = (f"**Usage:** `{pfx}list` (flag)",
              "**Returns:** A paginated list of all your active and completed todos",
              "**Aliases:** `ls` `show`",
              "**Note:** Valid arguments for `(flag)` are \"active\" (shows active only) and \"done\" or "
              "\"complete\" (shows completed only)")
     tcomplete = (f"**Usage:** `{pfx} complete [ID]*va`",
                  "**Returns:** An embed that confirms your todo was successfully marked as completed",
                  "**Aliases:** `-c` `finish` `done`",
                  "**Note:** Marking as complete does not truly delete the todo from your history. "
                  "If `[ID]` is \"all\", it will mark all currently active todos as complete. `[ID]` accepts a single ID "
                  "or comma separated IDs")
     treset = (f"**Usage:** `{pfx} reset [ID]*va`",
               "**Returns:** An embed that confirms your todo was successfully reset (marked as active)",
               "**Aliases:** `-r` `incomplete`",
               "**Note:** If `[ID]` is \"all\", it will mark all your todos, both active and completed, as active. "
               "`[ID]` accepts a single ID or comma separated IDs")
     tremove = (f"**Usage:** `{pfx}remove [ID]*va`",
                "**Returns:** A confirmation embed that upon confirmation, will delete the specified IDs"
                "**Aliases:** `rm` `cancel` `delete`",
                "**Note:** Removing a todo will remove it from your history, therefore, you will not be able to "
                "access that todo anymore. It will no longer show up when you list all your todos. `[ID]` accepts a single ID "
                "or comma separated IDs")
     nv = [("Set", tset), ("Edit", tedit), ("List", tlist),
           ("Complete", tcomplete), ("Reset", treset), ("Remove", tremove)]
     embed = discord.Embed(title="Todo Help", description=description, color=discord.Color.blue())
     pag = SubcommandPaginator(ctx, entries=[(name, value, False) for name, value in nv],
                               per_page=3, show_entry_count=False, embed=embed)
     return await pag.paginate()
Пример #4
0
    async def get_welcome_help(self, ctx) -> discord.Message:
        pfx = f"{await gcmds.prefix(ctx)}welcomer"
        title = "Welcomer Help Menu"
        description = (
            f"{ctx.author.mention}, the welcomer is used to greet new members of your server when they join. "
            f"The base command is `{pfx} [option]` *alias=welcome*. Here are the valid "
            "options for `[option]`")
        create = (
            f"**Usage:** `{pfx} create`",
            "**Returns:** An interactive setup panel that will create a working welcomer in your server",
            "**Aliases:** `make` `start` `-c`",
            "**Note:** You will be unable to use this command if you already have a welcomer set up. If you"
            " try to use this command when you already have a welcomer set up, it will automatically redirect you to "
            "the interactive edit panel")
        edit = (
            f"**Usage:** `{pfx} edit`",
            "**Returns:** An interactive setup panel that will edit your current welcomer",
            "**Aliases:** `adjust` `modify` `-e`",
            "**Note:** You must have a welcomer currently set up in this server to use this command"
        )
        delete = (
            f"**Usage:** `{pfx} delete`",
            "**Returns:** A confirmation panel that will delete your current welcomer if you choose to do so",
            "**Aliases:** `trash` `cancel` `rm`",
            "**Note:** You must have a welcomer currently set up in this server to use this command"
        )
        test = (
            f"**Usage:** `{pfx} test`",
            "**Returns:** A test welcomer in your currently set welcome channel"
        )
        nv = [("Create", create), ("Edit", edit), ("Delete", delete),
              ("Test", test)]

        embed = discord.Embed(title=title,
                              description=description,
                              color=discord.Color.blue())
        pag = SubcommandPaginator(ctx,
                                  entries=[(name, value, False)
                                           for name, value in nv],
                                  per_page=2,
                                  show_entry_count=False,
                                  embed=embed)
        return await pag.paginate()
Пример #5
0
 async def locks_help(self, ctx):
     pfx = f"{await gcmds.prefix(ctx)}lock"
     description = (
         f"{ctx.author.mention}, the base command is `{pfx}` *alias=`lk`*. Locks are designed to prevent MarwynnBot from "
         "executing commands in channels where you don't want MarwynnBot commands to be run. This can be "
         "useful if you are having trouble specifying permissions in your server/channel settings, or "
         "if you have a designated bots channel where you want users to be able to invoke MarwynnBot from. "
         "With MarwynnBot, you can lock specific channels or lock every channel but specific channels. "
         "\n\nHere are all the subcommands")
     lset = (
         f"**Usage:** `{pfx} set [#channel]*va`",
         "**Returns:** A confirmation panel that will let the user confirm they would like to lock the specified channels",
         "**Alaises:** `-s`, `apply` `create`",
         "**Note:** [#channel] must be channel tags. Multiple channels can be specified by separating the tags "
         "by commas. After confirmation, MarwynnBot will no longer respond to any commands invoked in those channels",
         "**Note:** *if `[#channel]` is \"all\", MarwynnBot will lock all channels except for the current channel*"
     )
     llist = (
         f"**Usage:** `{pfx} list (flag)`",
         "**Returns:** A list of all channels that are locked or explicitly unlocked",
         "**Aliases:** `ls` `show`",
         "**Note:** Valid `(flag)` are \"lock\", \"unlock\", and \"all\"")
     lunlock = (
         f"**Usage:** `{pfx} unlock [#channel]*va`",
         "**Returns:** A confirmation panel that will let the user confirm they would like to unlock the specified channels",
         "**Aliases:** `ulk` `rm` `remove` `delete` `cancel`",
         "**Note:** [#channel] must be channel tags. Multiple channels can be specified by separating the tags "
         "by commas, or \"all\" to unlock all locked channels. After confirmation, MarwynnBot will once again"
         " respond to any commands invoked in those channels",
         f"**Note:** *this command can also be invoked with `{await gcmds.prefix(ctx)}unlock [#channel]\*va`*"
     )
     nv = [("Set", lset), ("List", llist), ("Unlock", lunlock)]
     embed = discord.Embed(title="Lock Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=3,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()
Пример #6
0
 async def starboard_help(self, ctx) -> discord.Message:
     pfx = f"{await gcmds.prefix(ctx)}starboard"
     description = (
         f"{ctx.author.mention}, the base command is `{pfx}` *alias=`sb`*. The starboard is a functino of MarwynnBot "
         "that will allow you to create a \"gallery\" of funny messages just by reacting to it with a "
         "specified starboard reaction. Here are all the subcommands")
     schannel = (
         f"**Usage:** `{pfx} channel [#channel]`",
         "**Returns:** An embed that confirms your starboard channel was successfully bound",
         "**Aliases:** `cn`",
         "**Note:** If this command has not been called or a channel has not been specified, MarwynnBot "
         "will automatically create a new channel called \"starboard\" if such a channel doesn't already exist"
     )
     sset = (
         f"**Usage:** `{pfx} set [emoji]`",
         "**Returns:** An embed that confirms your emoji binding was successful",
         "**Aliases:** `-s` `bind` `use`",
         "**Note:** `[emoji]` must be an emoji. Do not escape markdown")
     slist = (
         f"**Usage:** `{pfx} list`",
         "**Returns:** Your current emoji that when used to react to a message, will trigger a starboard post, "
         "as well as the starboard channel tag", "**Aliases:** `ls` `show`")
     sremove = (
         f"**Usage:** `{pfx} remove`",
         "**Returns:** An embed that confirms your emoji was unbound from starboard trigger",
         "**Aliases:** `rm` `clear` `reset` `delete`")
     nv = [("Channel", schannel), ("Set", sset), ("List", slist),
           ("Remove", sremove)]
     footer = "Note that you can disable the starboard just by unbinding the emoji"
     embed = discord.Embed(title="Starboard Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=4,
                               show_entry_count=False,
                               embed=embed,
                               footer=footer)
     return await pag.paginate()
Пример #7
0
 async def get_disboard_help(self, ctx) -> discord.Message:
     pfx = f"{await gcmds.prefix(ctx)}disboard"
     title = "Disboard Commands"
     description = (
         f"{ctx.author.mention}, this is MarwynnBot's Disboard integration. MarwynnBot's many functions "
         f"are listed here below. The base command is `{pfx}`. Here are all the valid Disboard commands"
     )
     create = (
         f"**Usage:** `{pfx} create`",
         "**Returns:** An interactive setup panel that will make your disboard bump reminder",
         "**Aliases:** `-c` `make` `start`",
         "**Note:** You must have the `Disboard` bot in this server, otherwise, the command will fail"
     )
     edit = (
         f"**Usage:** `{pfx} edit`",
         "**Returns:** An interactive setup panel that will edit your current disboard bump reminder",
         "**Aliases:** `-e` `adjust`",
         "**Note:** You must satisfy the special case for `create` and currently have a working bump "
         "reminder set")
     delete = (
         f"**Usage:** `{pfx} delete`",
         "**Returns:** A confirmation panel that will delete your current disboard bump reminder",
         "**Aliases:** `rm` `trash` `cancel`",
         "**Note:** You must satisfy the special case for `edit`")
     invite = (
         f"**Usage:** `{pfx} invite`",
         "**Returns:** An interactive panel that details how to get the `Disboard` bot into your own server"
     )
     nv = [("Create", create), ("Edit", edit), ("Delete", delete),
           ("Invite", invite)]
     embed = discord.Embed(title=title,
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=3,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()
Пример #8
0
 async def send_nintendo_help(self, ctx):
     pfx = f"{await gcmds.prefix(ctx)}nintendo"
     description = (f"MarwynnBot's various Nintendo features allows users to register their Nintendo Switch friend "
                    "code. Connect with other people and make some new friends! MarwynnBot respects your privacy and "
                    "will allow you to register and unregister your information at any time")
     register = (f"**Usage:** `{pfx} register [friend_code]`",
                 "**Returns:** An embed that confirms you have successfully registered your information",
                 "**Aliases:** `reg`",
                 "**Note:** `[friend_code]` must be specified and be in the format ```SW-XXXX-XXXX-XXXX```")
     unregister = (f"**Usage:** `{pfx} unregister`",
                   "**Returns:** An embed that confirms you have successfully unregistered your information",
                   "**Aliases:** `unreg`",
                   "**Note:** You must be registered in order to successfully unregister")
     profile = (f"**Usage:** `{pfx} profile (@user)`",
                "**Returns:** An embed with user's profile details if registered",
                "**Aliases:** `prof` `pfl`")
     nv = [("Register", register), ("Unregister", unregister), ("Profile", profile)]
     embed = discord.Embed(title="Nintendo Commands Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx, entries=[(name, value, False) for name, value in nv],
                               per_page=3, show_entry_count=False, embed=embed)
     return await pag.paginate()
Пример #9
0
 async def send_leveling_help(self, ctx) -> discord.Message:
     pfx = f"{await gcmds.prefix(ctx)}level"
     description = (
         "MarwynnBot offers a robust leveling feature that will allow server "
         "owners to encourage overall engagement with the server. The base "
         f"command is `{pfx}`. Here are all of MarwynnBot's leveling features"
     )
     lhelp = (f"**Usage:** `{pfx} help`",
              "**Returns:** This paginated help menu", "**Aliases:** `h`")
     lenable = (
         f"**Usage:** `{pfx} enable (#channel)*va`",
         "**Returns:** An embed that confirms that leveling has been enabled",
         "**Aliases:** `on`",
         "**Note:** If `(#channel)*va` is unspecified, it will apply the action "
         "across all server channels")
     ldisable = (
         f"**Usage:** `{pfx} disable (#channel)*va`",
         "**Returns:** An embed that confirms that leveling has been disabled",
         "**Aliases:** `off`",
         "**Note:** Leveling must be enabled in order for it to be disabled. "
         "If `(#channel)*va` is unspecified, it will apply the action "
         "across all server channels")
     lxpperminute = (
         f"**Usage:** `{pfx}xpperminute (value)`",
         "**Returns:** A panel that will allow you to adjust the average XP per minute",
         "**Aliases:** `xpm` `xppermin`",
         "**Note:** `(value)` must be a positive integer value between 1 and 10000 (inclusive). "
         "If `(value)` is not specified, it will display the current average XP per minute. "
         "Adjusting the XP per minute only impacts your server")
     lfrequency = (
         f"**Usage:** `{pfx}frequency (value)`",
         "**Returns:** A panel that will allow you to adjust the minumum XP cooldown duration",
         "**Aliases:** `freq` `rate`",
         "**Note:** `(value)` must be a positive integer value between 1 and 60 (inclusive). "
         "`(value)` represents the cooldown (in minutes) for a server member to receive "
         "XP after the last time they were given XP. If `(value)` is not specified, it will display "
         "the server's current frequency in minutes. 1 minute is the minimum to discourage spam"
     )
     lreroute = (
         f"**Usage:** `{pfx} reroute [#channel]`",
         "**Returns:** An embed that confirms the level up messages will be redirected to this channel",
         "**Aliases:** `redirect`")
     lunroute = (
         f"**Usage:** `{pfx} unroute`",
         "**Returns:** An embed that confirms the level up messages will no longer be redirected",
         "**Aliases:** `unredirect`")
     lnotify = (
         f"**Usage:** `{pfx} notify [mode] (status)`",
         "**Returns:** An embed that confirms the level up notifications for the specified mode was "
         "changed to the specified status", "**Aliases:** `notif` `notifs`",
         "**Note:** `[mode]` can be \"server\" *(\"s\")* or \"global\" *(\"g\")*, and `(status)` can be "
         "\"true\" *(\"t\")* or \"false\" *(\"f\")*. If `(status)` is not specified or is not one of "
         "the previously mentioned valid values, it will act as a toggle for `[mode]`"
     )
     labout = (
         f"**Usage:** `{pfx} about`",
         "**Returns:** An embed that contains a detailed description about MarwynnBot's leveling feature",
         "**Aliases:** `info`")
     nv = [("Help", lhelp), ("Enable", lenable), ("Disable", ldisable),
           ("XP Per Minute", lxpperminute), ("Frequency", lfrequency),
           ("Reroute", lreroute), ("Unroute", lunroute),
           ("Notify", lnotify), ("About", labout)]
     embed = discord.Embed(title="Leveling Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=3,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()
Пример #10
0
 async def send_levelroles_help(self, ctx):
     pfx = f"{await gcmds.prefix(ctx)}levelroles"
     description = (
         "Once you have configured MarwynnBot's leveling system, you can configure "
         f"role rewards for when users level up. The base command is `{pfx}`. "
         "Here are all the features for configuring role rewards")
     lgive = (
         f"**Usage:** `{pfx} give [level] [type] [@role]*va`",
         "**Returns:** An embed that confirms those role rewards were successfully added",
         "**Aliases:** `set`",
         "**Note:** `[level]` should be an integer value between 1 and 100 inclusive, `[type]` can "
         "be \"add\" *(\"a\")* or \"replace\" *(\"r\")* to specify if the previous roles obtained "
         "should be kept or if the new roles will replace the old roles")
     lremove = (
         f"**Usage:** `{pfx} remove [level] (@role)*va`",
         "**Returns:** A confirmation panel that once confirmed, will remove the selected roles "
         "from the role rewards at the specified level",
         "**Aliases:** `unset`",
         "**Note:** If `(@role)*va` is not specified, it will remove all role rewards for "
         "the specified level")
     lreset = (
         f"**Usage:** `{pfx} reset`",
         "**Returns:** A confirmation panel that once confirmed, will remove ALL role rewards "
         "for ALL levels", "**Aliases:** `clear`",
         "**Note:** This action cannot be undone, and will remove ALL role rewards for ALL levels"
     )
     llist = (
         f"**Usage:** `{pfx} list (level)`",
         "**Returns:** An embed that displays the role rewards for the specified level",
         "**Aliases:** `show` `ls`",
         "**Note:** If `(level)` is not specified, it will display ALL the role rewards that are set"
     )
     lchangelevel = (
         f"**Usage:** `{pfx} changelevel [level] [@role]`",
         "**Returns:** A confirmation panel that once confirmed, will set the level "
         "required to obtain `[@role]` as a role reward to the specified level",
         "**Aliases:** `cl` `levelchange`",
         "**Note:** `[level]` must be between 1 and 100. If no role rewards currently "
         "exist for the specified level, it will automatically create one with the same "
         "role rewarding behavior as its current level. If that role is the only role "
         "for it's current level role reward, it will keep the role reward, just adjust "
         "the level")
     lchangetype = (
         f"**Usage:** `{pfx} changetype [type] (level)`",
         "**Returns:** A confirmation panel that once confirmed, will set the type of "
         "the role rewarding behavior for the specified level",
         "**Aliases:** `ct` `typechange`",
         "**Note:** If `(level)` is unspecified, it will set all currently active role rewards "
         "to the type specified by `[type]`. `[type]` can be \"add\" *(\"a\")* or "
         "\"replace\" *(\"r\")* to specify if the previous roles obtained "
         "should be kept or if the new roles will replace the old roles")
     nv = [("Give", lgive), ("Remove", lremove), ("Reset", lreset),
           ("List", llist), ("Change Level", lchangelevel),
           ("Change Type", lchangetype)]
     embed = discord.Embed(title="Role Rewards Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=2,
                               show_entry_count=True,
                               embed=embed)
     return await pag.paginate()
Пример #11
0
 async def send_poll_help(self, ctx) -> discord.Message:
     pfx = f"{await gcmds.prefix(ctx)}poll"
     description = (
         "MarwynnBot has a highly customisable polling feature which allows "
         "you to create and manage polls in servers you moderate/own. You can create "
         "polls with up to 10 answer choices and customise the maximum answers users can "
         f"choose at once. The base command is `{pfx}`. Here are all the polling commands"
     )
     pcreate = (
         f"**Usage:** `{pfx} create`",
         "**Returns:** An interactive setup panel that will guide you to creating a poll",
         "**Aliases:** `set` `start`")
     pfinish = (
         f"**Usage:** `{pfx} finish [message_id]`",
         "**Returns:** A confirmation embed which once confirmed, will mark the poll as finished "
         "and display its results", "**Aliases:** `complete` `done`",
         "**Note:** The original poll message will be deleted, and a new message will be sent in that "
         "same channel that will display the results of the poll. This action cannot be undone"
     )
     pedit = (
         f"**Usage:** `{pfx} edit [message_id]`",
         "**Returns:** An interactive setup panel that will guide you to editing an active poll",
         "**Aliases:** `edit` `modify` `change`",
         "**Note:** `[message_id]`must be the message ID of a poll that you have created. "
         "You may not edit a poll created by another user, even if you are the server owner"
     )
     plist = (
         f"**Usage:** `{pfx} list`",
         "**Returns:** A paginated list of all active polls in the server",
         "**Aliases:** `ls` `show`",
         "**Note:** Only the active polls will be displayed. All finished or inactive polls "
         "will not be displayed through this command")
     pmode = (
         f"**Usage:** `{pfx} mode [mode] (message_id)*va`",
         "**Returns:** A confirmation embed which once confirmed, will edit the mode of the "
         "specified polls to the mode specified", "**Aliases:** `cm`",
         "**Note:** You may only change the mode of the polls you own. "
         "`[mode]` may be a number between 1 and 10 inclusive, which will designate the maximum "
         "amount of options a member can choose at a time. "
         f"If `(message_id)*va` is unspecified, it will change the mode of all the currently active "
         "polls you own to the mode specified in `[mode]`")
     ptitle = (
         f"**Usage:** `{pfx} title [title] [message_id]`",
         "**Returns:** A confirmation embed which once confirmed, will edit the title of the specified "
         "poll to the title specified", "**Aliases:** `ct`",
         "**Note:** You may only change the title of the polls you own. "
         "`[title]` must be at most 256 characters (including whitespace)")
     pdescription = (
         f"**Usage:** `{pfx} description [description] [message_id]`",
         "**Returns:** A confirmation embed which once confirmed, will edit the description "
         "of the specified poll to the description specified",
         "**Aliases:** `cd` `content`",
         "**Note:** You may only change the description of the polls you own. "
         "`[description]` must be at most 2048 characters (including whitespace)"
     )
     pchoices = (
         f"**Usage:** `{pfx} choices [message_id]`",
         "**Returns:** An interactive setup panel that will guide you to editing the "
         "choices of the specified poll", "**Aliases:** `options` `cc`",
         "**Note:** You may only change the choices of the polls you own. ")
     nv = [("Create", pcreate), ("Finish", pfinish), ("Edit", pedit),
           ("List", plist), ("Mode", pmode), ("Title", ptitle),
           ("Description", pdescription), ("Choices", pchoices)]
     embed = discord.Embed(title="Polls Help",
                           description=description,
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=3,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()
Пример #12
0
 async def send_logging_help(self, ctx):
     pfx = f"{await gcmds.prefix(ctx)}logging"
     description = (
         f"{ctx.author.mention}, the base command is `{pfx}` *aliases=`lg` `log`*. Logging is a powerful "
         "tool that will allow you to track multiple things at a time:\n",
         "**1. Command Execution**",
         "> With logging level `basic`, MarwynnBot can send a message in the specified logging channel "
         "whenever a server member uses a command. Logging messages may vary depending on what command "
         "was used. *For example, logging moderation commands may display the results of the moderation "
         "action, or logging actions commands may display what action was done to which member*\n",
         "**2. Server Modification Events**",
         "> With logging level `server`, MarwynnBot will be able to do anything in logging level `basic`, "
         "but with the ability to log changes that happen to the server, such as moving voice regions, "
         "renaming channels, changing channel permissions, anything that happens in audit log, etc\n",
         "**3. Member Modification Events**",
         "> With logging level 'hidef`, MarwynnBot will be able to do anything in loggin g level `server`, "
         "but with the ability to log changes that happen to members in your server. This includes things "
         "like status changes, nickname updates, username changes, etc. This can fall under a breach of "
         "privacy, so this logging will only be reserved for those that have been pre-approved to access "
         "this feature\n", "Here are all the subcommands")
     lset = (
         f"**Usage:** `{pfx} set [#channel]`",
         "**Returns:** An embed that confirms that you have successfully set the logging channel",
         "**Aliases:** `-s` `use`",
         "**Note:** `[#channel]` should be a channel tag or channel ID")
     lcommand = (
         f"**Usage:** `{pfx} command [command]`",
         "**Returns:** An embed that confirms you have successfully toggled logging status for that command",
         "**Aliases:** `toggle` `cmd`",
         "**Note:** `[command]` must be a command name, not an alias *(`help` instead of `h`)*. Enter "
         "*\"all\"* to toggle all")
     llist = (
         f"**Usage:** `{pfx} list (command)`",
         "**Returns:** An embed that displays the current logging channel and logging level, if set",
         "**Aliases:** `ls` `show` `display`",
         "**Note:** This will return an error message if no logging channel is set. If `(command)` is "
         "specified, it will display the logging status for that command if it is a valid command"
     )
     ldisable = (
         f"**Usage:** `{pfx} disable`",
         "**Returns:** A confirmation embed that once confirmed, will disable logging on this server",
         "**Aliases:** `rm` `delete` `reset` `clear` `remove`")
     llevel = (
         f"**Usage:** `{pfx} level [level]`",
         "**Returns:** An embed that confirms the server's log level was changed",
         "**Aliases:** `lvl` `levels`",
         "**Note:** This command can only be used if your server is a MarwynnBot Premium Server. "
         "`[level]` must be either \"basic\", \"server\", or \"hidef\"")
     lblacklist = (
         f"**Usage:** `{pfx} blacklist (guild)`",
         "**Returns:** An embed that confirms the blacklist has been set for `(guild)`",
         "**Aliases:** `bl`",
         "**Note:** This is an owner only command. `(guild)` will default to the current server "
         "if unspecified")
     nv = [("Set", lset), ("Command", lcommand), ("List", llist),
           ("Disable", ldisable), ("Level", llevel),
           ("Blacklist", lblacklist)]
     embed = discord.Embed(title="Logging Help",
                           description="\n".join(description),
                           color=discord.Color.blue())
     pag = SubcommandPaginator(ctx,
                               entries=[(name, value, False)
                                        for name, value in nv],
                               per_page=2,
                               show_entry_count=False,
                               embed=embed)
     return await pag.paginate()