1
|
|
|
""" |
2
|
|
|
Pincer library |
3
|
|
|
==================== |
4
|
|
|
An asynchronous python API wrapper meant to replace discord.py |
5
|
|
|
|
6
|
|
|
Copyright Pincer 2021 |
7
|
|
|
Full MIT License can be found in `LICENSE` at the project root. |
8
|
|
|
""" |
9
|
|
|
|
10
|
|
|
from typing import NamedTuple, Literal, Optional |
11
|
|
|
|
12
|
|
|
from ._config import GatewayConfig |
13
|
|
|
from .client import event_middleware, Client, Bot |
14
|
|
|
from .commands import command, ChatCommandHandler |
15
|
|
|
from .exceptions import ( |
16
|
|
|
PincerError, InvalidPayload, UnhandledException, NoExportMethod, |
17
|
|
|
CogError, CogNotFound, CogAlreadyExists, NoValidSetupMethod, |
18
|
|
|
TooManySetupArguments, NoCogManagerReturnFound, CommandError, |
19
|
|
|
CommandCooldownError, CommandIsNotCoroutine, CommandAlreadyRegistered, |
20
|
|
|
CommandDescriptionTooLong, TooManyArguments, InvalidArgumentAnnotation, |
21
|
|
|
CommandReturnIsEmpty, InvalidCommandGuild, InvalidCommandName, |
22
|
|
|
InvalidEventName, InvalidUrlError, EmbedFieldError, TaskError, |
23
|
|
|
TaskAlreadyRunning, TaskCancelError, TaskIsNotCoroutine, TaskInvalidDelay, |
24
|
|
|
DispatchError, DisallowedIntentsError, InvalidTokenError, HeartbeatError, |
25
|
|
|
UnavailableGuildError, HTTPError, NotModifiedError, BadRequestError, |
26
|
|
|
UnauthorizedError, ForbiddenError, NotFoundError, MethodNotAllowedError, |
27
|
|
|
RateLimitError, GatewayError, ServerError, EmbedOverflow, ImageEncodingError |
28
|
|
|
) |
29
|
|
|
from .objects import Intents |
30
|
|
|
|
31
|
|
|
__package__ = "pincer" |
32
|
|
|
__title__ = "Pincer library" |
33
|
|
|
__description__ = "Discord API wrapper rebuild from scratch." |
34
|
|
|
__author__ = "Sigmanificient, Arthurdw" |
35
|
|
|
__email__ = "[email protected]" |
36
|
|
|
__license__ = "MIT" |
37
|
|
|
|
38
|
|
|
ReleaseType = Optional[Literal["alpha", "beta", "candidate", "final", "dev"]] |
39
|
|
|
|
40
|
|
|
|
41
|
|
|
class VersionInfo(NamedTuple): |
42
|
|
|
"""A Class representing the version of the Pincer library.""" |
43
|
|
|
|
44
|
|
|
major: int |
45
|
|
|
minor: int |
46
|
|
|
micro: int |
47
|
|
|
|
48
|
|
|
release_level: ReleaseType = None |
49
|
|
|
serial: int = 0 |
50
|
|
|
|
51
|
|
|
def __repr__(self) -> str: |
52
|
|
|
return f"{self.major}.{self.minor}.{self.micro}" + ( |
53
|
|
|
f"-{self.release_level}{self.serial}" |
|
|
|
|
54
|
|
|
* (self.release_level is not None) |
|
|
|
|
55
|
|
|
) |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
version_info = VersionInfo(0, 13, 0) |
59
|
|
|
__version__ = repr(version_info) |
60
|
|
|
|
61
|
|
|
__all__ = ( |
62
|
|
|
"BadRequestError", "Bot", "ChatCommandHandler", "Client", |
63
|
|
|
"CogAlreadyExists", "CogError", "CogNotFound", "CommandAlreadyRegistered", |
64
|
|
|
"CommandCooldownError", "CommandDescriptionTooLong", "CommandError", |
65
|
|
|
"CommandIsNotCoroutine", "CommandReturnIsEmpty", "DisallowedIntentsError", |
66
|
|
|
"DispatchError", "EmbedFieldError", "EmbedOverflow", "ForbiddenError", |
67
|
|
|
"GatewayConfig", "GatewayError", "HTTPError", "HeartbeatError", |
68
|
|
|
"ImageEncodingError", "Intents", "InvalidArgumentAnnotation", |
69
|
|
|
"InvalidCommandGuild", "InvalidCommandName", "InvalidEventName", |
70
|
|
|
"InvalidPayload", "InvalidTokenError", "InvalidUrlError", |
71
|
|
|
"MethodNotAllowedError", "NoCogManagerReturnFound", "NoExportMethod", |
72
|
|
|
"NoValidSetupMethod", "NotFoundError", "NotModifiedError", "PincerError", |
73
|
|
|
"RateLimitError", "ServerError", "TaskAlreadyRunning", "TaskCancelError", |
74
|
|
|
"TaskError", "TaskInvalidDelay", "TaskIsNotCoroutine", "TooManyArguments", |
75
|
|
|
"TooManySetupArguments", "UnauthorizedError", "UnavailableGuildError", |
76
|
|
|
"UnhandledException", "__author__", "__email__", "__package__", |
77
|
|
|
"__title__", "__version__", "command", "event_middleware" |
78
|
|
|
) |
79
|
|
|
|