First commits for Application Actions™ object
parent
c74e259d61
commit
13ae534e56
|
@ -0,0 +1,23 @@
|
||||||
|
from typing import Any, TypeVar, NewType
|
||||||
|
from enum import Enum
|
||||||
|
import discord
|
||||||
|
|
||||||
|
AT = TypeVar("AT", bound="Action")
|
||||||
|
|
||||||
|
class ActionInteraction(Enum):
|
||||||
|
ACCEPT = "accept"
|
||||||
|
DECLINE = "decline"
|
||||||
|
|
||||||
|
class Action():
|
||||||
|
def __init__(self, action: ActionInteraction):
|
||||||
|
self.set_type = None
|
||||||
|
self.app_result = action
|
||||||
|
|
||||||
|
def add_role(self, role: discord.Role):
|
||||||
|
if self.set_type is None:
|
||||||
|
self.set_type = "add_role"
|
||||||
|
self.add_role_value = role
|
||||||
|
else:
|
||||||
|
raise ValueError("Action object already set type")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue