Closed FReichelt closed 3 years ago
The error isn't from the args it's from the Bot.say(user["username"]);
Hi, TepixxBot is now online!
[12:21] info: [#unknownfllooo] <unknownfllooo>: s
1
2
3
4
5
Waiting for the debugger to disconnect...
Debugger listening on ws://127.0.0.1:53689/3bb9745e-d87d-43ea-a6d7-116dae305c1C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\commands.js:361
if ((message.startsWith(".") && !message.startsWith("..")) || message.startsWith("/") || message.startsWith("\\")) {
^
TypeError: Cannot read property 'startsWith' of undefined
at client.say (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\commands.js:361:22)
at client.<anonymous> (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\index.js:92:13)
at client.EventEmitter.emit (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\events.js:101:25)
at client.EventEmitter.emits (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\events.js:64:19)
at client.handleMessage (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\client.js:1003:34)
at C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\client.js:1080:36
at Array.forEach (<anonymous>)
at client._onMessage (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\lib\client.js:1079:11)
at WebSocket.onMessage (C:\Users\FVKR\OneDrive\Desktop\Tepixx Bot\node_modules\tmi.js\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:314:20)
3
So now i fixed it so i will close this error
The say
method requires a channel and then message.
client.on('message', (channel, tags, message, self) => {
if(self) return;
client.say(channel, `@${tags.username} Hello`);
});
Actual behaviour: Crashes with an error of tmi.js
Expected behaviour: Should just get the args.
Error log:
Code
Server configuration