mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 18:33:02 +00:00
Add utils.MISSING
This commit is contained in:
@ -28,7 +28,6 @@ import contextvars
|
||||
import logging
|
||||
import asyncio
|
||||
import json
|
||||
import time
|
||||
import re
|
||||
|
||||
from urllib.parse import quote as urlquote
|
||||
@ -67,16 +66,7 @@ if TYPE_CHECKING:
|
||||
from ..abc import Snowflake
|
||||
import datetime
|
||||
|
||||
|
||||
class _Missing:
|
||||
def __bool__(self):
|
||||
return False
|
||||
|
||||
def __repr__(self):
|
||||
return '...'
|
||||
|
||||
|
||||
MISSING: Any = _Missing()
|
||||
MISSING = utils.MISSING
|
||||
|
||||
|
||||
class AsyncDeferredLock:
|
||||
@ -731,6 +721,7 @@ class BaseWebhook(Hashable):
|
||||
return Asset._from_default_avatar(self._state, 0)
|
||||
return Asset._from_avatar(self._state, self.id, self._avatar)
|
||||
|
||||
|
||||
class Webhook(BaseWebhook):
|
||||
"""Represents an asynchronous Discord webhook.
|
||||
|
||||
|
@ -45,7 +45,7 @@ from ..message import Message
|
||||
from ..http import Route
|
||||
from ..object import Object
|
||||
|
||||
from .async_ import BaseWebhook, handle_message_parameters, _WebhookState, MISSING
|
||||
from .async_ import BaseWebhook, handle_message_parameters, _WebhookState
|
||||
|
||||
__all__ = (
|
||||
'SyncWebhook',
|
||||
@ -68,6 +68,8 @@ if TYPE_CHECKING:
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
||||
MISSING = utils.MISSING
|
||||
|
||||
|
||||
class DeferredLock:
|
||||
def __init__(self, lock: threading.Lock):
|
||||
@ -333,6 +335,7 @@ class WebhookAdapter:
|
||||
route = Route('GET', '/webhooks/{webhook_id}/{webhook_token}', webhook_id=webhook_id, webhook_token=token)
|
||||
return self.request(route, session=session)
|
||||
|
||||
|
||||
_context = threading.local()
|
||||
_context.adapter = WebhookAdapter()
|
||||
|
||||
|
Reference in New Issue
Block a user