not working? | Discord.js V14 - discord.js

I resurrected a bot I had from a while ago but can get it to read Dm responses in Discordjs V14.
I have DirectMessages intents specified, It will send the Question via DM but not react to a response.
await appChannel.send('Name?');
let answer1 = await appChannel.awaitMessages(answer1 => !=, { max: 1 });
const name = ( => answers.content).join());
I Have a series of questions that then get posted to a discord channel using MessageEmbed()


Discord JS - If user sends DM to bot with specific string

The code below works and send a DM to the user when he/she reacts to a message.
The goal is then to add a role - or do something - if the user replies with the correct string.
if ( === theDoor) {
await reaction.message.guild.members.cache.get(;
const reactUser = await reaction.message.guild.members.cache.get(;
reactUser.send('Enter the code. Hint: *Yumi Zouma*.');
} else {
How can I make the bot handle DM from other users? Google seems to only provide how to send a DM to a user.
What you need to use then is a Message Collector.
For example,
const dm = await reactUser.send("Enter code")
const collector ={filter, max: 5, time: 30000}); //We're creating the collector, allowing for a max of 5 messages or 30 seconds runtime.
collector.on('collect', m => {
collector.on('end', (collected, reason) => {
await{content: `Collector ended for reason: ${reason} reached! I collected ${collected.size} messages.`})

How can send DM for unban command used user?

I'm developing an unban command for a ban command.
When the ban is lifted, I want the embed message unbanEmbeduserside to be sent to the banned user via private message. This embed message will let the banned user know about it.
The codes for my unban command are as follows. Thanks in advance to my friends who will help me with how to write a code so that I can perform the operation I mentioned in the above article.
async run (bot, message, args) {
if (!message.member.hasPermission("BAN_MEMBERS"))
return"Buna yetkin yok.")
let unbanEmbednotfoundmessage = new discord.MessageEmbed()
.setDescription(`Kullanıcı bulunamadı veya yasaklı değil.`);
let userID = args[0]
message.guild.fetchBans().then(bans => {
if(bans.size == 0) return;
let bUser = bans.find(b => == userID)
if(!bUser) return
let unbanEmbeduserside = new discord.MessageEmbed()
*Yasaklamanız kaldırıldı, sunucuya tekrar katılabilirsiniz!*
Yasaklamayı Kaldıran Yetkili: **${}**
.setFooter('gtaplus Multiplayer Community');
let unbanEmbedserverside = new discord.MessageEmbed()
.setAuthor('YASAKLAMA KALDIRMA', '')
Yasağı Kaldırılan Kullanıcı: **${userID}**
Yasaklamayı Kaldıran Yetkili: **${}**
.setFooter('gtaplus Multiplayer Community');
message.guild.members.unban(bUser.user).then(() =>`**${userID}** yasaklaması kaldırıldı.`));
if (unbanEmbedserverside){
const log = message.guild.channels.cache.find(channel => === 'server-log')
In Discord, any user, including a bot, will need to be in a server with a user to send them direct messages. This, unfortunately, means that unless the bot shares a server with the banned user, you will not be able to send the message. If the bot does share another server, the answer that Skularun Mrusal provided in the comments of your post should work.

Bot comes online but the embed won't post on discord

i'm new to programming and started making a discord bot by watching a few tutorials. I want the bot to DM the discord embed to the user who types "-buy" in a text channel. When running the code, the bot comes online and runs the "your bot name is online!" but no DM is sent. I would greatly appreciate any help. Thanks
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '-';
client.once('ready', () => {
console.log('your bot name is online!');
client.on('message', message =>{
if( return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLocaleLowerCase();
if(command === 'buy'){
const testEmbed = new Discord.MessageEmbed()
.setTitle('test embeddy')
.setDescription('test description woo')
.setFooter('this is the footer')
try {;
} catch {
message.reply('Sorry I cannot message you! Check if your DMs are public!')
the token isn't the problem, i deleted it so i could upload here
The returns the bot client, and it doesn't return a boolean. So your bot is blocked from there. Try removing that code and write that returns a boolean if the message author is a bot user. It will work.

How i can make a discord bot in specific channel delete and resends msg

How i can make a discord bot in specific channel and who ever write delete that message and resend it ?
Assuming you want the bot to resend any message as the bot in a specific channel here's an example using Discord.js
If I misunderstood and you want the bot to send a message as a specific user, that's not possible.
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('message', msg => {
if ( === 'channel name') {

Send is not a function discord.js

I am trying to send a message to channel but I keep getting Error: send is not a function.I have been stuck on this problem for over an hour.
What I have tried:
using sendMessage
tried reading the discord.js documentation but it doesnt seem to be working at all.
Here is my code:
//Grab the Discord Library
const Discord = require("discord.js");
//What will connect to the server.
const bot = new Discord.Client();
bot.on('ready', () => {
console.log("Connected as " + bot.user.tag)
//Shows and set the activity of the user.
bot.user.setActivity("El Professor build me", {type: "Watching"})
//Inform you of the servers this bot is connected to.
bot.guilds.forEach((guild) => {
guild.channels.forEach((channel) => {
console.log(` - ${} ${channel.type} ${}`)
//Voice Channel ID =
var generalChannel = bot.channels.get("123456789").send("Hello World")
Error message:
var generalChannel = bot.channels.get("123456789").send("Hello World")
TypeError: bot.channels.get(...).send is not a function
at (C:\Users\F4_ALFA\documents\FirstDiscordBot\index.js:21:63)
at Client.emit (events.js:194:15)
at WebSocketConnection.triggerReady (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\WebSocketConn
at WebSocketConnection.checkIfReady (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\WebSocketConn
at GuildCreateHandler.handle (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\packets\handlers\Gui
at WebSocketPacketManager.handle (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\packets\WebSocke
at WebSocketConnection.onPacket (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\WebSocketConnecti
at WebSocketConnection.onMessage (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\discord.js\src\client\websocket\WebSocketConnect
at WebSocket.onMessage (C:\Users\F4_ALFA\documents\FirstDiscordBot\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:189:13)
Discord.js uses cache and your code has no '.cache', you should try
bot.channels.cache.get('id').send('Hello world!')
The channels property returns a Collection with pair of ID and Channel object.
The Channel class could represent any channel in discord. You couldn't send any messages through it because it doesn't have send() method.
I’ve used this before client.guilds.find(x => === "ChatLogs").channels.find(y => === "server-testing1").send(botEmbed) try that