diff --git a/src/components/chat/input.ts b/src/components/chat/input.ts index ed4c433c2..83306f073 100644 --- a/src/components/chat/input.ts +++ b/src/components/chat/input.ts @@ -1337,8 +1337,12 @@ export default class ChatInput { private updateBotCommandsToggle(skipAnimation?: boolean) { const {botCommandsToggle, hasBotCommands} = this; - const show = hasBotCommands && this.isInputEmpty(); + const show = !!hasBotCommands && this.isInputEmpty(); if(!hasBotCommands) { + if(!botCommandsToggle.parentElement) { + return; + } + botCommandsToggle.remove(); }