pincer.objects.app.application   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 30
dl 0
loc 86
rs 10
c 0
b 0
f 0
1
# Copyright Pincer 2021-Present
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
from __future__ import annotations
5
6
from dataclasses import dataclass
7
from typing import TYPE_CHECKING
8
9
from ...utils.api_object import APIObject, GuildProperty
10
from ...utils.types import MISSING
11
12
if TYPE_CHECKING:
13
    from typing import List, Optional
14
15
    from ..user.user import User
16
    from ...utils.types import APINullable
17
    from ...utils.snowflake import Snowflake
18
19
20
@dataclass(repr=False)
21
class Application(APIObject, GuildProperty):
0 ignored issues
show
best-practice introduced by
Too many instance attributes (17/7)
Loading history...
22
    """Represents a Discord application. (e.g. Bot, OAuth)
23
24
    Attributes
25
    ----------
26
    bot_public: :class:`bool`
27
        when false only app owner can join the app's bot to guilds
28
    bot_require_code_grant: :class:`bool`
29
        when true the app's bot will only join upon completion of the
30
        full oauth2 code grant flow
31
    description: :class:`str`
32
        the description of the app
33
    id: :class:`~pincer.utils.snowflake.Snowflake`
34
        the id of the app
35
    icon: Optional[:class:`str`]
36
        the icon hash of the app
37
    name: :class:`str`
38
        the name of the app
39
    privacy_policy_url: APINullable[:class:`str`]
40
        the url of the app's privacy policy
41
    summary: :class:`str`
42
        if this application is a game sold on Discord, this field will be the
43
        summary field for the store page of its primary sku
44
    verify_key: :class:`str`
45
        the hex encoded key for verification in interactions and the GameSDK's
46
        GetTicket
47
    cover_image: APINullable[:class:`str`]
48
        the application's default rich presence invite cover image hash
49
    flags: APINullable[:class:`int`]
50
        the application's public flags'
51
    guild_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`]
52
        if this application is a game sold on Discord, this field will be the
53
        guild to which it has been linked
54
    owner: APINullable[:class:`~pincer.objects.user.user.User`]
55
        partial user object containing info on the owner of the application
56
    primary_sku_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`]
57
        if this application is a game sold on Discord, this field will be the
58
        id of the "Game SKU" that is created, if exists
59
    rpc_origins: APINullable[List[:class:`str`]]
60
        an array of rpc origin urls, if rpc is enabled
61
    slug: APINullable[:class:`str`]
62
        if this application is a game sold on Discord, this field will be the
63
        URL slug that links to the store page
64
    terms_of_service_url: APINullable[:class:`str`]
65
        the url of the app's terms of service
66
    """
67
68
    bot_public: bool
69
    bot_require_code_grant: bool
70
    description: str
71
    id: Snowflake
72
    icon: Optional[str]
73
    name: str
74
    privacy_policy_url: APINullable[str]
75
    summary: str
76
    verify_key: str
77
78
    cover_image: APINullable[str] = MISSING
79
    flags: APINullable[int] = MISSING
80
    guild_id: APINullable[Snowflake] = MISSING
81
    owner: APINullable[User] = MISSING
82
    primary_sku_id: APINullable[Snowflake] = MISSING
83
    rpc_origins: APINullable[List[str]] = MISSING
84
    slug: APINullable[str] = MISSING
85
    terms_of_service_url: APINullable[str] = MISSING
86