Example #1
0
 async def update(self, ctx: commands.Context, infraction: ServerInfraction, *, reason: Reason):
     """inf_update_help"""
     infraction.mod_id = ctx.author.id
     infraction.reason = reason
     infraction.save()
     await MessageUtils.send_to(ctx, 'YES', 'inf_updated', id=infraction.id)
     InfractionUtils.clear_cache(ctx.guild.id)
Example #2
0
 async def claim(self, ctx, infraction: ServerInfraction):
     """inf_claim_help"""
     infraction.mod_id = ctx.author.id
     infraction.save()
     await MessageUtils.send_to(ctx,
                                'YES',
                                'inf_claimed',
                                inf_id=infraction.id)
     InfractionUtils.clear_cache(ctx.guild.id)
Example #3
0
 async def update(self, ctx: commands.Context, infraction: ServerInfraction, *, reason: Reason):
     """inf_update_help"""
     infraction.mod_id = ctx.author.id
     infraction.reason = reason
     await infraction.save()
     await MessageUtils.send_to(ctx, 'YES', 'inf_updated', id=infraction.id)
     InfractionUtils.clear_cache(ctx.guild.id)
     user = await Utils.get_user(infraction.user_id)
     GearbotLogging.log_key(ctx.guild.id, "inf_update_log", inf=infraction.id, user=Utils.clean_user(user), userid=user.id, mod=Utils.clean_user(ctx.author), modid=ctx.author.id, reason=reason)
Example #4
0
    async def update(self, ctx: commands.Context, infraction: ServerInfraction, *, reason: Reason):
        """inf_update_help"""
        reason += ",".join(Utils.assemble_attachment(ctx.message.channel.id, attachment.id, attachment.filename) for attachment in ctx.message.attachments)
        if len(reason) > 1800:
            raise TranslatedBadArgument('reason_too_long', ctx)

        infraction.mod_id = ctx.author.id
        infraction.reason = reason
        await infraction.save()
        await MessageUtils.send_to(ctx, 'YES', 'inf_updated', id=infraction.id)
        InfractionUtils.clear_cache(ctx.guild.id)
        user = await Utils.get_user(infraction.user_id)
        GearbotLogging.log_key(ctx.guild.id, "inf_update_log", inf=infraction.id, user=Utils.clean_user(user), userid=user.id, mod=Utils.clean_user(ctx.author), modid=ctx.author.id, reason=reason)