fix: remove ping emoji when ping is not needed & feat: https://t.me/heroku_talks/4401/20872

pull/75/head
Who? 2025-01-20 15:47:00 +10:00 committed by GitHub
commit e8d5753685
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -976,16 +976,19 @@ class HerokuConfigMod(loader.Module):
@loader.command(alias="cfg")
async def configcmd(self, message: Message):
args = utils.get_args_raw(message)
if self.lookup(args) and hasattr(self.lookup(args), "config"):
args = utils.get_args_raw(message).split()
if self.lookup(args[0]) and hasattr(self.lookup(args[0]), "config"):
form = await self.inline.form(self.config["cfg_emoji"], message, silent=True)
mod = self.lookup(args)
mod = self.lookup(args[0])
if isinstance(mod, loader.Library):
type_ = "library"
else:
type_ = mod.__origin__.startswith("<core")
await self.inline__configure(form, args, obj_type=type_)
if len(args) == 2 and self.lookup(args[0]).config:
await self.inline__configure_option(form, args[0], args[1], obj_type=type_)
else:
await self.inline__configure(form, args[0], obj_type=type_)
return
await self.inline__choose_category(message)

View File

@ -159,7 +159,8 @@ class HerokuInfoMod(loader.Module):
@loader.command()
async def infocmd(self, message: Message):
start = time.perf_counter_ns()
message = await utils.answer(message, self.config["ping_emoji"])
if '{ping}' in self.config["custom_message"]:
message = await utils.answer(message, self.config["ping_emoji"])
await utils.answer_file(
message,