1
0
Fork 0

Update help

This commit is contained in:
Ethanell 2020-11-05 16:58:56 +01:00
parent 96ea845a2b
commit 841c5f6da6

View file

@ -2,10 +2,9 @@ import re
from discord import Embed, Member from discord import Embed, Member
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import BadArgument, MissingPermissions from discord.ext.commands import BadArgument, MissingPermissions, CommandError
import db import db
from administrator.check import is_enabled
from administrator.logger import logger from administrator.logger import logger
@ -24,7 +23,6 @@ class PCP(commands.Cog):
return "PCP Univ Lyon 1" return "PCP Univ Lyon 1"
@commands.group("pcp", pass_context=True) @commands.group("pcp", pass_context=True)
@is_enabled()
@commands.guild_only() @commands.guild_only()
async def pcp(self, ctx: commands.Context): async def pcp(self, ctx: commands.Context):
group = ctx.message.content.replace(f"{ctx.prefix}{ctx.command} ", "").upper() group = ctx.message.content.replace(f"{ctx.prefix}{ctx.command} ", "").upper()
@ -67,12 +65,14 @@ class PCP(commands.Cog):
s.close() s.close()
if p: if p:
embed.add_field(name="pcp <group>", value="Join your group", inline=False) embed.add_field(name="pcp <group>", value="Join your group", inline=False)
if await self.pcp_group.can_run(ctx): for c, n, v in [[self.pcp_group, "pcp group", "Manage PCP group"],
embed.add_field(name="pcp group", value="Manage PCP group", inline=False) [self.pcp_pin, "pcp pin <url>", "Pin a message with the url"],
if await self.pcp_pin.can_run(ctx): [self.pcp_unpin, "pcp unpin <url>", "Unpin a message with the url"]]:
embed.add_field(name="pcp pin <url>", value="Pin a message with the url", inline=False) try:
if await self.pcp_unpin.can_run(ctx): if await c.can_run(ctx):
embed.add_field(name="pcp unpin <url>", value="Unpin a message with the url", inline=False) embed.add_field(name=n, value=v, inline=False)
except CommandError:
pass
if not embed.fields: if not embed.fields:
raise MissingPermissions("") raise MissingPermissions("")
await ctx.send(embed=embed) await ctx.send(embed=embed)