I was trying to make a ping command for my bot here is my Code
client.on('message', message => {
if (message.content === '+ping') {
message.channel.send(`??Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`);
}
});
However I end up getting the following error
C:UsersujjwaDesktopAll DiscTest allindex.js:236
message.channel.send(`??Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`);
^
ReferenceError: m is not defined
at Client.<anonymous> (C:UserslolDesktopAll DiscTest allindex.js:236:42)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:UserslolDesktopAll DiscTest all
ode_modulesdiscord.jssrcclientactionsMessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:UserslolDesktopAll DiscTest all
ode_modulesdiscord.jssrcclientwebsockethandlersMESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:UserslolDesktopAll DiscTest all
ode_modulesdiscord.jssrcclientwebsocketWebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:UserslolDesktopAll DiscTest all
ode_modulesdiscord.jssrcclientwebsocketWebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:UserslolDesktopAll DiscTest all
ode_modulesdiscord.jssrcclientwebsocketWebSocketShard.js:293:10)
at WebSocket.onMessage (C:UserslolDesktopAll DiscTest all
ode_moduleswslibevent-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:UserslolDesktopAll DiscTest all
ode_moduleswslibwebsocket.js:797:20)
Can you help me out?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…