Compare commits

..

3 Commits
main ... dev

@ -17,10 +17,13 @@ Mee2 Essentials Cog is an official cog for the Mee2 Discord bot. This cog contai
- `/unlock`: Unlocks the channel where the command was used. - `/unlock`: Unlocks the channel where the command was used.
- `/lockdown`: Locks the whole server down so the default role can't type in any channel. - `/lockdown`: Locks the whole server down so the default role can't type in any channel.
- `/unlockdown`: Unlocks the whole server so the default role can type where they could before - `/unlockdown`: Unlocks the whole server so the default role can type where they could before
- `/reputation [member]`: Shows the reputation of a member.
- `+rep [member_mention] [optional_comment]`: Adds positive to a member.
- `-rep [member_mention] [optional_comment]`: Adds negative reputation to a member.
## Installation ## Installation
1. Clone the repository or download the code as a ZIP file and extract it. 1. Clone the repository or download the code as a ZIP file and extract it.
2. Copy the essentials folder to your Mee2 bot's cogs folder 2. Copy the essentials folder to your Mee2 bot's cogs folder
3. Add essentials to your bot's config.toml file under the cogs list example: cogs=["cogs.example","cogs.Essentials.commands"] 3. Add essentials to your bot's config.toml file under the cogs list example: cogs=["cogs.example","cogs.essentials.commands"]

@ -23,8 +23,6 @@ else:
with open("cogs/essentials/config.toml", "r") as f: with open("cogs/essentials/config.toml", "r") as f:
esconf = toml.load(f) esconf = toml.load(f)
class EssentialCommands(commands.Cog): class EssentialCommands(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@ -110,7 +108,7 @@ class EssentialCommands(commands.Cog):
embed = discord.Embed(description=f"You have given {reputation_type} reputation to {user.mention} with the comment: {comment}", title="You have given reputation.") embed = discord.Embed(description=f"You have given {reputation_type} reputation to {user.mention} with the comment: {comment}", title="You have given reputation.")
await message.channel.send(embed=embed) await message.channel.send(embed=embed)
@commands.slash_command() @commands.slash_command(guild_ids=guild_ids)
async def reputation(self, ctx, user: discord.User): async def reputation(self, ctx, user: discord.User):
# load the reputation data from the TOML file # load the reputation data from the TOML file
try: try:
@ -157,6 +155,7 @@ class EssentialCommands(commands.Cog):
return 0 return 0
await ctx.respond('Pong!') await ctx.respond('Pong!')
@commands.slash_command(guild_ids=guild_ids) @commands.slash_command(guild_ids=guild_ids)
@option('msg', description="The message to say.") @option('msg', description="The message to say.")
async def say(self, ctx, message): async def say(self, ctx, message):
@ -322,7 +321,7 @@ class EssentialCommands(commands.Cog):
atr = getattr(discord.Color, color) atr = getattr(discord.Color, color)
embed.color = atr() embed.color = atr()
except Exception as e: except Exception as e:
bot.api.logger("inf", f"Command ivoked a error wrong color: {e}") self.bot.api.logger("inf", f"Command ivoked a error wrong color: {e}")
ctx.send("ERR: Invalid color.") ctx.send("ERR: Invalid color.")
return 1 return 1
if footer: if footer:

Loading…
Cancel
Save