ooer-dev / botto-js Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'd like to move the bot away from requiring persistent storage, so that in the future it can move into a Kubernetes cluster or other PaaS solution.
A/C:
Currently, we attempt to send all messages regardless of length to Discord's API.
As empty messages return a 400, and we don't catch that exception, the bot errors out and gets restarted.
A/C: Empty messages are no longer sent to Discord
We don't currently have checks in place for whether we're able to send messages to a given channel.
Because of this, if a channel we're observing doesn't grant us send permissions, the bot will crash out and restart.
We should ideally check this before even generating a message, as otherwise we're spending useless cycles when another channel could instead get a message.
A/C: Stop generating messages for channels we can't send in
When freshly cloning the bot and attempting to run it for the first time with node .
in the root project directory after filling in the discord token config and channels config, it will just throw this error:
node:fs:573
return binding.open(
^
Error: ENOENT: no such file or directory, open '/mnt/c/Users/letters/Projects/botto-js/src/discord/../../cache/messages.json'
at Object.openSync (node:fs:573:18)
at Object.readFileSync (node:fs:452:35)
at #load (/mnt/c/Users/letters/Projects/botto-js/src/discord/cache.js:62:24)
at new DiscordCache (/mnt/c/Users/letters/Projects/botto-js/src/discord/cache.js:13:15)
at Object.<anonymous> (/mnt/c/Users/letters/Projects/botto-js/src/discord/cache.js:80:18)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Module.require (node:internal/modules/cjs/loader:1271:19) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/mnt/c/Users/letters/Projects/botto-js/src/discord/../../cache/messages.json'
}
Only config issue I can imagine is that I'm not providing any of the reddit config keys since I'm working on the discord part, but I can't see that causing this issue?
I'm using an Arch WSL2 instance on Windows 10
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.