Implement business plans
This commit is contained in:
29
core/commands/base.py
Normal file
29
core/commands/base.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class CommandContext:
|
||||
service: str
|
||||
channel_identifier: str
|
||||
message_id: str
|
||||
user_id: int
|
||||
message_text: str
|
||||
payload: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class CommandResult:
|
||||
ok: bool
|
||||
status: str = "ok"
|
||||
error: str = ""
|
||||
payload: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
class CommandHandler:
|
||||
slug = ""
|
||||
|
||||
async def execute(self, ctx: CommandContext) -> CommandResult:
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user