mirror of
https://github.com/maubot/maubot
synced 2025-08-30 21:20:38 +00:00
Add more stuff
This commit is contained in:
parent
8e2f2908a6
commit
7816212190
16 changed files with 677 additions and 63 deletions
28
maubot/cli/res/plugin.py.j2
Normal file
28
maubot/cli/res/plugin.py.j2
Normal file
|
@ -0,0 +1,28 @@
|
|||
from maubot import Plugin
|
||||
{% if config %}
|
||||
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
|
||||
|
||||
class Config(BaseProxyConfig):
|
||||
def do_update(self, helper: ConfigUpdateHelper) -> None:
|
||||
helper.copy("example_1")
|
||||
helper.copy("example_2.list")
|
||||
helper.copy("example_2.value")
|
||||
{% endif %}
|
||||
|
||||
class {{ name }}:
|
||||
async def start() -> None:
|
||||
{% if config %}
|
||||
self.config.load_and_update()
|
||||
self.log.debug("Loaded %s from config example 2", self.config["example_2.value"])
|
||||
{% else %}
|
||||
pass
|
||||
{% endif %}
|
||||
|
||||
async def stop() -> None:
|
||||
pass
|
||||
|
||||
{% if config %}
|
||||
@classmethod
|
||||
def get_config_class(cls) -> Type[BaseProxyConfig]:
|
||||
return Config
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue