Add Cloudron packaging for Maubot

This commit is contained in:
Your Name
2025-11-13 21:00:23 -06:00
commit 1af2e64aae
179 changed files with 24749 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# Who is allowed to use the bot?
whitelist:
- "@user:example.com"
# The prefix for the main command without the !
command_prefix: hello-world

View File

@@ -0,0 +1,27 @@
from typing import Type
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
from maubot import Plugin, MessageEvent
from maubot.handlers import command
class Config(BaseProxyConfig):
def do_update(self, helper: ConfigUpdateHelper) -> None:
helper.copy("whitelist")
helper.copy("command_prefix")
class ConfigurableBot(Plugin):
async def start(self) -> None:
self.config.load_and_update()
def get_command_name(self) -> str:
return self.config["command_prefix"]
@command.new(name=get_command_name)
async def hmm(self, evt: MessageEvent) -> None:
if evt.sender in self.config["whitelist"]:
await evt.reply("You're whitelisted 🎉")
@classmethod
def get_config_class(cls) -> Type[BaseProxyConfig]:
return Config

View File

@@ -0,0 +1,13 @@
maubot: 0.1.0
id: xyz.maubot.configurablebot
version: 2.0.0
license: MIT
modules:
- configurablebot
main_class: ConfigurableBot
database: false
config: true
# Instruct the build tool to include the base config.
extra_files:
- base-config.yaml