mirror of https://github.com/coddrago/Heroku
added: config from HerokuConfig
parent
f4a2d9350a
commit
216c6d2d77
|
@ -31,6 +31,16 @@ class HerokuConfigMod(loader.Module):
|
||||||
|
|
||||||
strings = {"name": "HerokuConfig"}
|
strings = {"name": "HerokuConfig"}
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.config = loader.ModuleConfig(
|
||||||
|
loader.ConfigValue(
|
||||||
|
"cfg_emoji",
|
||||||
|
"🪐",
|
||||||
|
"Change emoji when opening config",
|
||||||
|
validator=loader.validators.String(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prep_value(value: typing.Any) -> typing.Any:
|
def prep_value(value: typing.Any) -> typing.Any:
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
|
@ -968,7 +978,7 @@ class HerokuConfigMod(loader.Module):
|
||||||
async def configcmd(self, message: Message):
|
async def configcmd(self, message: Message):
|
||||||
args = utils.get_args_raw(message)
|
args = utils.get_args_raw(message)
|
||||||
if self.lookup(args) and hasattr(self.lookup(args), "config"):
|
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)
|
mod = self.lookup(args)
|
||||||
if isinstance(mod, loader.Library):
|
if isinstance(mod, loader.Library):
|
||||||
type_ = "library"
|
type_ = "library"
|
||||||
|
|
Loading…
Reference in New Issue