node.js
npm install
node index
the repository for the bot The Captain which mostly runs the discord server for the game Volcanoids
Home Page: https://thecaptain.ga
When the bot is invited to another server it (sometimes) creates two enteries in the database for said guild. This also happens with older servers (frequently volcanoids for some reson). Probably cause by some wrong trigger somewhere in the guildCreate event or guildUpdate.
One of the dependencies of simple-reddit is outdated, causing vulnerabilities warnings. This package needs to be replaced to patch this vulnerablilty. Only feature using it should be the meme command.
It seems like people that have previously been active, but stoped have lost some levels, so the role they have doesent match the level they are at. NO idea what could caused this, and it seems very out of place. Will have to investigate this closer, and get more information on the issue.
The automod command caused the same error a few times at some other server, not entierly sure what it is, but seems like a small bug:
| 10/5/2020, 01:49:17 | 💕Naomi Venus and Violet Lets Vibe💕 | the_masked_one326#0657 | automod
(node:7573) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
at Object.module.exports.run (/home/pi/Desktop/Cap/commands/automod.js:7:24)
at Client.<anonymous> (/home/pi/Desktop/Cap/index.js:435:6)
at Client.emit (events.js:310:20)
at MessageCreateAction.handle (/home/pi/Desktop/Cap/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/pi/Desktop/Cap/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/pi/Desktop/Cap/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/home/pi/Desktop/Cap/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/home/pi/Desktop/Cap/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
at WebSocket.onMessage (/home/pi/Desktop/Cap/node_modules/ws/lib/event-target.js:125:16)
at WebSocket.emit (events.js:310:20)
(node:7573) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
Simple fix handled in PR 27.
I'm keeping this open as an ongoing issue. If there are new things to add, or false positives that need fixing, add a comment.
The regex & issue will be updated, and the comments merged/deleted into this issue. Keeps things clean.
// A var since I keep copying the "the game", "it", "this", etc in many of these.
const theGamePart1 = `(that|the|this)`; // The 'the' part of 'the game'. The group of words that patch the first part.
const theGamePart2 = `(game|it|volcanoid(s?))`; // The 'game' part of 'the game'. The group of words that patch the last part.
// Merge so we either match: The first part, the second part, or both parts.
// e.g. we match: 'the', 'the game', or 'game'.
// Breakdown: 'the' | 'game' | 'the game'
const theGameRegex = `(${theGamePart1}|${theGamePart2}|${theGamePart1}\\s${theGamePart2})`;
const steamAutoreplyRegex = CreateAutoReplyRegex([
`when(('|’)s|s| is)?( ${theGameRegex})? (come|coming) out`,
`is ${theGameRegex} (out|released|available)( yet)?`,
`is ${theGameRegex} (up|available) (yet|to download)?`,
`(where|how) (can|do|does)( [^ \\n]+?)? (get|buy|play) (this|it|${theGamePart1} ${theGamePart2})`,
`(where|how).*?download`),
`(is|if|will)( [^ \\n]+?)? ${theGameRegex}( (?!only)[^ \\n]+?)? (free|on steam)`,
`what.*?(get|buy|is)( [^ \\n]+?)? ${theGamePart2}.*? on[^a-zA-Z]`,
`how mu(t?)ch .*?${theGameRegex}? cost`,
`how (much|many)( [^ \\n]+?)? is ${theGameRegex}`,
`can i play( [^ \\n]+?)?( ${theGameRegex})? now`,
`price in (usd|dollars|aud|cad)`
], `igm`);
The generated result:
(when(('|’)s|s| is)?( ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))? (come|coming) out)|(is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) (out|released|available)( yet)?)|(is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) (up|available) (yet|to download)?)|((where|how) (can|do|does)( [^ \n]+?)? (get|buy|play) (this|it|(that|the|this) (game|it|volcanoid(s?))))|((where|how).*?download)|((is|if|will)( [^ \n]+?)? ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?)))( (?!only)[^ \n]+?)? (free|on steam))|(what.*?(get|buy|is)( [^ \n]+?)? (game|it|volcanoid(s?)).*? on[^a-zA-Z])|(how mu(t?)ch .*?((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?)))? cost)|(how (much|many)( [^ \n]+?)? is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))|(can i play( [^ \n]+?)?( ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))))? now)|(price in (usd|dollars|aud|cad))
My test data (90% real comments, some variations added by me):
Negatives:
As you all saw in the above here is the candle we stuck on top! This is available in the Questing Update Mod for a limited time Only 7 Days! so make sure to check it out while you still can! All Tier 1 Coal Modules put on the roof of the building will have this shiny candle! Happy Birthday Volcanoids!
behind me is free space
get the game on steam
guys I'm getting the game on steam today
Hey is there mods and if so where can I get them
how do get that
How do i get diamond drill parts, i need them to get to the volcano heart
how do i get shredder
how do u get arrested for that
I got so lucky to get the game from Steam before it got more expensive. But I can't play the game lol!
I wish I could play this game but I’m not able to buy it on steam
Interesting... Maybe that's what is going on...
is the update out yet?
is the update released yet?
Is this game only on steam
Just wondering, tried looking on google but couldn't find answers. How do I do separate saves of co-op / single player games instead of it overwriting my old progress.
look at big games on steam
May i ask what is going on in Drillship #1?
question how do u get an engine part when u play the game without the tutorial
since my second screen which I keep my discord on is super low res, I had no fricking clue what is that green line on the pic
that what is this one :joy:
what is going on here
What is your opinion on this?
what is your volcano timer on when it just erupted?
Positives:
But once again I am asking if the game is free
can i play now
can i play this game now
can i play this now
can i play volcanoids now
Guys is the game free?
how do get the game
how do u download Linxi?
how do you get the game
How does one get the game on steam
How much does the game cost
How much does this game cost
how much does this game cost and will it possibly be made to go on playstation
How much does this game cost on steam?
how much is the game
How much is the game on steam?
how much is volcanoid
how much is volcanoids
How much money is that game?
How much money is the game?
How much money is volcanoids?
How mutch will it cost
Is it free
Is the game already on steam
Is the game available to download?
Is the game available?
Is the game on steam or discord
is the game out
is the game out
is the game out yet
Is the game out yet?
is the game released
Is the game up to download?
is this a game on steam?
Is this free
Is this game on steam?
Is this game released yet?
Is this on Xbox the game and can I play it now
is this out
Is this out yet
is this released
price in USD
Question is the game on steam?
So how can I play this game
Thanks also is it available now and is there in game purchases
This game available on steam right?
What’s this game called and is it on steam
What is the game gonna be on?
What is this game available on?
What is this game on
When’s it coming out?
when's it come out
when's it coming out
when's this coming out
where can i buy this
where can i buy this game
where do i buy it
Will the game be on steam dumb question but will it
Will volcanoids be free?
PS: Regex notes 'cuz I'll probably forget.
( [^ \n]+?)
Match any single word.
( (?!only)[^ \n]+?)?
Match any single word excluding only
.
(Don't forget the \n
in [^ \n]
else it actually matches past newlines.)
This issue was fixed in PR 24, You can fact check it there.
Its all a mess at the moment, the database uses a string containing an array of objects containing the channel and command name.
Structure example:
[
{ channel: "channelID", command: "help"}
]
However the way theese are loaded and checked doesent work whatsoever. And the way they are uploaded to the database is really poorly designed. Could perhaps redo the system using enmap.
The idea is that you have two commands, disable and enable that can disable and enable one or more commands in one or all channels. A disabled command cant be used in said channel.
This means that both the leaderboard gets a little cluttered with users that arent on the server, especially on older and large servers. This can be solved by sending some sql in the guildMemberRemove event and the guildBanAdd event
I'm keeping this open as an ongoing issue. If there are new things to add, or false positives that need fixing, add a comment.
The regex & issue will be updated, and the comments merged/deleted into this issue. Keeps things clean.
const multiplayerNames = `(coop|co-op|multiplayer|multi player|multi-player)`;
const multiplayerAutoreplyRegex = CreateAutoReplyRegex([
`is ${theGameRegex} ${multiplayerNames}`,
`is there ${multiplayerNames}`,
`does ${theGameRegex}.*${multiplayerNames}`,
`${theGameRegex} .* (is )?${multiplayerNames}\\?`,
`is ${multiplayerNames} a thing`,
`${theGameRegex} is ${multiplayerNames}.*?\\?`,
`you should[^\\.\\n]*(add|make)[^\\.\\n]*${multiplayerNames}` // `[^\\.\\n]*` matches everything except period & newline.
], `igm`);
The generated result:
(^(?!>).*?is ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) (coop|co-op|multiplayer|multi player|multi-player))|(^(?!>).*?is there (coop|co-op|multiplayer|multi player|multi-player))|(^(?!>).*?does ((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))).*(coop|co-op|multiplayer|multi player|multi-player))|(^(?!>).*?((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) .* (is )?(coop|co-op|multiplayer|multi player|multi-player)\?)|(^(?!>).*?is (coop|co-op|multiplayer|multi player|multi-player) a thing)|(^(?!>).*?((that|the|this)|(game|it|volcanoid(s?))|(that|the|this) (game|it|volcanoid(s?))) is (coop|co-op|multiplayer|multi player|multi-player).*?\?)|(^(?!>).*?you should[^\.\n]*(add|make)[^\.\n]*(coop|co-op|multiplayer|multi player|multi-player))
My test data (90% real comments, some variations added by me):
Negative:
For finding people to play multiplayer volcanoids with
i finished the updating the files and checked the multiplayer lobbies and im still unable to find any
is it on a multiplayer world?
is there a way to start a multiplayer lobby with an old save file?
or alex's mod(before he had the multiplayer stuff) I tested
So that each player can have their own in multiplayer
you are attempting to use it in multiplayer, also you don't have the mod installed
You should add guns. I like multiplayer.
Positive:
does it have coop
does the game have coop mode
Hello, just wondering if volcanoids is multiplayer. Like rust?.
hey is the game multiplayer?
is it multiplayer
is it multiplayer?
Is multiplayer a thing
is there multiplayer coop in this game? btw on steam it's, right?
is this game multiplayer?
This game is multiplayer right?
This game is multiplayer?
Will the game be multiplayer?
You should add like a coop or multiplayer mode or is it already?
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.