diff --git a/bot/src/cogs/ui_helper.py b/bot/src/cogs/ui_helper.py index d6ba97a..280e9a3 100644 --- a/bot/src/cogs/ui_helper.py +++ b/bot/src/cogs/ui_helper.py @@ -53,12 +53,14 @@ def register_callback(self, callback_name: str, callback: ButtonCallbackFactory) self.callbacks[callback_name] = callback def get_button(self, callback_name: str, callback_args: Collection[Any], **kwargs) -> Button: - button_id = uuid.uuid4().hex + while (button_id := uuid.uuid4().hex) in self.pending: + pass + + self.pending[button_id] = (callback_name, callback_args) + kwargs["custom_id"] = button_id button = Button(**kwargs) - self.pending[button_id] = (callback_name, callback_args) - return button @Cog.listener()