-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) Passing context #351
Conversation
Perhaps an implementation with a modification of the "message_text" function would be more universal, which would unpack the command and the Prompt, but for the sake of such a function I think there is no point in modifying it |
Hey @stanislavlysenko0912, apologies for the super late reply! Thanks for opening this, just checked and I think the fix could be made even simpler. I've commented the suggestion, let me know! |
I'm sorry I answered the wrong place, just in the thread) I could take the time to look for another way to implement, if you want - but so far nothing comes to mind :D Wait a bit, I'll look into it tomorrow. |
Huh? Sorry I don't get it, did you answer somewhere else?
Nothing wrong with your original PR, but could you check out the fix I suggested in the review above? It's basically this: if prompt.lower().startswith(trigger_keyword.lower()) or update.message.text.lower().startswith('/chat'):
if prompt.lower().startswith(trigger_keyword.lower()):
prompt = prompt[len(trigger_keyword):].strip() instead of: raw_text = update.message.text.lower()
prompt_lower = prompt.lower()
if raw_text.startswith('/chat') or prompt_lower.startswith(trigger_keyword):
if not prompt_lower.startswith(trigger_keyword):
prompt = f'{trigger_keyword} {prompt}' |
Thanks @stanislavlysenko0912! |
Issue #348
Added the feature for the bot to see the context when used: