@commands.bot_has_permissions(manage_roles=True, send_messages=True)
@commands.before_invoke(record_usage)
@cog_ext.cog_slash(name='unmute', description='Unmutes a member in the server', guild_ids=[settings.get_value('guild_id')], options=[create_option(name='member', description='The member that will be unmuted', option_type=6, required=True), create_option(name='reason', description='The reason why the member is being unmuted', option_type=3, required=False)], default_permission=False, permissions={settings.get_value('guild_id'): [create_permission(settings.get_value('role_staff'), SlashCommandPermissionType.ROLE, True), create_permission(settings.get_value('role_trial_mod'), SlashCommandPermissionType.ROLE, True)]})
async def unmute(self, ctx: SlashContext, member: discord.Member, reason: str=None):
    ' Unmutes member in guild. '
    (await ctx.defer())
    if (not isinstance(member, discord.Member)):
        (await embeds.error_message(ctx=ctx, description=f'That user is not in the server.'))
        return
    if (not (await can_action_member(bot=self.bot, ctx=ctx, member=member))):
        (await embeds.error_message(ctx=ctx, description=f'You cannot action {member.mention}.'))
        return
    if (not (await self.is_user_muted(ctx=ctx, member=member))):
        (await embeds.error_message(ctx=ctx, description=f'{member.mention} is not muted.'))
        return
    if (not reason):
        reason = 'No reason provided.'
    elif (len(reason) > 512):
        (await embeds.error_message(ctx=ctx, description='Reason must be less than 512 characters.'))
        return
    embed = embeds.make_embed(ctx=ctx, title=f'Unmuting member: {member.name}', color='soft_green', thumbnail_url='https://i.imgur.com/W7DpUHC.png')
    embed.description = f'{member.mention} was unmuted by {ctx.author.mention} for: {reason}'
    (await self.unmute_member(ctx=ctx, member=member, reason=reason))
    (await self.archive_mute_channel(ctx=ctx, user_id=member.id, reason=reason))
    if (not (await self.send_unmuted_dm_embed(ctx=ctx, member=member, reason=reason))):
        embed.add_field(name='Notice:', value=f'Unable to message {member.mention} about this action. This can be caused by the user not being in the server, having DMs disabled, or having the bot blocked.')
    try:
        (await ctx.send(embed=embed))
    except discord.HTTPException:
        pass
Unmutes member in guild.
@commands.bot_has_permissions(manage_roles=True, send_messages=True)
@commands.before_invoke(record_usage)
@cog_ext.cog_slash(name='unmute', description='Unmutes a member in the server', guild_ids=[settings.get_value('guild_id')], options=[create_option(name='member', description='The member that will be unmuted', option_type=6, required=True), create_option(name='reason', description='The reason why the member is being unmuted', option_type=3, required=False)], default_permission=False, permissions={settings.get_value('guild_id'): [create_permission(settings.get_value('role_staff'), SlashCommandPermissionType.ROLE, True), create_permission(settings.get_value('role_trial_mod'), SlashCommandPermissionType.ROLE, True)]})
async def unmute(self, ctx: SlashContext, member: discord.Member, reason: str=None):
    '  '
    (await ctx.defer())
    if (not isinstance(member, discord.Member)):
        (await embeds.error_message(ctx=ctx, description=f'That user is not in the server.'))
        return
    if (not (await can_action_member(bot=self.bot, ctx=ctx, member=member))):
        (await embeds.error_message(ctx=ctx, description=f'You cannot action {member.mention}.'))
        return
    if (not (await self.is_user_muted(ctx=ctx, member=member))):
        (await embeds.error_message(ctx=ctx, description=f'{member.mention} is not muted.'))
        return
    if (not reason):
        reason = 'No reason provided.'
    elif (len(reason) > 512):
        (await embeds.error_message(ctx=ctx, description='Reason must be less than 512 characters.'))
        return
    embed = embeds.make_embed(ctx=ctx, title=f'Unmuting member: {member.name}', color='soft_green', thumbnail_url='https://i.imgur.com/W7DpUHC.png')
    embed.description = f'{member.mention} was unmuted by {ctx.author.mention} for: {reason}'
    (await self.unmute_member(ctx=ctx, member=member, reason=reason))
    (await self.archive_mute_channel(ctx=ctx, user_id=member.id, reason=reason))
    if (not (await self.send_unmuted_dm_embed(ctx=ctx, member=member, reason=reason))):
        embed.add_field(name='Notice:', value=f'Unable to message {member.mention} about this action. This can be caused by the user not being in the server, having DMs disabled, or having the bot blocked.')
    try:
        (await ctx.send(embed=embed))
    except discord.HTTPException:
        pass