diff --git a/pomice/utils.py b/pomice/utils.py index a8be0b2..b1b70ec 100644 --- a/pomice/utils.py +++ b/pomice/utils.py @@ -20,7 +20,10 @@ DEALINGS IN THE SOFTWARE. import random import time -from typing import Union +from typing import ( + Union, + Any, +) from discord import AutoShardedClient, Client from discord.ext.commands import AutoShardedBot, Bot @@ -28,7 +31,8 @@ from discord.ext.commands import AutoShardedBot, Bot __all__ = [ 'ExponentialBackoff', 'NodeStats', - 'ClientType' + 'ClientType', + 'MISSING' ] ClientType = Union[AutoShardedBot, AutoShardedClient, Bot, Client] @@ -85,3 +89,13 @@ class NodeStats: def __repr__(self) -> str: return f'' + +class _MissingSentinel: + def __repr__(self) -> str: + return "MISSING" + + def __bool__(self) -> bool: + return False + + +MISSING: Any = _MissingSentinel()