예제 #1
0
파일: mod.py 프로젝트: dimolto312/Keter
 async def unban(self, ctx, member: MemberID, *, reason: str = None):
     """ Unbans a user from the current server. """
     try:
         await ctx.guild.unban(discord.Object(id=member),
                               reason=default.responsible(
                                   ctx.author, reason))
         await ctx.send(default.actionmessage("unbanned"))
     except Exception as e:
         await ctx.send(e)
예제 #2
0
파일: mod.py 프로젝트: dimolto312/Keter
 async def massban(self, ctx, reason: ActionReason, *members: MemberID):
     """ Mass bans multiple members from the server. """
     try:
         for member_id in members:
             await ctx.guild.ban(discord.Object(id=member_id),
                                 reason=default.responsible(
                                     ctx.author, reason))
         await ctx.send(default.actionmessage("massbanned", mass=True))
     except Exception as e:
         await ctx.send(e)
예제 #3
0
파일: mod.py 프로젝트: dimolto312/Keter
    async def kick(self, ctx, member: discord.Member, *, reason: str = None):
        """ Kicks a user from the current server. """
        if await permissions.check_priv(ctx, member):
            return

        try:
            await member.kick(reason=default.responsible(ctx.author, reason))
            await ctx.send(default.actionmessage("kicked"))
        except Exception as e:
            await ctx.send(e)
예제 #4
0
파일: mod.py 프로젝트: dimolto312/Keter
    async def ban(self, ctx, member: MemberID, *, reason: str = None):
        """ Bans a user from the current server. """
        m = ctx.guild.get_member(member)
        if m is not None and await permissions.check_priv(ctx, m):
            return

        try:
            await ctx.guild.ban(discord.Object(id=member),
                                reason=default.responsible(ctx.author, reason))
            await ctx.send(default.actionmessage("banned"))
        except Exception as e:
            await ctx.send(e)
예제 #5
0
파일: mod.py 프로젝트: dimolto312/Keter
    async def nickname(self, ctx, member: discord.Member, *, name: str = None):
        """ Nicknames a user from the current server. """
        if await permissions.check_priv(ctx, member):
            return

        try:
            await member.edit(nick=name,
                              reason=default.responsible(
                                  ctx.author, "Changed by command"))
            message = f"Changed **{member.name}'s** nickname to **{name}**"
            if name is None:
                message = f"Reset **{member.name}'s** nickname"
            await ctx.send(message)
        except Exception as e:
            await ctx.send(e)
예제 #6
0
파일: mod.py 프로젝트: dimolto312/Keter
    async def unmute(self, ctx, member: discord.Member, *, reason: str = None):
        """ Unmutes a user from the current server. """
        if await permissions.check_priv(ctx, member):
            return

        muted_role = next((g for g in ctx.guild.roles if g.name == "Muted"),
                          None)

        if not muted_role:
            return await ctx.send(
                "Are you sure you've made a role called **Muted**? Remember that it's case sensetive too..."
            )

        try:
            await member.remove_roles(muted_role,
                                      reason=default.responsible(
                                          ctx.author, reason))
            await ctx.send(default.actionmessage("unmuted"))
        except Exception as e:
            await ctx.send(e)