Can we change the chat ID of a telegram bot from Telegram to ID CHAT ?
I want to save more chat IDs in my database.
To extrapolate it, I use this method:
https://api.telegram.org/botXXXXXXXXX:YYYYYYY-YYYYYYYYYYYYYYYYY_YY/getUpdates
Besides this, is every chat ID (for private chat, group and channel) is unique ?
I would to use it like a token.
Is a good idea ?
Chat ID's of groups could change!
It could change if the chat is changed. For example if a group is upgraded to supergroup its chat id will get changed too.
Chat ID's of groups does change!
In my case it happened when the 26th member was added (2nd bot) and got admin rights.
-4242ххххх id changed to -10013430ххххх.
Group had no chat_photo and color of circle sign had been also changed.
Also read here about migrate to supergroup and get old id.
Related
How can i set a auto welcome message and group rules to new joining members to the group.
I saw many videos in Youtube with bots (which are created by others),
Is there any simply way to set a welcome messages with group rules with a facebook link with OWN BOT i mean the Bot which we created
The method getUpdates will give you an array of Updates. If the update is due to a new member entering the chat you will find update.message.new_chat_members which will have an array of Users.
So when you get an update new_chat_members then you can make your bot send any message you want with sendMessage
Check the API documentation here and here.
I'm doing chat app and I want to do it real time. Chat will be for now between two users. When user access to chat it finds all messages between them and displays messages. I think I need to create room with two users and then store room id in database. But I'm new to socket.io and I need advice how to do it.
Try to take some already pretty wide used chat, like Slack, as example. Usually you need pretty same set of things, workplaces, channels, private messages (like room but for two users only), and have users sending text messages with some formatting or images or just any files. Just take it easy, plan and make it step by step.
Also take note, that for both parties have their chat view updated with new messages you need not only save message one user send to db, but also broadcast that message to everyone, involved in conversation.
Like other personal messenger, a user might want to organise chat channels they no longer wish to participate in by leaving the channel.
In Getstream sense, it would be removing the user from the channel's member list.
There does not seem to be a functionality for this.
I have tried to include removeMembers permission to user, however, I am getting an error that members cannot be removed from distinct channels.
You have a couple options to achieve this:
Remove the channel server-side (this makes sense if the conversation
is over for both)
Hide the conversation for one user (see channel.hide). Doing so will hide the conversation for one user until a new message is added.
Is there a way to be able to have a user in a supergroup chat interact with a bot via keyboards (including inline keyboards) without the other supergroup members seeing the interactions?
As it stands in our current build, each user's interactions are showing up in the chat, making for a very cluttered/convoluted chat. Thanks all!
Currently it is not possible to show bot messages to only a specific user. you can use theselective field of ReplyKeyboardMarkup
so the keyboard will only be visible to mentioned users. and you can delete the messages after the interaction is done. but other than this i can't think of any method.
And of course you can use deep linking (to know from which group he is redirected) and redirect the user to a private chat with the bot.
I'm building a chat application and I'd like to get a list of which of the people I'm following are online and what chat rooms they are in.
According to the pusher docs, the presence channels are per channel and
This is not the same as jabber style “which of my friends are online” presence.
Pusher doesn’t offer anything out of the box for that use case right now.
https://pusher.com/docs/client_api_guide/client_presence_channels
So if I were to create this feature on pusher, should I just create a global channel and have everyone connect to that silently in the background to get a global presence - if so there is a 100 person limit to that so it wouldn't be feasible. Or should I just create a single channel per user and then let users subscribe to a channel per each person they are friends with (though that seems a bit inefficient)? Note that this is a one way people I am following relationship and not a 2-way friend relationship.
As you pointed out Presence channels are more for rooms of up to 100 users.
Note: The thinking behind that is that a room with more than that isn't really a chat session. Hopefully this restriction will change in the future and it will increase the use case for presence channels.
To get a count of the number of the users you follow who are online you'll need to ensure each user is subscribed to a user-specific channel (e.g. myUserId-channel or private-myUserId-channel if auth is required) and then query the Pusher HTTP API and check to see if a user-specific channel is occupied. If it is then that user is subscribed to the channel and thus online. See Querying Application Channels.
For a more detailed description see Using presence for large groups of users.