aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cogs/moderator.py10
-rw-r--r--cogs/welcome.py1
2 files changed, 9 insertions, 2 deletions
diff --git a/cogs/moderator.py b/cogs/moderator.py
index ef7738b..7d78741 100644
--- a/cogs/moderator.py
+++ b/cogs/moderator.py
@@ -72,7 +72,10 @@ class Admin(commands.Cog):
@commands.command(hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def mute(self, ctx, member: discord.Member, reason: str="No Reason", min_muted: int=0):
+ async def mute(self, ctx, member: discord.Member=None, reason: str="No Reason", min_muted: int=0):
+ if member is None:
+ await ctx.send("Please specify the member you want to mute.")
+ return
muted_role = discord.utils.get(member.guild.roles, name="Muted")
if self.bot.user == member: # Just why would you want to mute him?
await ctx.send(f'You\'re not allowed to mute ziBot!')
@@ -89,7 +92,10 @@ class Admin(commands.Cog):
@commands.command(hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def unmute(self, ctx, member: discord.Member, reason: str="No Reason"):
+ async def unmute(self, ctx, member: discord.Member=None, reason: str="No Reason"):
+ if member is None:
+ await ctx.send("Please specify the member you want to unmute.")
+ return
muted_role = discord.utils.get(member.guild.roles, name="Muted")
if muted_role in member.roles:
await member.remove_roles(muted_role)
diff --git a/cogs/welcome.py b/cogs/welcome.py
index 4cfa7fd..637e510 100644
--- a/cogs/welcome.py
+++ b/cogs/welcome.py
@@ -12,6 +12,7 @@ class Welcome(commands.Cog):
async def on_member_join(self, member):
server = member.guild
welcome_channel = self.bot.get_channel(740051039499059271)
+ # TODO: find a way to get channel id if possible
member_role = discord.utils.get(member.guild.roles, name="Member")
try:
await member.add_roles(member_role)