get users and chatid groups does my bot belong to - node.js

How can I get information about what groups does my bot belong to. My bot is an admin in 10 channel and I want to get my channel users list and chatId for save to db. How can I do that in nodejs?

Related

Finding a Discord server ID with just a member ID connected to a voice channel

So the discord bot (Discord v12) I'm designing in nodejs has a command that must go through a DM (it's a silent auction bot so the bid messages being sent as bids can't be seen). Since I'm designing the bot to be able to be used on multiple servers I need a way to assign the server ID from the DM message so the bot knows the bid is for that particular server's auction. Since it's a DM I can't pull the server ID from the message itself.
The only way I've thought to accomplish this is by having the members logged into a voice channel of the server, but I can't figure out a way to pull the server ID from the voice channel itself. Is there a way to pull the voice channel ID a member ID is currently logged into and pull the server ID from that?
You can get information regarding a voice channel where the user is logged with the VoiceState object.
You can get it from a member's .voice attribute.

How to add parameters to telegram group invite link and get that parameters using telegram bot in group

I am making a telegram bot using nodeJs for a telegram group management I need to give referral points to a user who invites more users using the invitation link so I was finding a solution to check the new user has joined using which link so I can add points to that user.

Adding a role to a user via DMs

The Discord bot is going to add a role to the user that sent the DM message.
Currently, I have the user's ID and I have the role ID. I don't know what steps I need to take in order to add the role to the user.
The messages are in a DM so I went and did this:
let userId = message.author;
somethingHere.addRole('roleId#');
What is that missing piece before the .addRole that I need?
.addRole is a method of GuildMember, so in order to use it you need to get the member object of that user (otherwise the bot couldn't know in which guild it should do it.)
If you have only one guild stored somewhere, you can do <Guild>.member(message.author).addRole('role id'), otherwise you'll need a way to figure out which guild they want the role in.

Retrieve invited users with Telegram Bot API

I have a Telegram channel and a Telegram bot using Node.js and PSQL. With a command (for example /how), I need to return to the user the number of user which has been invited to the channel by this user (and has joined).
How can I retrieve this list of users ?
If by "invited" you mean users who sent others a link to the channel then Telegram API does not provide such functionality.
However, channel administrators can add users to the channel and those should be sent as regular Message updates with new_chat_members field set, all you have to do is log those updates to the database and then fetch it with your command.

How to check a member joined to channel via bot?

I want to send a link to a channel by a bot for join to another channel and check who is joined with this link
You should set your bot as administrator of this two channels then call this function:
getChatMember("#channelusername", "user_id")
which #channel_username is the second channel username and user_id is the user_id of the person who joined the second channel. But notice that you need user_id of the person who joined to the channel, usually this is done by a bot. When user comes to the bot, your bot will have his username so you have his user_id and you can use getChatMember function.

Resources