mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Sending initial changes, adding the concept of Handlers, Views, Exceptions and Result, these class will optimaze the code in terms of cleanliness and organizational
This commit is contained in:
20
vulkan/results/AbstractResult.py
Normal file
20
vulkan/results/AbstractResult.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from typing import Union
|
||||
from discord.ext.commands import Context
|
||||
from vulkan.controllers.Exceptions import Error
|
||||
|
||||
|
||||
class AbstractResult:
|
||||
def __init__(self, ctx: Context, success: bool) -> None:
|
||||
self.__success: bool = success
|
||||
self.__ctx: Context = ctx
|
||||
|
||||
@property
|
||||
def ctx(self) -> Context:
|
||||
return self.__ctx
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
return self.__success
|
||||
|
||||
def error(self) -> Union[Error, None]:
|
||||
pass
|
||||
9
vulkan/results/SuccessResult.py
Normal file
9
vulkan/results/SuccessResult.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from vulkan.results import AbstractResult
|
||||
from typing import Union
|
||||
from discord.ext.commands import Context
|
||||
from vulkan.controllers.Exceptions import Error
|
||||
|
||||
|
||||
class SuccessResult(AbstractResult):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
Reference in New Issue
Block a user