Exemplo n.º 1
0
    async def want(self, ctx):
        """Launches an tutorial session for the want feature.

        Meowth will create a private channel and initiate a
        conversation that walks you through the various commands
        that are enabled on the current server."""

        newbie = ctx.author
        guild = ctx.guild

        # get channel overwrites
        ows = self.get_overwrites(guild, newbie)

        # create tutorial channel
        name = utils.sanitize_channel_name(newbie.display_name+"-tutorial")
        ctx.tutorial_channel = await guild.create_text_channel(
            name, overwrites=ows)
        await ctx.message.delete()
        await ctx.send(
            ("Miau! Criei um canal de tutorial privado pra você! "
             f"Entre em {ctx.tutorial_channel.mention} para continuar"),
            delete_after=20.0)

        # get tutorial settings
        cfg = self.bot.guild_dict[guild.id]['configure_dict']

        await ctx.tutorial_channel.send(
            f"Oi {ctx.author.mention}! Eu sou Miau, um bot de Discord ajudante para "
			"comunidades de Pokémon GO! Eu criei um canal para te ensinar tudo "
			"sobre as coisas com as quais eu posso te ajudar nesse servidor! Você pode "
			"abandonar esse tutorial a qualquer momento e eu irei deletar esse canal "
			"depois de cinco minutos. Vamos começar!")

        try:
            await self.want_tutorial(ctx, cfg)
            await ctx.tutorial_channel.send(
				f"Isso conclui o tutorial do Miau! "
				"Esse canal será deletado em dez segundos.")
            await asyncio.sleep(10)
        finally:
            await ctx.tutorial_channel.delete()
Exemplo n.º 2
0
    async def want(self, ctx):
        """Launches an tutorial session for the want feature.

        Meowth will create a private channel and initiate a
        conversation that walks you through the various commands
        that are enabled on the current server."""

        newbie = ctx.author
        guild = ctx.guild

        # get channel overwrites
        ows = self.get_overwrites(guild, newbie)

        # create tutorial channel
        name = utils.sanitize_channel_name(newbie.display_name + "-tutorial")
        ctx.tutorial_channel = await guild.create_text_channel(name,
                                                               overwrites=ows)
        await ctx.message.delete()
        await ctx.send(("Meowth! I've created a private tutorial channel for "
                        f"you! Continue in {ctx.tutorial_channel.mention}"),
                       delete_after=20.0)

        # get tutorial settings
        cfg = self.bot.guild_dict[guild.id]['configure_dict']

        await ctx.tutorial_channel.send(
            f"Hi {ctx.author.mention}! I'm Meowth, a Discord helper bot for "
            "Pokemon Go communities! I created this channel to teach you "
            "about the want command! You can abandon this tutorial at any time "
            "and I'll delete this channel after five minutes. "
            "Let's get started!")

        try:
            await self.want_tutorial(ctx, cfg)
            await ctx.tutorial_channel.send(
                f"This concludes the Meowth tutorial! "
                "This channel will be deleted in ten seconds.")
            await asyncio.sleep(10)
        finally:
            await ctx.tutorial_channel.delete()
Exemplo n.º 3
0
    async def team(self, ctx):
        """Launches a tutorial session for the team feature.

        Kyogre will create a private channel and initiate a
        conversation that walks you through the team command."""

        newbie = ctx.author
        guild = ctx.guild

        # get channel overwrites
        ows = self.get_overwrites(guild, newbie)

        # create tutorial channel
        name = utils.sanitize_channel_name(newbie.display_name + "-tutorial")
        ctx.tutorial_channel = await guild.create_text_channel(name,
                                                               overwrites=ows)
        await ctx.message.delete()
        await ctx.send(("I've created a private tutorial channel for "
                        f"you! Continue in {ctx.tutorial_channel.mention}"),
                       delete_after=20.0)

        await ctx.tutorial_channel.send(
            f"Hi {ctx.author.mention}! I'm Kyogre, a Discord helper bot for "
            "Pokemon Go communities! I created this channel to teach you "
            "about the team command! You can abandon this tutorial at any time "
            "and I'll delete this channel after five minutes. "
            "Let's get started!")

        try:
            await self.team_tutorial(ctx)
            await ctx.tutorial_channel.send(
                f"This concludes the tutorial! "
                "This channel will be deleted in ten seconds.")
            await asyncio.sleep(10)
        finally:
            await ctx.tutorial_channel.delete()
