33 lines
649 B
Python
33 lines
649 B
Python
from typing import List, Dict
|
|
|
|
|
|
class Module:
|
|
PREFIX = []
|
|
NAME = ""
|
|
|
|
def __init__(self, client: "Frank", config: Dict = None):
|
|
self._client = client
|
|
self._config = config
|
|
|
|
async def start(self):
|
|
pass
|
|
|
|
async def command(self, cmd: List[str]):
|
|
pass
|
|
|
|
@classmethod
|
|
def match(cls, s: str) -> bool:
|
|
"""
|
|
Checks wether the given string is a prefix in the module.
|
|
"""
|
|
|
|
if cls.PREFIX:
|
|
if isinstance(cls.PREFIX, list):
|
|
return s in cls.PREFIX
|
|
|
|
else:
|
|
return s == cls.PREFIX
|
|
|
|
else:
|
|
return False
|