# Buggy code
async def notify_user(
    self,
    current: int = None,
    total: int = None,
    key: str = None,
    seconds_key: str = None,
    seconds: str = None,
):
    """This updates an existing message.

    Based on the message found in :variable:`Notifier.updates` as per the `key` param
    """
    if self.last_msg_time + self.cooldown > time.time() and not current == total:
        return
    if self.color is None:
        self.color = await self.context.embed_colour()
    embed2 = discord.Embed(
        colour=self.color,
        title=self.updates.get(key).format(num=current, total=total, seconds=seconds),
    )
    if seconds and seconds_key:
        embed2.set_footer(text=self.updates.get(seconds_key).format(seconds=seconds))
    try:
        await self.message.edit(embed=embed2)
        self.last_msg_time = time.time()
    except discord.errors.NotFound:
        pass


# Traceback (AttributeError)
Traceback (most recent call last):
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/audio.py", line 4937, in _playlist_list
playlists = await get_all_playlist(scope, self.bot, guild, author, specified_user)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 475, in get_all_playlist
scope_standard, scope_id = _prepare_config_scope(scope, author, guild)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 86, in _prepare_config_scope
scope = standardize_scope(scope)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 62, in standardize_scope
scope = scope.upper()
AttributeError: 'NoneType' object has no attribute 'upper'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 799, in invoke
await super().invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1234, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'upper'

# Fixed code
async def notify_user(
    self,
    current: int = None,
    total: int = None,
    key: str = None,
    seconds_key: str = None,
    seconds: str = None,
):
    """This updates an existing message.

    Based on the message found in :variable:`Notifier.updates` as per the `key` param
    """
    if self.last_msg_time + self.cooldown > time.time() and not current == total:
        return
    if self.color is None:
        self.color = await self.context.embed_colour()
    embed2 = discord.Embed(
        colour=self.color,
        title=self.updates.get(key, "").format(
            num=current, total=total, seconds=seconds
        ),
    )
    if seconds and seconds_key:
        embed2.set_footer(
            text=self.updates.get(seconds_key, "").format(seconds=seconds)
        )
    try:
        await self.message.edit(embed=embed2)
        self.last_msg_time = int(time.time())
    except discord.errors.NotFound:
        pass