This is my code:
bot.on('message', (message) => { //whenever a message is sent
if (message.content.includes('discord.gg/'||'discordapp.com/invite/')) { //if it contains an invite link
message.delete() //delete the message
.then(message.channel.send(`**Hey <@${member.id}>! Don't Share Server Links.**`))
}
})
And I receive the following error:
.then(message.channel.send(`**Hey <@${member.id}>! Sunucu Linki Payla?mamal?s?n.**`))
^
ReferenceError: member is not defined
at Client.<anonymous> (C:UsersulaumOneDriveMasaüstüLeet BOTot.js:18:47)
at Client.emit (node:events:391:22)
at MessageCreateAction.handle (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_modulesdiscord.jssrcclientactionsMessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_modulesdiscord.jssrcclientwebsockethandlersMESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_modulesdiscord.jssrcclientwebsocketWebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_modulesdiscord.jssrcclientwebsocketWebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_modulesdiscord.jssrcclientwebsocketWebSocketShard.js:301:10)
at WebSocket.onMessage (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_moduleswslibevent-target.js:132:16)
at WebSocket.emit (node:events:379:20)
at Receiver.receiverOnMessage (C:UsersulaumOneDriveMasaüstüLeet BOT
ode_moduleswslibwebsocket.js:825:20
question from:
https://stackoverflow.com/questions/65871879/discord-bot-member-is-not-defined 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…