コード例 #1
0
 async def leaderboard(self, ctx):
     records = mycursor.execute(
         "SELECT UserID, XP FROM users ORDER BY XP DESC")
     menu = MenuPages(source=Menu(ctx, records),
                      clear_reactions_after=True,
                      timeout=100.0)
     await menu.start(ctx)
コード例 #2
0
ファイル: xp.py プロジェクト: OracleLOG/RoleManagerBot
 async def leaderboard(self, ctx):
     member_dto = MemberDto()
     results = member_dto.get_leaderboard()
     menu = MenuPages(source=HelpMenu(ctx, results),
                      clear_reactions_after=True,
                      timeout=60.0)
     await menu.start(ctx)
コード例 #3
0
ファイル: help.py プロジェクト: pille1842/gerfroniabot
    async def show_help(self, ctx, cmd: Optional[str]):
        """
        Wird `hilfe` ohne Parameter aufgerufen, zeigt es eine Übersicht aller Befehle an.
        Wenn als Parameter `cmd` der Name eines Befehls übergeben wird, dann wird zu diesem Befehl
        eine ausführlichere Hilfe angezeigt.

        Die Hilfe zu einem Befehl zeigt zunächst eine Kurzform der Befehlssyntax. Dabei wird der
        Hauptname des Befehls und alle Aliase, unter denen er ebenfalls aufgerufen werden kann,
        getrennt durch | angezeigt. Erforderliche Parameter werden in <Pfeilklammern> dargestellt.
        Optionale Parameter werden in <eckigen> Klammern dargestellt:

        ```
        befehl|kurzform|kurzform2 <erforderlicher_Parameter> [optionaler_Parameter]
        ```

        Es folgt die Kurzzusammenfassung der Funktion des Befehls sowie eine ausführliche
        Beschreibung.
        """
        if cmd is None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                             delete_message_after=True,
                             timeout=120.0)
            await menu.start(ctx)
        else:
            if (command := get(self.bot.commands, name=cmd)):
                await self.cmd_help(ctx, command)
            else:
コード例 #4
0
ファイル: exp.py プロジェクト: manemejeff/MarvinBot
    async def display_leaderboard(self, ctx):
        records = db.records("SELECT UserID, XP, Level FROM exp ORDER BY XP DESC")

        menu = MenuPages(source=HelpMenu(ctx, records),
                         clear_reactions_after=True,
                         timeout=60.0)
        await menu.start(ctx)
コード例 #5
0
ファイル: reaction_aggregater.py プロジェクト: being24/sagumo
 async def start_paginating(self, ctx, reaction_list_of_guild):
     if reaction_list_of_guild is None:
         await ctx.send("集計中のリアクションはありません")
     else:
         menu = MenuPages(source=ReactionList(ctx, reaction_list_of_guild),
                          delete_message_after=True,
                          timeout=60.0)
         await menu.start(ctx)
コード例 #6
0
    async def acnh(self, ctx):
        """Command group to check and register AC:NH information."""

        all_profile_data = await self._get_all_profile_data()

        menu = MenuPages(source=menus.ProfileSource(all_profile_data),
                         clear_reactions_after=True)
        await menu.start(ctx)
コード例 #7
0
ファイル: help.py プロジェクト: Asi4nn/Shiver-Bot
 async def show_help(self, ctx, cmd: Optional[str]):
     if cmd is None:
         menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)), delete_message_after=True, timeout=60.0)
         await menu.start(ctx)
     else:
         command = get(self.bot.commands, name=cmd)
         if command is not None:
             await self.cmd_help(ctx, command)
         else:
             await ctx.reply("That command doesn't exist")
コード例 #8
0
ファイル: help.py プロジェクト: ahroria/onlydpsbot
 async def show_help(self,ctx, cmd: Optional[str]):
     if cmd is None:
         menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                          delete_message_after=True,
                          timeout=60.0)
         await menu.start(ctx)
     else:
         if (command := get(self.bot.commands, name=cmd)): #get looks through list and finds
             await self.cmd_help(ctx, command)
         else:
