Browse Source

removed useless code

removed useless code
tags/v2.0.0
Roxie Gibson 5 years ago
parent
commit
c8004aac6f
1 changed files with 4 additions and 13 deletions
  1. +4
    -13
      roxbot/cogs/selfassign.py

+ 4
- 13
roxbot/cogs/selfassign.py View File



@commands.guild_only() @commands.guild_only()
@commands.command(pass_context=True) @commands.command(pass_context=True)
async def iam(self, ctx, *, role: discord.Role = None):
async def iam(self, ctx, *, role: discord.Role):
""" """
Self-assign yourself a role. Only one role at a time.
Self-assign yourself a role. Only one role at a time. # TODO: Experiment with special converters here.
Usage: Usage:
{command_prefix}iam [role] {command_prefix}iam [role]
Example: Example:
""" """
settings = gs.get(ctx.guild) settings = gs.get(ctx.guild)


if role is None:
# Hacky way to get the error I want
from inspect import Parameter
raise commands.MissingRequiredArgument(Parameter("Role", False))

if not settings.self_assign["enabled"]: if not settings.self_assign["enabled"]:
embed = discord.Embed(colour=roxbot.EmbedColours.pink, description="SelfAssignable roles are not enabled on this server") embed = discord.Embed(colour=roxbot.EmbedColours.pink, description="SelfAssignable roles are not enabled on this server")
return await ctx.send(embed=embed) return await ctx.send(embed=embed)


@commands.guild_only() @commands.guild_only()
@commands.command(pass_context=True) @commands.command(pass_context=True)
async def iamn(self, ctx, *, role: discord.Role = None):
async def iamn(self, ctx, *, role: discord.Role):
""" """
Remove a self-assigned role Remove a self-assigned role
Usage: Usage:
""" """
settings = gs.get(ctx.guild) settings = gs.get(ctx.guild)


if role is None:
from inspect import Parameter
raise commands.MissingRequiredArgument(Parameter("role", False))

if not settings.self_assign["enabled"]: if not settings.self_assign["enabled"]:
embed = discord.Embed(colour=roxbot.EmbedColours.pink, description="SelfAssignable roles are not enabled on this server") embed = discord.Embed(colour=roxbot.EmbedColours.pink, description="SelfAssignable roles are not enabled on this server")
return await ctx.send(embed=embed) return await ctx.send(embed=embed)




def setup(Bot): def setup(Bot):
Bot.add_cog(SelfAssign(Bot))
Bot.add_cog(SelfAssign(Bot))

Loading…
Cancel
Save