async def archive_mute_channel(self, user_id: int, reason: str=None, ctx: SlashContext=None, guild: int=None):
    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
    guild = (guild or ctx.guild)
    category = discord.utils.get(guild.categories, id=settings.get_value('category_tickets'))
    mute_channel = discord.utils.get(category.channels, name=f'mute-{user_id}')
    db = dataset.connect(database.get_db())
    table = db['mod_logs']
    mute_entry = table.find_one(user_id=user_id, type='mute', order_by='-id')
    unmute_entry = table.find_one(user_id=user_id, type='unmute', order_by='-id')
    mute_reason = mute_entry['reason']
    muter = (await self.bot.fetch_user(mute_entry['mod_id']))
    unmuter = (await self.bot.fetch_user(unmute_entry['mod_id']))
    db.commit()
    db.close()
    member = (await self.bot.fetch_user(user_id))
    message_log = f'''Muted User: {member} ({member.id})

Muted By: {muter} ({muter.id})
Mute Reason: {mute_reason}

Unmuted By: {unmuter} ({unmuter.id})
Unmute Reason: {reason}

'''
    mod_list = set()
    mod_list.add(muter)
    role_staff = discord.utils.get(guild.roles, id=settings.get_value('role_staff'))
    role_trial_mod = discord.utils.get(guild.roles, id=settings.get_value('role_trial_mod'))
    async for message in mute_channel.history(oldest_first=True):
        if (not message.author.bot):
            formatted_time = str(message.created_at).split('.')[(- 2)]
            message_log += f'''[{formatted_time}] {message.author}: {message.content}
'''
            if isinstance(member, discord.Member):
                if ((role_staff in message.author.roles) or (role_trial_mod in message.author.roles)):
                    mod_list.add(message.author)
    url = privatebinapi.send('https://bin.piracy.moe', text=message_log, expiration='never')['full_url']
    time_delta = (datetime.datetime.utcnow() - mute_channel.created_at)
    days = time_delta.days
    (hours, remainder) = divmod(time_delta.seconds, 3600)
    (minutes, seconds) = divmod(remainder, 60)
    elapsed_time = ''
    duration = dict(days=days, hours=hours, minutes=minutes, seconds=seconds)
    for time_unit in duration:
        if (duration[time_unit] == 0):
            continue
        if (duration[time_unit] == 1):
            elapsed_time += f'{duration[time_unit]} {time_unit[:(- 1)]} '
        else:
            elapsed_time += f'{duration[time_unit]} {time_unit} '
    embed = embeds.make_embed(title=f'{mute_channel.name} archived', thumbnail_url='https://i.imgur.com/A4c19BJ.png', color='blurple')
    embed.add_field(name='Muted User:', value=member.mention, inline=True)
    embed.add_field(name='Muted By:', value=muter.mention, inline=True)
    embed.add_field(name='Unmuted By:', value=unmuter.mention, inline=True)
    embed.add_field(name='Mute Reason:', value=mute_reason, inline=False)
    embed.add_field(name='Unmute Reason:', value=reason, inline=False)
    embed.add_field(name='Duration:', value=elapsed_time, inline=False)
    embed.add_field(name='Participating Moderators:', value=' '.join((mod.mention for mod in mod_list)), inline=False)
    embed.add_field(name='Mute Log: ', value=url, inline=False)
    mute_log = discord.utils.get(guild.channels, id=settings.get_value('channel_mute_log'))
    (await mute_log.send(embed=embed))
    (await mute_channel.delete())
async def archive_mute_channel(self, user_id: int, reason: str=None, ctx: SlashContext=None, guild: int=None):
    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
    guild = (guild or ctx.guild)
    category = discord.utils.get(guild.categories, id=settings.get_value('category_tickets'))
    mute_channel = discord.utils.get(category.channels, name=f'mute-{user_id}')
    db = dataset.connect(database.get_db())
    table = db['mod_logs']
    mute_entry = table.find_one(user_id=user_id, type='mute', order_by='-id')
    unmute_entry = table.find_one(user_id=user_id, type='unmute', order_by='-id')
    mute_reason = mute_entry['reason']
    muter = (await self.bot.fetch_user(mute_entry['mod_id']))
    unmuter = (await self.bot.fetch_user(unmute_entry['mod_id']))
    db.commit()
    db.close()
    member = (await self.bot.fetch_user(user_id))
    message_log = f'Muted User: {member} ({member.id})

Muted By: {muter} ({muter.id})
Mute Reason: {mute_reason}

Unmuted By: {unmuter} ({unmuter.id})
Unmute Reason: {reason}

'
    mod_list = set()
    mod_list.add(muter)
    role_staff = discord.utils.get(guild.roles, id=settings.get_value('role_staff'))
    role_trial_mod = discord.utils.get(guild.roles, id=settings.get_value('role_trial_mod'))
    async for message in mute_channel.history(oldest_first=True):
        if (not message.author.bot):
            formatted_time = str(message.created_at).split('.')[(- 2)]
            message_log += f'[{formatted_time}] {message.author}: {message.content}
'
            if isinstance(member, discord.Member):
                if ((role_staff in message.author.roles) or (role_trial_mod in message.author.roles)):
                    mod_list.add(message.author)
    url = privatebinapi.send('https://bin.piracy.moe', text=message_log, expiration='never')['full_url']
    time_delta = (datetime.datetime.utcnow() - mute_channel.created_at)
    days = time_delta.days
    (hours, remainder) = divmod(time_delta.seconds, 3600)
    (minutes, seconds) = divmod(remainder, 60)
    elapsed_time = 
    duration = dict(days=days, hours=hours, minutes=minutes, seconds=seconds)
    for time_unit in duration:
        if (duration[time_unit] == 0):
            continue
        if (duration[time_unit] == 1):
            elapsed_time += f'{duration[time_unit]} {time_unit[:(- 1)]} '
        else:
            elapsed_time += f'{duration[time_unit]} {time_unit} '
    embed = embeds.make_embed(title=f'{mute_channel.name} archived', thumbnail_url='https://i.imgur.com/A4c19BJ.png', color='blurple')
    embed.add_field(name='Muted User:', value=member.mention, inline=True)
    embed.add_field(name='Muted By:', value=muter.mention, inline=True)
    embed.add_field(name='Unmuted By:', value=unmuter.mention, inline=True)
    embed.add_field(name='Mute Reason:', value=mute_reason, inline=False)
    embed.add_field(name='Unmute Reason:', value=reason, inline=False)
    embed.add_field(name='Duration:', value=elapsed_time, inline=False)
    embed.add_field(name='Participating Moderators:', value=' '.join((mod.mention for mod in mod_list)), inline=False)
    embed.add_field(name='Mute Log: ', value=url, inline=False)
    mute_log = discord.utils.get(guild.channels, id=settings.get_value('channel_mute_log'))
    (await mute_log.send(embed=embed))
    (await mute_channel.delete())