コード例 #9
0
ファイル: help.py プロジェクト: x-daniel-17/Doob-1
    async def show_help(self, ctx, cmd: Optional[str]):
        """Gives you some help on the Doob commands!"""
        if cmd is None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)), clear_reactions_after=True, timeout=100.0)
            await menu.start(ctx)

        else:
            if (command := get(self.bot.commands, name=cmd)):
                await self.cmd_help(ctx, command)

            else:
コード例 #10
0
    async def send_bot_help(self, mapping):
        all_cogs = list(mapping.keys())

        cogs_filtered = [
            cog for cog in all_cogs
            if cog and (cog.qualified_name not in self.ignored_cogs)
        ]

        menu = MenuPages(source=HelpMainMenu(self.context, cogs_filtered),
                         clear_reactions_after=True,
                         timeout=60.0)
        await menu.start(self.context)
コード例 #11
0
ファイル: Help.py プロジェクト: ReubenDollmanYT/CPU-Economy
    async def show_help(self, ctx, cmd: Optional[str]):
        """Shows this help command"""
        if cmd == None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                             delete_message_after=True,
                             timeout=9999999.0)

            await menu.start(ctx)
        else:
            if (command := get(self.bot.commands, name=cmd)):
                await self.cmd_help(ctx, command)
            else:
コード例 #12
0
    async def show_help(self, ctx, komut: Optional[str]):
        if komut is None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                             delete_message_after=True,
                             timeout=60.0)
            await menu.start(ctx)

        else:
            if (command := get(self.bot.commands, name=komut)):
                await self.komut_help(ctx, command)

            else:
コード例 #13
0
    async def _start_gfy_pagination(self, ctx, source, user_id):
        if type(source) is list:
            await ctx.send(f"Found `{len(source)}` Gfys for user `{user_id}`.")
            source = GfyListSource(source)
        else:
            source = AsyncGfySource(source)

        pages = MenuPages(source=source, clear_reactions_after=True)
        try:
            await pages.start(ctx)
        except GfySourceEmpty:
            await ctx.send(
                "Could not find any gfys that meet the given criteria.")
コード例 #14
0
	async def help(self, ctx, cmd:str = None):
		"""Shows this message."""
		if cmd is None:
			menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
							 delete_message_after=True,
							 timeout=60.0)
			await menu.start(ctx)

		else:
			if (command := get(self.bot.commands, name=cmd)):
				await self.cmd_help(ctx, command)

			else:
コード例 #15
0
    async def list(self, ctx):
        """
        Lists your reminders
        """
        async with self.bot.Session() as session:
            reminders = await db.get_reminders(session, user_id=ctx.author.id)

            if len(reminders) > 0:
                pages = MenuPages(source=ReminderListSource(reminders),
                                  clear_reactions_after=True)
                await pages.start(ctx)
            else:
                await ctx.send("You have 0 pending reminders!")
コード例 #16
0
ファイル: help.py プロジェクト: RoySmit/discord.py-bot
    async def show_help(self, ctx, cmd: Optional[str]):
        """Used to see the command list."""
        if cmd is None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                             delete_message_after=True,
                             timeout=60.0)
            await menu.start(ctx)

        else:
            if (command := get(self.bot.commands, name=cmd)):
                await self.cmd_help(ctx, command)

            else:
コード例 #17
0
ファイル: help.py プロジェクト: Vixting/Tuna
    async def show_help(self, ctx, cmd: Optional[str]):
        """Displys information on commands."""
        if cmd is None:
            menu = MenuPages(source=HelpMenu(ctx, list(self.bot.commands)),
                             delete_message_after=True,
                             timeout=60.0)
            await menu.start(ctx)

        else:
            if (command := get(self.bot.commands
                               or self.bot.get_command(bot, command).aliases,
                               name=cmd)):
                await self.cmd_help(ctx, command)

            else: