Praxis_Bot/channel_points/channelPoints_base.py
2021-04-25 20:59:28 -04:00

54 lines
1.7 KiB
Python

from abc import ABCMeta, abstractmethod
from enum import Enum, auto
class AbstractChannelPoints(metaclass=ABCMeta):
"""
This is the base class for channel points. In order to load a channel point redemption a few conditions must be met:
1) The class name MUST begin with 'ChannelPoint' i.e. CommandTTS, CommandBan, etc...
2) the class MUST extend AbstractCommand
Generally, it would be advisable to define the ChannelPointPrize redemption name as a variable of the
class and to then call super().__init__(command)
"""
class ChannelPointsType(Enum):
NONE = auto()
Ver2 = auto()
class ChannelPointsSource(Enum):
default = 0
Praxis = 1
Twitch = 2
Discord = 3
def __init__(self, ChannelPointRewardName: str, n_args: int = 0, channelPointReward_type=ChannelPointsType.NONE, helpText:list=["No Help"], isChannelPointRewardEnabled = True):
self.ChannelPointRewardName = ChannelPointRewardName
self.n_args = n_args
self.ChannelPointRewardType = channelPointReward_type
self.help = helpText
self.isChannelPointRewardEnabled = isChannelPointRewardEnabled
# no touch!
def get_args(self, text: str) -> list:
return text.split(" ")[0:self.n_args + 1]
# no touch!
def get_ChannelPointRewardName(self) -> str:
return self.ChannelPointRewardName
# no touch!
def get_ChannelPointRewardType(self):
return self.ChannelPointRewardType
# no touch!
def get_help(self):
return self.help
# no touch!
def is_ChannelPointReward_enabled(self):
return self.isChannelPointRewardEnabled
@abstractmethod
def do_ChannelPointReward(self, bot, user, command, rest, bonusData):
pass