mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-05-18 11:23:46 +12:00
add in auto role checks
This commit is contained in:
parent
8ceaa0ddee
commit
a63aa3661e
|
@ -382,6 +382,10 @@ class PersonalRoles(commands.Cog):
|
||||||
"""Change icon of personal role using emoji"""
|
"""Change icon of personal role using emoji"""
|
||||||
role = await self.config.member(ctx.author).role()
|
role = await self.config.member(ctx.author).role()
|
||||||
role = ctx.guild.get_role(role)
|
role = ctx.guild.get_role(role)
|
||||||
|
if not role:
|
||||||
|
await ctx.send(chat.warning(f"Please create your role using `{ctx.prefix}myrole create`!"))
|
||||||
|
return
|
||||||
|
|
||||||
if not emoji:
|
if not emoji:
|
||||||
if ctx.channel.permissions_for(ctx.author).add_reactions:
|
if ctx.channel.permissions_for(ctx.author).add_reactions:
|
||||||
m = await ctx.send(_("React to this message with your emoji"))
|
m = await ctx.send(_("React to this message with your emoji"))
|
||||||
|
@ -447,6 +451,10 @@ class PersonalRoles(commands.Cog):
|
||||||
"""Change icon of personal role by using image"""
|
"""Change icon of personal role by using image"""
|
||||||
role = await self.config.member(ctx.author).role()
|
role = await self.config.member(ctx.author).role()
|
||||||
role = ctx.guild.get_role(role)
|
role = ctx.guild.get_role(role)
|
||||||
|
if not role:
|
||||||
|
await ctx.send(chat.warning(f"Please create your role using `{ctx.prefix}myrole create`!"))
|
||||||
|
return
|
||||||
|
|
||||||
if not (ctx.message.attachments or url):
|
if not (ctx.message.attachments or url):
|
||||||
raise commands.BadArgument
|
raise commands.BadArgument
|
||||||
if ctx.message.attachments:
|
if ctx.message.attachments:
|
||||||
|
@ -482,6 +490,10 @@ class PersonalRoles(commands.Cog):
|
||||||
"""Remove icon of personal role"""
|
"""Remove icon of personal role"""
|
||||||
role = await self.config.member(ctx.author).role()
|
role = await self.config.member(ctx.author).role()
|
||||||
role = ctx.guild.get_role(role)
|
role = ctx.guild.get_role(role)
|
||||||
|
if not role:
|
||||||
|
await ctx.send(chat.warning(f"Please create your role using `{ctx.prefix}myrole create`!"))
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await edit_role_icon(
|
await edit_role_icon(
|
||||||
self.bot,
|
self.bot,
|
||||||
|
|
Loading…
Reference in a new issue