-
Notifications
You must be signed in to change notification settings - Fork 0
Send /cleanup response to private user chat instead of current chat. #11
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
Conversation
So wait, this removes user message for example user calls |
Exactly. Alternatively, it's obviously also possible to just modify the first command message sent, to the notification message being sent to the private chat, instead of deleting it completely. |
@noplanman Well, I would say it's fine, what's the problem with channel? I don't think bot is supposed to execute commands from messages posted in channels |
Ah right, of course. So we just completely ignore those then? |
@noplanman As far as I'm understanding the API there is no way to send normal update with message object to the channel? There is channel_post one but we don't use it for handling commands and thats ok. Should I go on and merge? |
Yes, we'd have to use Strangely though, the command's execute method does get called via channel message. Shall we create a separate PR for the |
Yeah. |
Ok, have made the other PR here: php-telegram-bot#580 When that's merged, we can simply add the parameter to this command, and voilà 👍 |
Alrighty then, have merged and added I think we're ready for this merge too. Hmm, thinking about this, it would make sense to set |
Yep, making it default for admin commands makes sense! |
Alrighty, have dropped the last commit (with |
Added a new parameter to the
Command
class called$private_only
.Setting that to true and calling the respective command in a public chat does the following:
It would also be possible to simply overwrite the Update object to act as if the command was called from a private chat in the first place, but that might be pushing it.
What do you think?
Also, I haven't managed to get this to work for channels, not quite sure why, but the command doesn't have a message object in it, weirdly 😕