-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated, bumped Discord.js to v14.11.0 + discord plugins + log-parser #300
base: master
Are you sure you want to change the base?
Updated, bumped Discord.js to v14.11.0 + discord plugins + log-parser #300
Conversation
Signed-off-by: Magic <[email protected]>
Signed-off-by: Magic <[email protected]>
Signed-off-by: Magic <[email protected]>
If the read me was updated make sure you update templates as well if it’s needed. |
Huh I did click build-all before pressing commit, guess I did not add channel IDs in the options section for plugins. Would I need to create another pull request? |
Just update your current branch/PR |
Signed-off-by: Magic <[email protected]>
|
@magicoflolis you are merging to v4 not master ? v4 looks like abandoned branch |
Attempted to merge into the same branch name, just now realized I set it to v4 as the branch I created does not exist. |
Shouldn't the version bump be to 4.0 not 4.7.0? |
Yeah... It should be v4.0.0, I glanced @ the release format & added +1 to the I will have to fix that on my next commit as I've begone to extend the discord connector code to its own workspace. This is going to allow end users to add there own slash commands and give those commands access to SquadJS |
Can you please leave the versioning bumping to us please? There is some processes that have to be done to the repo before that can happen. |
Signed-off-by: Magic <[email protected]>
I will need some additional testing from users before we can look at getting this approved. |
Signed-off-by: Magic <[email protected]>
Signed-off-by: Magic <[email protected]>
I have gone ahead & added the extended discord bot. It will have its own workspace & can also be ran independently from SquadJS. I have also included 3 simple slash commands. I have not added a usage limit to any of these yet, moving these commands out of there folders will disable them.
SquadJS plugins & discord slash commands cannot directly interact with each other, yet. Slash commands will only have access to the Fixes
|
Why is the discord bot commit d19ed9b not a seperate PR? Is this PR in a state where it can be tested or is it still in a development / WIP state where you intent to add new features / fixes? I've done a bit of testing of this PR at commit de9d9e431c9173dccd0fb1112f5e5a3a2e5067fd which is the one where plugins have their major / minor versions bumped because that kind of maintenance work is something i consider worth integrating quickly and I'm personally happy with functionality / haven't encountered any issues. |
Due to the discordjs version bump I needed to update the way factory.js file created the discord bot, however with this change on rare occasions after discordjs login the connector won't be completely ready leading to errors for some plugins. You can see this after u call The entire discord-bot workspace was me getting carried away with the amount of things you can do now with discord.js & SquadJS. I also test everything before hand & I don't have any plans to add more features to this PR, but I will still be here to fix any bugs along the way. |
Once this PR is in a state to be tested please let us know. I am going to move this to a draft state until then. |
Signed-off-by: Magic <[email protected]>
I believe this PR is ready to be tested. I have included basic discord slash commands as references. To anyone who wishes to create slash commands, here is the basic layout, store them in your desired import { SlashCommandBuilder } from 'discord.js';
export default {
data: new SlashCommandBuilder()
.setName('name')
.setDescription('description')
async execute(interaction, server) {
...
}; Additional help https://discordjs.guide/ |
Signed-off-by: Magic <[email protected]>
Squad Servers actively using this PRBoth of these servers I help start & still manage back-end server infrastructure. PSG Hosting also assisted me with migrating a SquadJS instance to use this PR.
|
This will be on an on hold status pending some possible OWI changes. Doesn't appear that they will happen but until I hear more most PRs will not be pushed until I have a solid answer to prevent unnecessary dev time wasted. |
@magicoflolis I was looking into this PR (still need to test it), it looks very interesting, but as far as I can see, slash commands cannot be created by plugins, instead, each slash command will need to have its own file in discord-bot/local-commands or discord-bot/global-commands. Is that correct? In case you can confirm what I have previously stated, a solution could be to call the Also, I suspect |
@magicoflolis Maybe we can only merge changes without "discord-bot"? discord-bot may be added in the next PR |
May I ask what specific improvement does this have with the log parser? |
After coming back to this mmmm yeah I put all my eggs in the basket. I might just backup everything and push these changes one at a time. |
Signed-off-by: Magic <[email protected]>
Signed-off-by: Magic <[email protected]>
Signed-off-by: Magic <[email protected]>
Okay starting from the top, I have reset this branch, reworked the code, and pushing changes one at a time. I have moved the stuff above to this branch old-discordjsv14 Log Parser
Misc: In theory the LogParser could be rewritten to utilize NodeJS Worker. I have already written the code to make plugins load the same way log-events are loaded. So it would be better to make the I have been working on typescript definitions for Creating typescript definitions could make SquadJS much easier to understand and work with when combined with something like VSCode. |
Changes
*/package.json
core/log-parser/index.js
Average matching latency
being NaN in the log.squad-server/plugins/*
base-plugin.js
=> Added additional utility functionsdiscord-base-plugin.js
discord-base-plugin.js
will have access to multiple channels. Function can also convert legacy embeds to the newer format.Recommended to use
channelIDs
instead ofchannelID
The plugin will convert
channelID
todefault
as a fallback. TODO prevent duplicate labels.Examples