Passed
Pull Request — main (#281)
by
unknown
02:26
created

pincer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 55
dl 0
loc 78
rs 10
c 0
b 0
f 0
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
<<<<<<< HEAD
0 ignored issues
show
introduced by
invalid syntax (<unknown>, line 27)
Loading history...
28
    RateLimitError, GatewayError, ServerError, EmbedOverflow
29
=======
30
    RateLimitError, GatewayError, ServerError, ImageEncodingError
31
>>>>>>> upstream/main
32
)
33
from .objects import Intents
34
35
__package__ = "pincer"
36
__title__ = "Pincer library"
37
__description__ = "Discord API wrapper rebuild from scratch."
38
__author__ = "Sigmanificient, Arthurdw"
39
__email__ = "[email protected]"
40
__license__ = "MIT"
41
42
ReleaseType = Optional[Literal["alpha", "beta", "candidate", "final", "dev"]]
43
44
45
class VersionInfo(NamedTuple):
46
    """A Class representing the version of the Pincer library."""
47
48
    major: int
49
    minor: int
50
    micro: int
51
52
    release_level: ReleaseType = None
53
    serial: int = 0
54
55
    def __repr__(self) -> str:
56
        return f"{self.major}.{self.minor}.{self.micro}" + (
57
                f"-{self.release_level}{self.serial}"
58
                * (self.release_level is not None)
59
        )
60
61
62
version_info = VersionInfo(0, 13, 0)
63
__version__ = repr(version_info)
64
65
__all__ = (
66
    "BadRequestError", "Bot", "ChatCommandHandler", "Client",
67
    "CogAlreadyExists", "CogError", "CogNotFound", "CommandAlreadyRegistered",
68
    "CommandCooldownError", "CommandDescriptionTooLong", "CommandError",
69
    "CommandIsNotCoroutine", "CommandReturnIsEmpty", "DisallowedIntentsError",
70
    "DispatchError", "EmbedFieldError", "EmbedOverflow", "ForbiddenError",
71
    "GatewayConfig", "GatewayError", "HTTPError", "HeartbeatError", "Intents",
72
    "InvalidArgumentAnnotation", "InvalidCommandGuild", "InvalidCommandName",
73
    "InvalidEventName", "InvalidPayload", "InvalidTokenError",
74
    "InvalidUrlError", "MethodNotAllowedError", "NoCogManagerReturnFound",
75
    "NoExportMethod", "NoValidSetupMethod", "NotFoundError",
76
    "NotModifiedError", "PincerError", "RateLimitError", "ServerError",
77
    "TaskAlreadyRunning", "TaskCancelError", "TaskError", "TaskInvalidDelay",
78
    "TaskIsNotCoroutine", "TooManyArguments", "TooManySetupArguments",
79
    "UnauthorizedError", "UnavailableGuildError", "UnhandledException",
80
    "__author__", "__email__", "__package__", "__title__", "__version__",
81
    "command", "event_middleware", "ImageEncodingError"
82
)
83