There are two voice channels and you need to broadcast the radio in one, and in the other the music that users want. There is no problem with this, but when the bot connects to the second channel, it leaves the first.
How to connect a bot to two voice channels at once
I am sorry but I think that is not possible. The bot is a user as you are, can you connect to two voice channels at the same time?
Related
I want to be able to have the bot join a channel and server mute itself, and then when I want it to leave later, it should unmute itself.
So first, you need to get your bot guid member, for this do yourVoiceChannel.guild.me, then, you need to mute him, for this is great function guildMember.edit({mute:false/true}). So you need to put this line to place of the code where the bot will join the voice channel: voiceChannel.guild.me.edit({mute:true}). And this line where he leaves: voiceChannel.guild.me.edit({mute:false}). This will have one problem, when the bot will restart, he can be still muted, to solve this put this line of code into ready event: client.guilds.cache.each(guild => guild.me.edit({mute:false})). Also, it will be good idea to check, if the bot has permission to servermute, or use guild.me.voice.setMute(false/true).
Is there a way to receive new messages that are posted in specific Telegram channels in nodejs? I.e. something similar to the twitter streaming api.
There are two or three channels that I am interested in. I want my app, written in nodejs, to get any new messages/updates/pinnedmessages that are posted in these channels (these are channels created by others, not me). My app would then perform a certain action (not on Telegram) if the new messages that were posted in the Telegram channel meet certain conditions.
Is this possible, or does this run contrary to how Telegram works?
I am developing chat application using Pusher. As of now whenever user logs in into his account, he is subscribed to a channel like below:
`var channel = pusher.subscribe('<?='myChannel'.$_SESSION['USERID']?>');`
I would like to update the status in chat list for online/offline so that other users can get to know whether user is online or not. How can I do that?
Normally you would use presence channels for this. These channels have special events which are broadcast to all other subscribers when a members subscribes/unsubscribes from the channel.
It looks like you have a channel per user, so this wouldn't work by simply converting the existing channels to presence channels. Instead you could have a special presence channel in addition to the per-user channels that all users subscribe to. Here you can bind to presence events and update the members list.
Does creating a presence channel automatically show the presence info in the same named non-presence channel e.g.
"presence-chat" shows members of room "chat"
OR
Are these two channels completely un-associated and any associations between them must be maintained manually by the app? And the presence channel is just a type of channel that can be arbitrarily named anything with the prefix "presence-"
So if it is the latter, then in a chat room use case one should subscribe the user to both the chat room channel as well as the presence of the chat room channel, which may or may not be named similarly?
Does creating a presence channel automatically show the presence info in the same named non-presence channel e.g.
"presence-chat" shows members of room "chat"
No, chat is a public channel and doesn't not any presence type data or functionality.
Are these two channels completely un-associated
Correct.
and any associations between them must be maintained manually by the app?
Yes. But I'm not sure why you would want to use both a chat and presence-chat channel. All functionality available on a public channel (chat) is also available on a presence channel (presence-chat).
And the presence channel is just a type of channel that can be arbitrarily named anything with the prefix "presence-"
Correct.
Information on channel types can be found via:
https://pusher.com/docs/client_api_guide/client_channels#channel_types
So if it is the latter, then in a chat room use case one should subscribe the user to both the chat room channel as well as the presence of the chat room channel, which may or may not be named similarly?
As above, presence channels offer all functionality of a public channel. So there's no need to use two channels where one can do everything.
Please let me know if I've missed a reason why you need two use two channel types. If so, I'll update my answer.
I am using PubNub to create a Chat. Each chatroom is a PubNub channel. The challenge now is: how do I sort my channels such that channels with most recent posts should be on top.
I can think on 2 possibilities:
Server will listen to all channels, when a message is received, it logs it. So a chatroom model might look like {id, name, users, lastUpdate}
Everytime message is posted, app will also call server to pass in that message
Both methods doesnt seem to correct? Is there a better way? The first will require the server to listen on all channels. The second will require server to handle a request for each message.
How about using timestamp?
Actually, PubNub offers Presence APIs that lets you monitor the state of each channel, with timestamp (which specified as 17-digit precision unix time).
http://www.pubnub.com/knowledge-base/discussion/276/presence