Passed
Pull Request — main (#253)
by
unknown
02:29
created

Mentionable.is_role()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 1
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 dataclasses import dataclass
5
from typing import Optional
6
7
8
from ...objects.guild.role import Role
9
from ...objects.user.user import User
10
11
12
@dataclass
13
class Mentionable:
14
    """
15
    Represents the Mentionable type
16
17
    user : Optional[:class:`~pincer.objects.user.user.User`]
18
        User object returned from a discord interaction
19
    role: Optional[:class:`~pincer.objects.guild.role.Role`]
20
        Role object returned from a discord interaction
21
    """
22
    user: Optional[User] = None
23
    role: Optional[Role] = None
24
25
    @property
26
    def is_user(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
27
        return self.user is not None
28
29
    @property
30
    def is_role(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
31
        return self.role is not None
32