Exemplo n.º 4
0
    async def tutorial(self, ctx):
        """Launches an interactive tutorial session for Meowth.

        Meowth will create a private channel and initiate a
        conversation that walks you through the various commands
        that are enabled on the current server."""

        newbie = ctx.author
        guild = ctx.guild
        prefix = ctx.prefix

        # get channel overwrites
        ows = self.get_overwrites(guild, newbie)

        # create tutorial channel
        name = utils.sanitize_channel_name(newbie.display_name + "-tutorial")
        ctx.tutorial_channel = await guild.create_text_channel(name,
                                                               overwrites=ows)
        await ctx.message.delete()
        await ctx.send(("Meowth! I've created a private tutorial channel for "
                        f"you! Continue in {ctx.tutorial_channel.mention}"),
                       delete_after=20.0)

        # get tutorial settings
        cfg = self.bot.guild_dict[guild.id]['configure_dict']
        enabled = [k for k, v in cfg.items() if v.get('enabled', False)]

        await ctx.tutorial_channel.send(
            f"Hi {ctx.author.mention}! I'm Meowth, a Discord helper bot for "
            "Pokemon Go communities! I created this channel to teach you all "
            "about the things I can do to help you on this server! You can "
            "abandon this tutorial at any time and I'll delete this channel "
            "after five minutes. Let's get started!")

        try:

            # start want tutorial
            if 'want' in enabled:
                completed = await self.want_tutorial(ctx, cfg)
                if not completed:
                    return

            # start wild tutorial
            if 'wild' in enabled:
                completed = await self.wild_tutorial(ctx, cfg)
                if not completed:
                    return

            # start raid
            if 'raid' in enabled:
                completed = await self.raid_tutorial(ctx, cfg)
                if not completed:
                    return

            # start exraid
            if 'exraid' in enabled:
                invitestr = ""

                if 'invite' in enabled:
                    invitestr = (
                        "The text channels that are created with this command "
                        f"are read-only until members use the **{prefix}invite** "
                        "command.")

                await ctx.tutorial_channel.send(
                    f"This server utilizes the **{prefix}exraid** command to "
                    "report EX raids! When you use it, I will send a message "
                    "summarizing the report and create a text channel for "
                    f"coordination. {invitestr}\n"
                    "The report must contain only the location of the EX raid.\n\n"
                    "Due to the longer-term nature of EX raid channels, we won't "
                    "try this command out right now.")

            # start research
            if 'research' in enabled:
                completed = await self.research_tutorial(ctx, cfg)
                if not completed:
                    return

            # start team
            if 'team' in enabled:
                completed = await self.team_tutorial(ctx)
                if not completed:
                    return

            # finish tutorial
            await ctx.tutorial_channel.send(
                f"This concludes the Meowth tutorial! "
                "This channel will be deleted in 30 seconds.")
            await asyncio.sleep(30)

        finally:
            await ctx.tutorial_channel.delete()
Exemplo n.º 5
0
    async def tutorial(self, ctx):
        """Launches an interactive tutorial session for Meowth.

        Meowth will create a private channel and initiate a
        conversation that walks you through the various commands
        that are enabled on the current server."""

        newbie = ctx.author
        guild = ctx.guild
        prefix = ctx.prefix

        # get channel overwrites
        ows = self.get_overwrites(guild, newbie)

        # create tutorial channel
        name = utils.sanitize_channel_name(newbie.display_name+"-tutorial")
        ctx.tutorial_channel = await guild.create_text_channel(
            name, overwrites=ows)
        await ctx.message.delete()
        await ctx.send(
            ("Miau! Criei um canal de tutorial privado pra você! "
             f"Entre em {ctx.tutorial_channel.mention} para continuar"),
            delete_after=20.0)

        # get tutorial settings
        cfg = self.bot.guild_dict[guild.id]['configure_dict']
        enabled = [k for k, v in cfg.items() if v.get('enabled', False)]

        await ctx.tutorial_channel.send(
			f"Oi {ctx.author.mention}! Eu sou Miau, um bot de Discord ajudante para "
			"comunidades de Pokémon GO! Eu criei um canal para te ensinar tudo "
			"sobre as coisas com as quais eu posso te ajudar nesse servidor! Você pode "
			"abandonar esse tutorial a qualquer momento e eu irei deletar esse canal "
			"depois de cinco minutos. Vamos começar!")

        try:

            # start want tutorial
            if 'want' in enabled:
                completed = await self.want_tutorial(ctx, cfg)
                if not completed:
                    return

            # start wild tutorial
            if 'wild' in enabled:
                completed = await self.wild_tutorial(ctx, cfg)
                if not completed:
                    return

            # start raid
            if 'raid' in enabled:
                completed = await self.raid_tutorial(ctx, cfg)
                if not completed:
                    return

            # start exraid
            if 'exraid' in enabled:
                invitestr = ""

                if 'invite' in enabled:
                    invitestr = (
						"Os canais de texto criados com esse comando "
						"são somente leitura até que os membros utilizem o comando "
						f"**{prefix}convite**.")

                await ctx.tutorial_channel.send(
					f"Esse servidor utiliza o comando **{prefix}raidex** para "
					"avisar sobre raids EX! Quando você usa ele, irei enviar uma mensagem "
					"resumindo o aviso e criarei um canal de texto para organização. "
					f"{invitestr}\n"
					"O aviso precisa conter apenas a localização da raid EX.\n\n"
					"Devido a longa duração dos canais de raid EX, não iremos "
					"testar esse comando agora.")

            # start research
            if 'research' in enabled:
                completed = await self.research_tutorial(ctx, cfg)
                if not completed:
                    return

            # start team
            if 'team' in enabled:
                completed = await self.team_tutorial(ctx)
                if not completed:
                    return

            # finish tutorial
            await ctx.tutorial_channel.send(
				f"Isso conclui o tutorial do Miau! "
				"Esse canal será deletado em trinta segundos.")
            await asyncio.sleep(30)

        finally:
            await ctx.tutorial_channel.delete()