Skip to content

Commit

Permalink
fix warnings not being logged
Browse files Browse the repository at this point in the history
  • Loading branch information
AEnterprise committed Aug 2, 2018
1 parent a0788ab commit 593e8f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 5 additions & 3 deletions GearBot/Cogs/Infractions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands

from Util import Permissioncheckers, InfractionUtils, Emoji, Utils, Pages
from Util import Permissioncheckers, InfractionUtils, Emoji, Utils, Pages, GearbotLogging
from database.DatabaseConnector import Infraction


Expand All @@ -27,8 +27,10 @@ async def warn(self, ctx:commands.Context, member:discord.Member, *, reason:str)
await ctx.send(f"{Emoji.get_chat_emoji('NO')} Warning is to long, I can only store warnings up to 1800 characters.")
else:
InfractionUtils.add_infraction(ctx.guild.id, member.id, ctx.author.id, "Warn", reason)
name = Utils.clean(member.name)
await ctx.send(f"{Emoji.get_chat_emoji('YES')} warning for {name}#{member.discriminator} added.")
name = Utils.clean_user(member)
await ctx.send(f"{Emoji.get_chat_emoji('YES')} warning for {name} added.")
aname = Utils.clean_user(ctx.author)
await GearbotLogging.logToModLog(ctx.guild, f"{Emoji.get_chat_emoji('WARNING')} {name} has been warned by {aname}: `{reason}`")
else:
name = Utils.clean(member.name)
await ctx.send(f"{Emoji.get_chat_emoji('NO')} You are not allowed to warn {name}#{member.discriminator}.")
Expand Down
1 change: 0 additions & 1 deletion GearBot/Cogs/Minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ async def info(self, ctx, project_name:str):
await Pages.create_new("cf", ctx, project_name=project_name)

@cf.command()
pass ##TODO: Pages with different versioning
async def latest(self, ctx, project_name:str, version:str):
await Pages.create_new("cf", ctx, project_name=project_name, version=version)

Expand Down
4 changes: 1 addition & 3 deletions GearBot/Cogs/Serveradmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def add_cog_override(self, ctx, cog:str, perm_lvl:int):
overrides = Configuration.getConfigVar(ctx.guild.id, "COG_OVERRIDES")
overrides[cog] = perm_lvl
Configuration.saveConfig(ctx.guild.id)
await ctx.send(f"{Emoji.get_chat_emoji('YES')} The {cog} cog permission lvl is now set at {perm_lvl} ({self.perm_lvls[perm_lvl]}")
await ctx.send(f"{Emoji.get_chat_emoji('YES')} The {cog} cog permission lvl is now set at {perm_lvl} ({self.perm_lvls[perm_lvl]})")
else:
await ctx.send(f"{Emoji.get_chat_emoji('NO')} Please specify a permissions value of 0 (public), 1 (trusted), 2 (mod), 3 (admin), 4 (server owner only) or 5 (disabled)")
else:
Expand Down Expand Up @@ -429,7 +429,5 @@ async def disablejoinLogChannel(self, ctx: commands.Context):
await ctx.send("Join logs have been disabled.")




def setup(bot):
bot.add_cog(Serveradmin(bot))

0 comments on commit 593e8f0

Please sign in to comment.