How to use the xenon.cogs.builder.BuildMenu function in xenon

To help you get started, we’ve selected a few xenon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Magic-Bots / xenon / xenon / cogs / builder.py View on Github external
async def build(self, ctx):
        """
        Choose between different options and build your discord server in less than a minute
        Enable and disable options by clicking the associated number and change the page
        by clicking the arrows. Click on the check to start the build process.


        __Examples__

        ```{c.prefix}build```
        """
        menu = BuildMenu(ctx)
        reason = f"Built by {ctx.author}"
        options = await menu.run()

        if options["delete_old_channels"] or options["delete_old_roles"]:
            warning = await ctx.send(
                **ctx.em("Are you sure you want to start the build process?\n"
                         "Channels and roles might get deleted and reconstructed from the build options!",
                         type="warning"))
            await warning.add_reaction("✅")
            await warning.add_reaction("❌")
            try:
                reaction, user = await self.bot.wait_for(
                    "reaction_add",
                    check=lambda r, u: r.message.id == warning.id and u.id == ctx.author.id,
                    timeout=60)
            except asyncio.TimeoutError: