unseenfaith / komada Goto Github PK
View Code? Open in Web Editor NEWKomada: Croatian for `pieces`, is a modular bot system including reloading modules and easy to use custom commands.
License: MIT License
Komada: Croatian for `pieces`, is a modular bot system including reloading modules and easy to use custom commands.
License: MIT License
0.18.1
No
The addKey function incorrectly checks for values in key and defaultValue.
The if condition checking for key and DefaultValue checks for an unset variable.
The if condition checks for false instead. This results in problems if you need to use false as DefaultValue.
!eval client.funcs.confs.addKey("cmdPrompt", false)
v0.20.10
No.
Uncaught promise error when trying to send a message in a channel that the bot can see but cannot talk in. This happens with System Commands and custom commands.
The error should be caught or handled in some way.
This Error is given:
Uncaught Promise Error: DiscordAPIError: Missing Permissions at item.request.gen.end (/root/node_modules/komada/node_modules/discord.js/src/rest/handlers/RequestHandler.js:52:65) at then (/root/node_modules/komada/node_modules/snekfetch/src/index.js:263:21) at <anonymous> at process._tickDomainCallback (internal/process/next_tick.js:228:7)
Uncaught Promise Error: TypeError: Cannot read property 'missing' of null at Object.exports.run (/komada/src/inhibitors/missingBotPermissions.js:22:88)
0.18 on Centos 7
No
I noticed however that after upgrading to 0.18, ready.js in the events folder is not executing on bot being ready.
When the bot loads, ready.js from events is fired. I have a console.log to tell me when it is fired. It also creates an open port to receive metadata from a radio system to put as a channel topic in a guild.
ready.js does not appear to fire. Nothing in the log about it firing, and the server port supposed to start up on ready is not started.
0.18.3#indev
No
TypeError: client.funcs.permissionLevel(...).catch is not a function
at Object.module.exports [as awaitMessage] (/mnt/c/Users/manue/node_modules/komada/functions/awaitMessage.js:8:90)
at module.exports (/mnt/c/Users/manue/functions/handleCommand.js:17:22)
If client.config.cmdPrompt
is set to true, it should prompt (even thought it's broken until the usage.js rewrite).
It logs on the console as an uncaught promise error, with no new message on the channel.
Download 0.18.3#indev
and set cmdPrompt
to true
.
0.20.10
No
I only notice when I get errors with my moderation commands, however, my Guild settings are being reset back to their defaults or null. I do not know when this happens.
Guild settings wouldn't get randomly reset?
I set the guild settings, then a few days later I eval my guild settings and they are reset back to null
Using eval to add items to the guild settings, such as a modLog channel ID or adminRole ID
Proof: On September 8th
https://gyazo.com/7ea7ecc815324e4873bda3ff899fb18b
On September 11th
https://gyazo.com/90d9ddb48f08ce364dd4d503c482c689
I haven't manually reset them.
Place functions like elevation
and reload
in ./features/core
and add new optional features like points
in ./features/optional
Load dynamically using the name. Some functions may require optional features.
Using the simplest method possible (json?) Enable per-server configurations: roles, prefix, enable/disable commands.
0.18.1
No
I wrote basic function that should send a message and then edit it
The command file should load just fine
At startup the loader ejects some errors about \n in markdown (???) that look like this:
{ code: null,
message: 'Could not load new command data: /`/`/`js\n/home/szymex/test/discord/komada.js/commands/Misc/test.js:2\n const message = await msg.channel.sendMessage("Ping?").catch(err => client.funcs.log(err, "error"))\n ^^^\nSyntaxError: Unexpected identifier\n at createScript (vm.js:53:10)\n at Object.runInThisContext (vm.js:95:10)\n at Module._compile (module.js:543:28)\n at Object.Module._extensions..js (module.js:580:10)\n at Module.load (module.js:488:32)\n at tryModuleLoad (module.js:447:12)\n at Function.Module._load (module.js:439:3)\n at require (internal/module.js:20:19)\n at Promise (/home/szymex/node_modules/komada/functions/loadSingleCommand.js:30:13)\n at Object.module.exports [as loadSingleCommand] (/home/szymex/node_modules/komada/functions/loadSingleCommand.js:3:72)\n at files.forEach (/home/szymex/node_modules/komada/utils/loadCommands.js:10:26)\n at Array.forEach (native)\n at Promise (/home/szymex/node_modules/komada/utils/loadCommands.js:9:11)\n at process._tickCallback (internal/process/next_tick.js:109:7)/`/`/`',
stack: null }
I've put the backslashes in the error msg so it wouldn't collide with GH's markdown
I don't know, my PC is Linux Mint 18.1 Cinnamon
Node 7.7.2
This is my main file: Link to gist
And my ./commands/Misc/test.js file: Link to gist
Branch | Build failing 🚨 |
---|---|
Dependency | eslint-config-airbnb-base |
Current Version | 12.0.2 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
eslint-config-airbnb-base is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
0.19.0
functions/usage.js is, everything else is not
TypeError: Cannot read property 'target' of undefined
at WebSocketConnection.onOpen (/root/discordjs/lovinibot/node_modules/komada/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:318:25)
at native.client.group.onConnection (/root/discordjs/lovinibot/node_modules/uws/uws.js:53:15)
Komada starts up
Komada starts up but continues to spit out the error
TypeError: Cannot read property 'target' of undefined
at WebSocketConnection.onOpen (/root/discordjs/lovinibot/node_modules/komada/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:318:25)
at native.client.group.onConnection (/root/discordjs/lovinibot/node_modules/uws/uws.js:53:15)
This results in an immediate crash.
D:\c2857\Desktop\Discord Bots\guidebot\cmds\reload.js:11
if (params[0].includes(".js")) params[0] = params[0].replace(".js","");
^TypeError: Cannot read property 'includes' of undefined
at Object.exports.run (D:\c2857\Desktop\Discord Bots\guidebot\cmds\reload.js:11:18)
at Client.bot.on.msg (D:\c2857\Desktop\Discord Bots\guidebot\app.js:77:9)
at emitOne (events.js:96:13)
at Client.emit (events.js:188:7)
at MessageCreateHandler.handle (D:\c2857\Desktop\Discord Bots\guidebot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (D:\c2857\Desktop\Discord Bots\guidebot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:94:65)
at WebSocketManager.eventMessage (D:\c2857\Desktop\Discord Bots\guidebot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:220:31)
at WebSocket.ws.onmessage (D:\c2857\Desktop\Discord Bots\guidebot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:78:37)
at WebSocket.onMessage (D:\c2857\Desktop\Discord Bots\guidebot\node_modules\ws\lib\WebSocket.js:442:14)
at emitTwo (events.js:106:13)
I myself fixed it by adding a return if params[0] is null
0.20.4
No.
At logon using a Bot Token, the error TypeError: this.api.oauth2.applications
is thrown
See here for the full error
Bot logs in
Bot doesn't work at all.
Use latest indev Komada
v0.20.7
No.
Reloading a command doesn't reload the commands' usage arguments, if you had wrote it incorrectly and tried to reload it to fix it - or at least not in this case.
Reloading the command which previously had incorrect syntax in the usage arguments, then fixed, should update the command usage and reload it without errors.
The same error is displayed when trying to reload the command, as was displayed when you made the syntax mistake, despite the usage being fixed. A reboot is necessary to reload the command properly.
<anInteger:int{1,10000}>
to <anInteger:int{1,10000>
and reload the command, you will get an error because it is incorrect.}
back in, and try to reload the command, it will show the same error in Step 2.Use awaitMessages to make a simple quiz command. Optionally use a score/points module if present.
v0.18.10
Nope
When I do set the conf to a message with space example: Welcome to the server
That's will set only Welcome..
Will set Welcome to the server
Set only Welcome
Create an string into the conf file, and try to set it with space
Same for the adminRole and modRole
Now that custom structures is merged into Discord.js#master, I can safely work towards updating Komada and putting it back on it's track to its first official release. This will either be a minor bump or Komada's official first release, depending on how much or how far I decide to go on some of the things I want to add.
Testers for this PR would be appreciated.
Moving this over here because the PR was clustered with way too much shit and I lost track of what was being done. Everything from this point onward's will be little, small additions instead of one big PR. Some of the stuff on this list is already done, but not checked off as well.
exports.conf {
enabled: true,
};
Makes Komada Great Again.
0.21.1
Nope
When I try the help command it says
"":x: | You have DMs disabled, I couldn't send you the commands in DMs."
but if i try eval message.author.send(something
) is working
and is working to send messages to the bot too
I have like 45 commands + System commands
To be sending me all the commands
It sends me nothing
I used help
didn't work
i used eval message.author.send(something
)
worked
i messaged the bot
worked
i used help again
didn't work
0.21.1
No
...\node_modules\komada\src\classes\argResolver.js:32
async msg(arg, currentUsage, possible, repeat, msg) {
^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (...\node_modules\komada\src\index.js:2:16)
To not be an error
Is an error
I just reinstalled komada after a long time, and appears that :<
https://www.npmjs.com/package/fs-extra-promise
Change all fs methods To use promisified ASYNC
Special message processors that are executed upon each message. Few examples:
The processor should be a single function, and should return "false" if it's deemed that the command handler should stop processing (aka commands should not be executed). For instance the Blacklist would return false if an ID is blacklisted and should be ignored.
Database modules for various types of databases:
Each module would need to have specific functions, to be compatible:
0.18.10, but it's present since years ago.
No
When a command uses the mention
type in usage, and the user doesn't mention the user, it prints this message:
[2017-03-26 12:24:45] TypeError: Cannot read property '0' of null
at validateArgs (/mnt/c/Users/manue/node_modules/komada/functions/usage.js:103:82)
at Promise (/mnt/c/Users/manue/node_modules/komada/functions/usage.js:580:4)
at Object.exports.run (/mnt/c/Users/manue/node_modules/komada/functions/usage.js:9:55)
at Object.module.exports [as handleCommand] (/mnt/c/Users/manue/functions/handleCommand.js:11:45)
at client.on (/mnt/c/Users/manue/node_modules/komada/app.js:79:18)
at process._tickCallback (internal/process/next_tick.js:103:7)
Another thing in usage.js (L116-L121), it's validating if the argument is false, but not when it's true.
if (args[i] === "true") {
args[i] = true;
} else {
args[i] = false;
validateArgs(++i);
}
Also, now that we are here, add if (message.deletable)
in L25 from awaitMessage, if you delete the message before it gets deleted, or komada couldn't send the message, it'll print this:
Uncaught Promise Error:
TypeError: message.delete is not a function
at module.exports (/mnt/c/Users/manue/node_modules/komada/functions/awaitMessage.js:25:19)
Also, I know that it's hard to catch, but if the bot has permissions to read a channel, but not to send a message into it, for example, the command ping:
[2017-03-26 12:17:55] Error: Forbidden
at Request.callback (/mnt/c/Users/manue/node_modules/superagent/lib/node/index.js:675:11)
at /mnt/c/Users/manue/node_modules/superagent/lib/node/index.js:883:18
at Stream.<anonymous> (/mnt/c/Users/manue/node_modules/superagent/lib/node/parsers/json.js:16:7)
at emitNone (events.js:86:13)
at Stream.emit (events.js:186:7)
at Unzip.<anonymous> (/mnt/c/Users/manue/node_modules/superagent/lib/node/unzip.js:53:12)
at emitNone (events.js:91:20)
at Unzip.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Uncaught Promise Error:
TypeError: Cannot read property 'edit' of undefined
at exports.run (/mnt/c/Users/manue/commands/System/ping.js:3:10)
at process._tickCallback (internal/process/next_tick.js:103:7)
Should check if the message is editable before "trying" to edit it.
Should run this line (L111) in case of mention
type. I have checked the code and might be reproduceable for member
. Since in /\d+/.exec(args[i])[0]
, when there's no number, you're trying to read the property [0]
of null.
return reject(client.funcs.newError(`${currentUsage.possibles[0].name} must be a mention or valid user id.`, 1, args));
It should validate if the argument is either true
or false
, currently it does only for false
.
Should verify if the message was sent and is editable, instead of trying to edit it.
Previously check if the command requires SEND_MESSAGES
permissions before trying to run it. In conf.botPerms
, maybe?
Everything explained above.
¯\_(ツ)_/¯
Dev Usage Only
Issue Workflow
0.18.5#indev
No, happens to Komada Bot too.
When you execute the help command, unless you're the owner of the bot, it doesn't work.
Error STATUS 400: Bad request: Cannot send an empty message
. It happens ONLY when GuildMember.permLevel (using Utils/Extendables) is 0, or DMs the command help as user.permLevel = 0.
Send the commands to DMs.
Notifies the user that the commands have been send to DMs, however, it doesn't send any message, just print "Bad Request" on console (with depth null).
Install komada Indev v0.18.5, execute the help command being member.permLevel == 0 (works with higher permLevel).
0.18.1
No
When trying to specify a user ID for a command using a user parameter, the user has to exist in the guild or Komada fails to pass a user object to the command.
When using a command that takes a user parameter, if the user does not exist in the guild, Komada will find the user and still return a user object to the command.
Komada returns a null user object to the command if the user does not exist in the guild.
Komada used to return user objects to the command even if the user was not in the guild. But it suddenly stopped doing that after I ran a custom function that scanned a bunch of user IDs from a MariaDB database and updated the database to include their username and discriminator. I was utilising Discord.js 11.1 client.FetchUser to do this.
Branch | Build failing 🚨 |
---|---|
Dependency | eslint |
Current Version | 4.6.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
node.parent
is already set (fixes #9122) (#9283) (Teddy Katz)return
(fixes #9285) (#9296) (Teddy Katz)npm run perf
description (#9274) (Teddy Katz)The new version differs by 55 commits.
439e8e6
4.7.0
2ec62f9
Build: changelog update for 4.7.0
787b78b
Upgrade: Espree v3.5.1 (fixes #9153) (#9314)
1488b51
Update: run rules after node.parent
is already set (fixes #9122) (#9283)
4431d68
Docs: fix wrong config in max-len example. (#9309)
9d1df92
Chore: Revert "avoid handling Rules instances in config-validator" (#9295)
7d24dde
Docs: Fix code snippet to refer to the correct option (#9313)
12388d4
�Chore: rewrite parseListConfig for a small perf gain. (#9300)
ce1f084
Update: fix MemberExpression handling in no-extra-parens (fixes #9156)
0c720a3
Update: allow autofixing when using processors (fixes #7510) (#9090)
838df76
Chore: upgrade deps. (#9289)
f12def6
Update: indent flatTernary option to handle return
(fixes #9285) (#9296)
e220687
Fix: remove autofix for var undef inits (fixes #9231) (#9288)
002e199
Docs: fix no-restricted-globals wrong config. (#9305)
fcfe91a
Docs: fix wrong config in id-length example. (#9303)
There are 55 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
0.20.8
No
It's not possible to use the updateArray function with SettingGateway instances initialized with a type other than guild
updateArray should update arrays in SettingGateway instances based on all types
updateArray throws an error and fails to update arrays on SettingGateway instances other than ones based on guild types
Ability to create event handler functions, added to /handlers/event-name.js
.
The files should be named the same way as the event, to be automatically loaded. So for example /handlers/guildMemberAdd.js
would handle new guild members and react accordingly.
github:dirigeants/komada#indev
No, not until I added a space to fix this issue.
The color highlighting on the help messages that arrive in the DM can be affected by the prefix. For example by using the .
prefix it changes the entire color to Blue instead of the awesome Blue and Orange. Changing the prefix to ,
or /
solves this issue but that forces users to use a specific prefix. I would suggest adding a space to the help.
Problem: https://cdn.discordapp.com/attachments/339948384368721921/348868699165556746/unknown.png
Suggestion: https://cdn.discordapp.com/attachments/342436526380154881/348924110941847553/unknown.png
Set prefix to .
and type .help
0.19.0
functions/usage.js
Attempting to run Komada results in a client.funcs.log is not a function error
Komada boots and operates normally.
Komada crashes with this error:
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: client.funcs.log is not a function
at Promise.all.catch.e (/root/discordjs/lovinibot/node_modules/komada/utils/loadFunctions.js:18:51)
Uncaught Promise Error:
TypeError: client.funcs.log is not a function
at Promise.all.catch.e (/root/discordjs/lovinibot/node_modules/komada/utils/loadFunctions.js:18:51)
A small improvement to the Help command would be to filter returned commands to only the ones the Member can execute.
Latest Komada#master
Only the help command to add a ${prefix}
space in the beginning so the asiidoc colors work and dont get ruined by the prefix.
CommandLogger doesnt log any commands when enabled in the config.json file.
Log the commands as described in docs.
None
Edit json file to have it enabled -> use a command
"cmdLogging": true,
github:dirigeants/komada#indev
No
It isn't really a problem but would be an awesome feature to add on. Right now i have about 5 function files. I am in need of creating a new function file but this new function will require calling one of those previous 5 functions. However, if the new function loads before the older functions then it wont work at all. It would be nice to have a way to require functions similar to how in commands exports.conf you can require certain functions.
A function that requires other functions don't load before other functions.
Potentially update Komada Core to use Node 7 Async/Await.
v0.18.1
No
The ready.js event is executed before komada is even finished loading all of the other components, such as the functions.
Komada loads all available components, such as events, functions, commands, monitors, and so on, and THEN executes ready.js event if exists once everything is loaded and Discord is connected to. That way, a required database.js function is loaded, which ready.js uses to prune out banned users who snuck in the guild when the bot was offline.
Komada loads all event handlers, then executes ready.js, then loads the rest of the components like commands, functions, and so on. This causes the bot to error because my ready.js needs the database.js function to prune banned users.
For anyone else who may have this issue, I set my user pruning functions inside a 15 second setTimeout to give the bot 15 seconds to load the rest of the components before pruning. This is not supposed to be a production fix though (sometimes the bot may take more than 15 seconds).
My explanations above should answer this question easily.
0.19.0
Only a couple, but nothing that interferes with permissionLevel.js
permissionLevel.js returns the wrong number for permissions.
permissionLevel.js returns 10 for bot owner, 4 for guild owner, 3 for adminRole user, 2 for modRole user, 0 for everyone else.
permissionLevel.js ignores admins, mods, and guild owners; only returns 10 for bot owner or 0 for everyone else.
Using a command which accesses msg.author.permLevel.
Some way to enable or disable a command.
First pass: temporary until reboot.
Second pass: saved per server
Add basic permission system determined by a custom numbering system, can be personalized by the user (default: will look at roles "mod" and "admin" or something).
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.