added: config from HerokuConfig

pull/61/head
Who? 2025-01-05 21:34:27 +10:00 committed by GitHub
parent f4a2d9350a
commit 216c6d2d77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

View File

@ -31,6 +31,16 @@ class HerokuConfigMod(loader.Module):
strings = {"name": "HerokuConfig"}
def __init__(self):
self.config = loader.ModuleConfig(
loader.ConfigValue(
"cfg_emoji",
"🪐",
"Change emoji when opening config",
validator=loader.validators.String(),
),
)
@staticmethod
def prep_value(value: typing.Any) -> typing.Any:
if isinstance(value, str):
@ -968,7 +978,7 @@ class HerokuConfigMod(loader.Module):
async def configcmd(self, message: Message):
args = utils.get_args_raw(message)
if self.lookup(args) and hasattr(self.lookup(args), "config"):
form = await self.inline.form("🪐", message, silent=True)
form = await self.inline.form(self.config["cfg_emoji"], message, silent=True)
mod = self.lookup(args)
if isinstance(mod, loader.Library):
type_ = "library"