mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-26 20:53:01 -05:00
First commit - Bring everything from dev cog minus NSFW support
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import asyncio
|
||||
import contextlib
|
||||
import logging
|
||||
import time
|
||||
|
||||
from enum import Enum, unique
|
||||
from typing import MutableMapping
|
||||
|
||||
@@ -6,6 +10,8 @@ import discord
|
||||
|
||||
from redbot.core import commands
|
||||
|
||||
log = logging.getLogger("red.cogs.Audio.task.callback")
|
||||
|
||||
|
||||
class CacheLevel:
|
||||
__slots__ = ("value",)
|
||||
@@ -205,3 +211,9 @@ class PlaylistScope(Enum):
|
||||
@staticmethod
|
||||
def list():
|
||||
return list(map(lambda c: c.value, PlaylistScope))
|
||||
|
||||
|
||||
def task_callback(task: asyncio.Task) -> None:
|
||||
with contextlib.suppress(asyncio.CancelledError, asyncio.InvalidStateError):
|
||||
if exc := task.exception():
|
||||
log.exception(f"{task.get_name()} raised an Exception", exc_info=exc)
|
||||
|
||||
Reference in New Issue
Block a user