fix: button close config

pull/101/head
Who? 2025-02-14 23:13:04 +07:00 committed by GitHub
commit f1b1371d59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 13 deletions

View File

@ -63,6 +63,10 @@ class HerokuConfigMod(loader.Module):
return self.prep_value("*" * len(str(value)))
async def dell(self, call):
"""Callback button"""
await call.delete()
def _get_value(self, mod: str, option: str) -> str:
return (
self.prep_value(self.lookup(mod).config[option])
@ -113,7 +117,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
inline_message_id=inline_message_id,
@ -145,7 +149,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
)
@ -265,7 +269,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
],
]
@ -317,7 +321,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
inline_message_id=inline_message_id,
@ -383,7 +387,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
inline_message_id=inline_message_id,
@ -450,7 +454,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
],
]
@ -492,7 +496,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
)
@ -594,7 +598,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
],
]
@ -663,7 +667,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
],
]
@ -827,7 +831,7 @@ class HerokuConfigMod(loader.Module):
"args": (mod,),
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
],
],
)
@ -871,7 +875,7 @@ class HerokuConfigMod(loader.Module):
"callback": self.inline__global_config,
"kwargs": {"obj_type": obj_type},
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
],
)
@ -906,7 +910,7 @@ class HerokuConfigMod(loader.Module):
and any(hasattr(lib, "config") for lib in self.allmodules.libraries)
else []
),
[{"text": self.strings("close_btn"), "action": "close"}],
[{"text": self.strings("close_btn"), "callback": self.dell}],
],
)
@ -963,7 +967,7 @@ class HerokuConfigMod(loader.Module):
"text": self.strings("back_btn"),
"callback": self.inline__choose_category,
},
{"text": self.strings("close_btn"), "action": "close"},
{"text": self.strings("close_btn"), "callback": self.dell},
]
]