discord - send message to bot from client - discord

I am using discord.js
The scenario is something like this:
User posts something in one of the channel.
Bot replies to this user in a DM with
msg.author.send("I am the bot, and sending you this message as DM")
now, I want user to reply back to this bot in the DM again and i want bot and this user to communicate in the DM.
It seems like I can't achieve the user to send back the message to bot in the same DM.
I am using discord.js
Any idea ?

to dm a person, you must use message.author.send("Your message here.")
but you must have client code.

Related

Finding message IDs in Discord channel

POST https://discord.com/api/webhooks/{webhook.id}/{webhook.token}
I can successfully send messages to the discord channel with this method.
Get Webhook Message
GET/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}
I want to get back the message I sent with this method. But how can I get the messages id automatically?

I'm wondering how this is possible? Discord bot

I recently receive a 2 message in discord with invite link to server I received it from bot who doesn't share the same server with me or anything
How this is possible, I find some py codes but only work if the user and bot share same server
from discord.ext.commands import Bot, Greedy
from discord import User
bot = Bot(command_prefix='!')
#bot.command()
async def pm(ctx, users: Greedy[User], *, message):
for user in users:
await user.send(message)
bot.run("TOKEN")
How can I make one send messages to list of IDs not in same server?
Maybe the bot left the server after he sent the invite to everyone.
You could check if one of the bots was in the servers in the audit-log.
you could either get the user by id with the guild.get_member(id). That requires the user to be on that specific guild you try to get the user.
Or you can use bot.get_user(id) / await bot.fetch_user(id). There the bot tries to get the user. If found you can do sth with it else it will return None or raises the command Error UserNotFound.
A bot that has no mutal guild with a specific user cannot send a dm to them.
Also what purpuse is it to send dms to multiple users from a list?
Keep in mind that its against the Discord TOS to mass dm users without permissions. If they did not opt in sth to get dms I would not send random dms do multiple users.

Is it possible to DM a user from their username from a Discod.js bot

I need a Discord.js bot to DM a user if an API gives it a username. Is it possible to DM a user via a bot?
From the docs: you can search Client.users via Collection.find() by comparing a user's User.tag:
let user = client.users.find(u => u.tag === "someUser#1234");
Then you can send them a DM via User.send():
user.send("A message from a bot");
Note that the bot and said user must at least share a server for the bot to be able to access this user.

Discord API forwarding a message from one webhook to another webhook

I would like to know if it's possible to forward a message received to a one webhook to another webhook
Does Discord messaging API supports this?

Last Message Sent by User Messenger Bot

I'm working with Facebook Messenger Bots and I need a way to make an HTTP Request for the last message sent by the user. All I can find is that Messenger Bots send a web hook with the information but, I specifically need to be able to manually check for the last message sent by the user. Any input would be helpful. Thank you.

Resources