-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reimplement message parsing as a toggleable feature #338
Merged
mfdlabs-ops
merged 39 commits into
master
from
feature/336-reimplement-message-parsing-as-a-toggleable-feature
Oct 9, 2024
Merged
Reimplement message parsing as a toggleable feature #338
mfdlabs-ops
merged 39 commits into
master
from
feature/336-reimplement-message-parsing-as-a-toggleable-feature
Oct 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ Drop all type annotations to support #337 ~ Update branches to properly handle LuaVMEnabledForAdmins
~ Reorganize code to support both interaction and command context ~ Add Discord.Net.Commands dependency to Shared.Utility
No longer log trace back, as this feature is not needed.
Add method to get the channel, and ingest it via GetChannelAsString
~ Create IUserMessageExtensions to add a method to reply with a file. ~ Create ModuleBaseExtensions to add functionality to reply with reference, reply with file, and reply with multiple files easily within module base.
~ EnableLockdownCommands: Determines if lockdown commands are enabled, if false then any commands marked with LockdownAttribute will just be passed straight on to the next precondition attribute. ~ LockdownGuildId: The guild permitted to respond to lockdown commands. ~ TextCommandsDisabledWarningText: Warning text to respond with when text commands are disabled, otherwise it will default to a generic message. ~ EnableTextCommands: Determines if text commands should be enabled. ~ ShouldWarnWhenCommandsAreDisabled: Determines if a warning should be responded with when the user tries to use a text command.
Drop dependency on client directly and use the context instead.
~ Drop dependency on discord client directly and use the context client instead. ~ Catch-all on Discord.Net.HttpException
~ Text-commands version of on interaction executed
Do not handle InteractionException or CommandException as OnInteractionExecuted and OnCommandExecuted events handles it themselves.
~ Add references to CommandService, DiscordClient and ServiceProvider ~ Update _allowedCommandRegex to support underscores, as well as match only on one line to improve performance. ~ Add hashset to store all command aliases to filter out responses and calls to commands service ~ Update all metrics to remove the idea of deprecation against text commands. ~ Add metric for command processing time. ~ Add initialization method called within on ready event finished that will update the command aliases hashset with the currently registered modules. ~ Move around logger instantiation after command alias validation to introduce better performance when commands are not found. ~ Drop log on the users ingesting "previous phase commands" ~ Add branches to check if commands are enabled or disabled, debating on whether or not to put this before maintenance checks. ~ Call on commands service.
~ Drop branch out of interaction service execution to a different thread and just run within the current thread (report back later when it causes problems)
~ Add command service to the container. ~ Add on command executed event.
An attribute only allows the command to be executed within the DMs of users within the specified bot role, or within the specified guild (if configured).
Drop the interaction one for the commands one
Move all private modules to text commands to help lock them down to specific guilds etc so that they don't flood out command lists.
jf-06
added
kind: feature
This issue integrates a single feature (or multiple disguised as one)
opsec: love-all-environments
SEC-04-LAE
opsec: we-love-clean-code
SEC-10-WLCC
area: discord
Issue relates to discord
area: code-ops
Issue relates to the issue of Code Ops
labels
Oct 1, 2024
This was
linked to
issues
Oct 1, 2024
Implement a NOOP job manager to allow local debugging for users who are not on infra networks, or do not have software tools available to run grid servers.
~ Move around the bot role enum to Shared.Utility. ~ Add a method in admin utility to wrap the individual methods to detect if users are owners, admins or privilaged by using the bot role enum.
Update RequireCommandBotRoleAttribute, ClientSettings and Maintenance modules to account for the movement of the enum to Shared.Utility.
Add the help command for text based commands. This will cache the embeds for each indivual command on the first usage of the command.
Apparently this will cause thread locks.
Change case for CommandException
LTS changes, all versions are in sync now to better guage future changes
All loggers now take in a function getter for the log level instead of hard coding the log level. Trace no longer exists and has been changed to Verbose
~ Rename references of interactions to commands. Drop need for summary attribute on command arguments as it is unused within the stack. ~ Clean up constructors of some handlers removing uneeded arguments.
#!components: grid-bot Settings.cs: ~ This command allows you to: 1. Get environment information about the current application configuration. 2. List all available settings provider names. 3. List all values within a settings provider (cached, can optionally be refreshed just before fetch) -- For now it only functions in Vault-based environments. 4. Get the value of a specific setting in a provider, supported on both Vault and Env var based environments. 5. Support for setting a specific setting value in a provider, for now only supported by Vault providers as base class is only Vault and the base class does not fall back to EnvVar provider when Vault refresh is not enabled within set commands. 6. Support for refreshing all registered auto refresh providers immediately, or in turn refreshing a specific provider (will possibly refresh twice if the refresh thread hits is around the same time)
Correctly fetch the required permission attribute
Account for the fact that cached values is a dictionary of strings and JsonElements, 1.1.0 of Configuration should address this issue and it will be removed in a future release
mfdlabs-ops
requested changes
Oct 9, 2024
services/grid-bot/lib/commands/PrivateModules/Commands/ClientSettings.cs
Outdated
Show resolved
Hide resolved
services/grid-bot/lib/commands/PrivateModules/Commands/ClientSettings.cs
Outdated
Show resolved
Hide resolved
services/grid-bot/lib/commands/PrivateModules/Commands/ClientSettings.cs
Outdated
Show resolved
Hide resolved
services/grid-bot/lib/commands/PrivateModules/Commands/ClientSettings.cs
Outdated
Show resolved
Hide resolved
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
#!skip-build!# Signed-off-by: Nikita Petko <petko@vmminfra.net>
mfdlabs-ops
approved these changes
Oct 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: code-ops
Issue relates to the issue of Code Ops
area: discord
Issue relates to discord
kind: feature
This issue integrates a single feature (or multiple disguised as one)
opsec: love-all-environments
SEC-04-LAE
opsec: we-love-clean-code
SEC-10-WLCC
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #336 and #337