carbowix / cleve Goto Github PK
View Code? Open in Web Editor NEWDiscord clever chatbot powered by brainshop.ai
License: MIT License
Discord clever chatbot powered by brainshop.ai
License: MIT License
reason: Unexpected token S in JSON at position 0
at /home/runner/Chatbot/node_modules/node-fetch/lib/index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Any help will be appreciated.
Here is my config:
{
"bot_token": "xxxx",
"status": {
"state": "online",
"type": "Playing",
"name": "Chat with me!"
},
"chat": {
"url": "http://api.brainshop.ai/get",
"brainID": "xxxxxx",
"key": "xxxxxxxxxxx",
"channel": ""
}
}
the bot started and online really well, but not responding the chat at all. i did everything and re read the readme carefully but seems like nothing wrong w me, can anyone help?
error when sending a message in any channel, used fresh install with npm. discord shows as typing for a second then no response.
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
<rejected> RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
at Function.verifyString (/home/pi/node_modules/discord.js/src/util/Util.js:414:49)
at MessagePayload.makeContent (/home/pi/node_modules/discord.js/src/structures/MessagePayload.js:113:22)
at MessagePayload.resolveData (/home/pi/node_modules/discord.js/src/structures/MessagePayload.js:128:26)
at TextChannel.send (/home/pi/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:165:32)
at Message.reply (/home/pi/node_modules/discord.js/src/structures/Message.js:743:25)
at Object.handleTalk (/home/pi/node_modules/clevy/util.js:34:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
}
} reason: Message content must be a non-empty string.
when i try to run, i get this error:
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
HTTPError [ReferenceError]: AbortController is not defined
at RequestHandler.execute (C:\Users\Liam\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
at RequestHandler.execute (C:\Users\Liam\node_modules\discord.js\src\rest\RequestHandler.js:176:19)
at RequestHandler.push (C:\Users\Liam\node_modules\discord.js\src\rest\RequestHandler.js:50:25)
at async WebSocketManager.connect (C:\Users\Liam\node_modules\discord.js\src\client\websocket\WebSocketManager.js:128:9)
at async Client.login (C:\Users\Liam\node_modules\discord.js\src\client\Client.js:245:7) {
code: 500,
method: 'get',
path: '/gateway/bot',
requestData: { json: undefined, files: [] }
}
} reason: AbortController is not defined
how can i edit the code so that you dont have to ping the bot? so it will always listen to a specific channel without pinging the bot.
pls show me how to do that @Carbowix
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
at Function.verifyString (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\util\Util.js:414:49)
at MessagePayload.makeContent (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\MessagePayload.js:113:22)
at MessagePayload.resolveData (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\MessagePayload.js:128:26)
at TextChannel.send (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:165:32)
at Message.reply (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\Message.js:743:25)
at Object.handleTalk (C:\Users\piggy\Desktop\bot\util.js:34:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
}
} reason: Message content must be a non-empty string.
root@mail:/home/botd# node index.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'node:events'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/botd/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
/home/runner/test/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
Hint: hit control+c anytime to enter REPL.
îș§
it doesnt send any message
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
<rejected> RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
at Function.verifyString (/data/data/com.termux/files/home/Cleve/node_modules/discord.js/src/util/Util.js:414:49) at MessagePayload.makeContent (/data/data/com.termux/files/home/Cleve/node_modules/discord.js/src/structures/MessagePayload.js:113:22) at MessagePayload.resolveData (/data/data/com.termux/files/home/Cleve/node_modules/discord.js/src/structures/MessagePayload.js:128:26) at TextChannel.send (/data/data/com.termux/files/home/Cleve/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:165:32) at Message.reply (/data/data/com.termux/files/home/Cleve/node_modules/discord.js/src/structures/Message.js:743:25) at Object.handleTalk (/data/data/com.termux/files/home/Cleve/util.js:34:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5) { [Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
} } reason: Message content must be a non-empty string.
can you please remove that ping system I want that in channel I just type without pining bot and it replies
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (C:\Users\gojo\node_modules\discord.js\src\client\websocket\WebSocketManager.js:129:26)
at Object. (C:\Users\gojo\Desktop\gojobot\index.js:47:8)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
[Symbol(code)]: 'TOKEN_INVALID'
}
} reason: An invalid token was provided.
When trying to run the bot or to get to type a response, it comes up with this
Unable to connect to API: Error: [401] Unable to process request: Reason: Unauthorized
I changed everything In the config file, and still nothing
me: hows the weather in your area today?
bot: <a href="http://www.bing.com/search?q=weather%22%3Eclick here check the weather for your location
How do i make the bot chat in a channel?
Hi there when i try send a message to bot, i got this error
[CLEVE] Started and ready to chat!
FetchError: invalid json response body at http://api.brainshop.ai/get?bid=[bid]&key=[key]&uid=[uid]&msg=hello reason: Unexpected token 'S', "SPAM, cont"... is not valid JSON
at D:\path\path\node_modules\node-fetch\lib\index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.handleTalk (D:\path\path\util.js:33:21)
can you help me?
Please Update this to the newer Version's of everything.
C:\Users\piggy\Desktop\bot>node index.js
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:123:26)
at Client.login (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\client\Client.js:245:21)
at Object. (C:\Users\piggy\Desktop\bot\index.js:47:8)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
[Symbol(code)]: 'TOKEN_INVALID'
}
} reason: An invalid token was provided.
I have a channel made for the chat bot, is it possible to do it without pinging it?
Hello, there's problem that I'm facing right now, the bot is connected but the status isn't changing and he isn't respoding in the channel
{
"bot_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": {
"state": "idle",
"type": "PLAYING",
"name": "Chat simulator"
},
"chat": {
"url": "http://api.brainshop.ai/get",
"brainID": "xxxxxx",
"key": "*****************",
"channel": "**********************"
}
}
this is the config.json
Hey guys,
it would be nice if we could get in contact because I followed the instructions, but the but isn't answering
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
<rejected> DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (/home/runner/AI/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/runner/AI/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async TextChannel.send (/home/runner/AI/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:175:15) {
method: 'post',
path: '/channels/XXXXXXXXXX/messages',
code: 50006,
httpStatus: 400,
requestData: { json: [Object], files: [] }
}
} reason: Cannot send an empty message
c:\Users\piggy\Desktop\bot>node index.js
[CLEVE] Started and ready to chat!
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
at Function.verifyString (c:\Users\piggy\Desktop\bot\node_modules\discord.js\src\util\Util.js:414:49)
at MessagePayload.makeContent (c:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\MessagePayload.js:113:22)
at MessagePayload.resolveData (c:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\MessagePayload.js:128:26)
at TextChannel.send (c:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:165:32)
at Message.reply (c:\Users\piggy\Desktop\bot\node_modules\discord.js\src\structures\Message.js:743:25)
at Object.handleTalk (c:\Users\piggy\Desktop\bot\util.js:34:17)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'MESSAGE_CONTENT_TYPE'
}
} reason: Message content must be a non-empty string.
I asked it to call me by my name and then when someone else asked the bot, whats my name it said, my name, it can like only talk to one person at a time
Hey carbowix ! I just wanted a small help with the chatbot's amazing code.
I want to modify the chatbot so that it responds not in only one channel but also in an user defined channels
npm run start
npm ERR! Missing script: "start"
My code looks exactly like the given source code but the Bot doesnt reply to questions even though its online, Console showing no errors or anything either
I dont know how to update node can you help please (need to update in replit)
Are there anyway I can use .env instead of config.json?
The bot doesn't work.
{
"bot_token": "xx",
"status": {
"state": "Online",
"type": "Watching You",
"name": "ss"
},
"chat": {
"url": "http://api.brainshop.ai/get",
"brainID": "xx",
"key": "xx",
"channel": ".."
}
}
HELP!
hey i Can you Edit me a this code to Chat With Bot in Custom Channel and Chat with out tag bot
Keep getting this error whenever trying to communicate with the api doesnt appear to be code related but unsure
FetchError: invalid json response body at http://api.brainshop.ai/get?bid=<Hidden brain id>&key=<Hidden api key>&uid=<hidden>&msg=are+you+able+to+respond reason: Unexpected token ( in JSON at position 0
Loaded the link on Firefox showed a timeout error
Is this my internet or is it api side
Would it be possible to create to bot answer automaticly, without tagging it.
}
} reason: An invalid token was provided.
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:123:26)
at Client.login (C:\Users\piggy\Desktop\bot\node_modules\discord.js\src\client\Client.js:245:21)
at Object. (C:\Users\piggy\Desktop\bot\index.js:47:8)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
[Symbol(code)]: 'TOKEN_INVALID'
}
} reason: An invalid token was provided.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. đđđ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google â€ïž Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.