Exemplo n.º 1
0
    async def send_bot_help(self, mapping):
        locs = local.get_localized(self.context)
        jishaku = False
        for key, value in mapping.items():
            mapping[key] = await self.filter_commands(value)
            if (key):
                cog_names = locs['cogs']
                key.name = key.qualified_name.format_map(cog_names)

                if (key.qualified_name == 'Jishaku'):
                    jishaku = key

        if (jishaku):
            del mapping[jishaku]

        embed = discord.Embed(colour=0x289566, description=locs['helpDesc'])
        embed.set_footer

        for cog, commands in mapping.items():
            commands = list(set(commands))
            value = []
            for com in commands:
                value.append(
                    f'`{self.context.prefix}{com.name}` - {self.format_command(com)}'
                )
            embed.add_field(name=f'{cog.name if cog else locs["nocog"]}:',
                            value='\n'.join(value))
        embed.add_field(name=locs['support'],
                        value='**https://discord.gg/A4NETzF**')

        await self.context.send(embed=embed)
Exemplo n.º 2
0
 def generate_embed(ctx):
     locs = local.get_localized(ctx)
     embed = discord.Embed(colour=0x289566,
                           title=locs['botS'],
                           description=f'**{locs["switch"]}:** 🔁')
     embed.description += f'\n\n{locs["con"]}: ✅'
     return embed
Exemplo n.º 3
0
async def settings(ctx):
    def generate_embed(ctx):
        locs = local.get_localized(ctx)
        embed = discord.Embed(colour=0x289566,
                              title=locs['botS'],
                              description=f'**{locs["switch"]}:** 🔁')
        embed.description += f'\n\n{locs["con"]}: ✅'
        return embed

    emb_msg = await ctx.send(embed=generate_embed(ctx))

    await emb_msg.add_reaction('🔁')
    await emb_msg.add_reaction('✅')

    while True:
        locs = local.get_localized(ctx)
        embed = generate_embed(ctx)

        try:
            reaction, user = await bot.wait_for(
                'reaction_add',
                timeout=15.0,
                check=lambda rea, usr: str(rea) in '🔁✅' and usr == ctx.message.
                author and rea.message == emb_msg)
        except asyncio.TimeoutError:
            break

        if (str(reaction) == '✅'):
            await emb_msg.delete()
            await ctx.send(locs['sCon'])
            break

        if not (user.guild_permissions.administrator
                or user.guild_permissions.manage_guild):
            embed = generate_embed(ctx)
            embed.set_footer(text=f'❎ {locs["adminWarn"]}')
            await emb_msg.edit(embed=embed)

        else:
            if (str(reaction) == '🔁'):
                local.change_locs(ctx.guild)
                locs = local.get_localized(ctx)
                embed = generate_embed(ctx)

                embed.set_footer(text=f'✅ {locs["sCon"]}')
                await emb_msg.edit(embed=embed)
Exemplo n.º 4
0
async def give_feedback(ctx, *, feedback=''):
    locs = local.get_localized(ctx)
    if (not feedback):
        await ctx.send(
            embed=discord.Embed(colour=0x289566, description=locs['fbBrief']))
    else:
        owner = bot.get_user(343001477133893632)
        await owner.send(f'{ctx.author.name} ({ctx.author.id}): {feedback}')
        await ctx.send(
            embed=discord.Embed(colour=0x289566, description=locs['sCon']))
Exemplo n.º 5
0
	async def order_champagne(self, ctx):
		locs = local.get_localized(ctx)
		if (self.take_vote(ctx.author.id)):
			embed = discord.Embed(
				colour = 0x289566,
				description = random.choice(menu.ORDER_PHRASES)
				)
			embed.set_image(url = random.choice(menu.CHAMPAGNE_PICS))
			embed.set_footer(text = random.choice(menu.CHAMPAGNE_FACTS))

			await ctx.send(embed = embed)
		else:
			await ctx.send(embed = discord.Embed(
					colour = 0xff5555,
					description = locs['novotes']
				))
Exemplo n.º 6
0
async def feedback_handler(ctx, error):
    locs = local.get_localized(ctx)
    if (local.is_ru(ctx.guild)):
        humanize.i18n.activate('ru_RU')
    else:
        humanize.i18n.deactivate()
    if (isinstance(error, commands.CommandOnCooldown)):
        await ctx.send(
            embed=discord.Embed(colour=0xff5555,
                                description=locs['onCd'].format(
                                    error.cooldown.rate,
                                    humanize.naturaldelta(
                                        datetime.timedelta(
                                            seconds=error.cooldown.per)),
                                    humanize.naturaldelta(
                                        datetime.timedelta(
                                            seconds=error.retry_after)))))
Exemplo n.º 7
0
async def bot_invite(ctx):
    locs = local.get_localized(ctx)
    permissions = discord.Permissions(create_instant_invite=True,
                                      change_nickname=True,
                                      read_messages=True,
                                      send_messages=True,
                                      send_tts_messages=True,
                                      embed_links=True,
                                      attach_files=True,
                                      read_message_history=True,
                                      use_external_emojis=True,
                                      add_reactions=True)
    bot_id = bot.user.id
    await ctx.send(embed=discord.Embed(
        colour=0x289566,
        description=
        f'{locs["invite"]}https://discord.com/api/oauth2/authorize?client_id={bot_id}&permissions={permissions.value}&scope=bot'
    ))
Exemplo n.º 8
0
async def dblvote(ctx):
    locs = local.get_localized(ctx)
    await ctx.send(locs["bug0"])
    await ctx.send(embed=discord.Embed(
        colour=0x289566,
        description=f'{locs["vote"]}https://top.gg/bot/{bot.user.id}/vote'))