174
rated 0 times
[
178]
[
4]
/ answers: 1 / hits: 15592
/ 7 Years ago, mon, june 26, 2017, 12:00:00
I am trying to create a Discord bot using NodeJS and DiscordJS. However, when I try to use the client.startTyping()
function, referring to https://github.com/hydrabolt/discord.js/issues/440 and http://discordjs.readthedocs.io/en/latest/docs_client.html, it seems to return an error saying the function does not exist. How can I fix this?
https://pastebin.com/S25fiJaZ (full code)
client.startTyping(message.channel);
for (i = 0; i < (times + 1); i++) {
message.channel.sendMessage(msg);
}
client.stopTyping(message.channel);
This is the error:
TypeError: client.startTyping is not a function
at Client.client.on (/home/ty/discordbot/index.js:68:16)
at emitOne (events.js:115:13)
at Client.emit (events.js:210:7)
at MessageCreateHandler.handle (/home/ty/discordbot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/ty/discordbot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:102:65)
at WebSocketConnection.onPacket (/home/ty/discordbot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:325:35)
at WebSocketConnection.onMessage (/home/ty/discordbot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:288:17)
at WebSocket.onMessage (/home/ty/discordbot/node_modules/ws/lib/EventTarget.js:103:16)
at emitTwo (events.js:125:13)
at WebSocket.emit (events.js:213:7)
More From » node.js