matrix-bot/matrix_bot/plugins/_plugin.py

22 lines
477 B
Python
Raw Normal View History

2020-08-06 17:16:43 +02:00
import logging
from nio import AsyncClient
from ..utils import setup_logger
class _Plugin(object):
def __init__(self, bot: any, name: str) -> None:
self.__name = name
self.__bot = bot
self.__client = bot.client
self.__logger = setup_logger(f'{__package__}.{self.__name}')
@property
def logger(self) -> logging.Logger:
return self.__logger
@property
def client(self) -> AsyncClient:
return self.__client