mirror of
https://github.com/sern-handler/handler
synced 2026-06-27 18:22:14 +00:00
Compare commits
8 Commits
fix/dispos
...
v4.2.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efee0fdbe2 | ||
|
|
797442ece3 | ||
|
|
513ac8edf4 | ||
|
|
81a0180d05 | ||
|
|
89d7409536 | ||
|
|
aa802f761e | ||
|
|
2414992b73 | ||
|
|
70c6236802 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,5 +1,26 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [4.2.5](https://github.com/sern-handler/handler/compare/v4.2.4...v4.2.5) (2025-08-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* make message module warn rather than throwing ([#399](https://github.com/sern-handler/handler/issues/399)) ([797442e](https://github.com/sern-handler/handler/commit/797442ece3999bf2cb6b5ba0688ce0177e72a22f))
|
||||||
|
|
||||||
|
## [4.2.4](https://github.com/sern-handler/handler/compare/v4.2.3...v4.2.4) (2025-03-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* flat autocomplete ([#395](https://github.com/sern-handler/handler/issues/395)) ([89d7409](https://github.com/sern-handler/handler/commit/89d74095363befddc3222b9e5c89c35e7c6457b9))
|
||||||
|
|
||||||
|
## [4.2.3](https://github.com/sern-handler/handler/compare/v4.2.2...v4.2.3) (2025-03-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* autocomplete sdt.module not present ([#393](https://github.com/sern-handler/handler/issues/393)) ([2414992](https://github.com/sern-handler/handler/commit/2414992b73a40065464b20f2d53826c78fcd3a5f))
|
||||||
|
|
||||||
## [4.2.2](https://github.com/sern-handler/handler/compare/v4.2.1...v4.2.2) (2025-02-03)
|
## [4.2.2](https://github.com/sern-handler/handler/compare/v4.2.1...v4.2.2) (2025-02-03)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ export default commandModule({
|
|||||||
- [SmokinWeed 💨](https://github.com/Peter-MJ-Parker/sern-bud) - A fun bot for a small, but growing server.
|
- [SmokinWeed 💨](https://github.com/Peter-MJ-Parker/sern-bud) - A fun bot for a small, but growing server.
|
||||||
- [Man Nomic](https://github.com/jacoobes/man-nomic) - A simple information bot to provide information to the nomic-ai Discord community.
|
- [Man Nomic](https://github.com/jacoobes/man-nomic) - A simple information bot to provide information to the nomic-ai Discord community.
|
||||||
- [Linear-Discord](https://github.com/sern-handler/linear-discord) - Display and manage a linear dashboard.
|
- [Linear-Discord](https://github.com/sern-handler/linear-discord) - Display and manage a linear dashboard.
|
||||||
|
- [ZenithBot](https://github.com/CodeCraftersHaven/ZenithBot) - A versatile bot coded in TypeScript, designed to enhance server management and user interaction through its robust features.
|
||||||
|
|
||||||
## 💻 CLI
|
## 💻 CLI
|
||||||
|
|
||||||
It is **highly encouraged** to use the [command line interface](https://github.com/sern-handler/cli) for your project. Don't forget to view it.
|
It is **highly encouraged** to use the [command line interface](https://github.com/sern-handler/cli) for your project. Don't forget to view it.
|
||||||
|
|||||||
1163
package-lock.json
generated
1163
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@sern/handler",
|
"name": "@sern/handler",
|
||||||
"packageManager": "yarn@3.5.0",
|
"packageManager": "yarn@3.5.0",
|
||||||
"version": "4.2.2",
|
"version": "4.2.5",
|
||||||
"description": "A complete, customizable, typesafe, & reactive framework for discord bots.",
|
"description": "A complete, customizable, typesafe, & reactive framework for discord bots.",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ export function interactionHandler(deps: UnpackedDependencies, defaultPrefix?: s
|
|||||||
// handles autocomplete
|
// handles autocomplete
|
||||||
if(isAutocomplete(event)) {
|
if(isAutocomplete(event)) {
|
||||||
const lookupTable = module.locals['@sern/lookup-table'] as Map<string, SernAutocompleteData>
|
const lookupTable = module.locals['@sern/lookup-table'] as Map<string, SernAutocompleteData>
|
||||||
const subCommandGroup = event.options.getSubcommandGroup() ?? "",
|
const subCommandGroup = event.options.getSubcommandGroup(false) ?? "",
|
||||||
subCommand = event.options.getSubcommand() ?? "",
|
subCommand = event.options.getSubcommand(false) ?? "",
|
||||||
option = event.options.getFocused(true),
|
option = event.options.getFocused(true),
|
||||||
fullPath = path.posix.join("<parent>", subCommandGroup, subCommand, option.name)
|
fullPath = path.posix.join("<parent>", subCommandGroup, subCommand, option.name)
|
||||||
|
|
||||||
const resolvedModule = (lookupTable.get(fullPath)!.command) as Module
|
const resolvedModule = (lookupTable.get(fullPath)!.command) as Module
|
||||||
payload= { module: resolvedModule , //autocomplete is not a true "module" warning cast!
|
payload= { module: resolvedModule , //autocomplete is not a true "module" warning cast!
|
||||||
args: [event, createSDT(resolvedModule, deps, params)] };
|
args: [event, createSDT(module, deps, params)] };
|
||||||
// either CommandTypes Slash | ContextMessage | ContextUesr
|
// either CommandTypes Slash | ContextMessage | ContextUesr
|
||||||
} else if(isCommand(event)) {
|
} else if(isCommand(event)) {
|
||||||
const sdt = createSDT(module, deps, params)
|
const sdt = createSDT(module, deps, params)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export function messageHandler (deps: UnpackedDependencies, defaultPrefix?: stri
|
|||||||
const [prefix] = fmt(message.content, defaultPrefix);
|
const [prefix] = fmt(message.content, defaultPrefix);
|
||||||
let module = mg.get(`${prefix}_T`) ?? mg.get(`${prefix}_B`) as Module;
|
let module = mg.get(`${prefix}_T`) ?? mg.get(`${prefix}_B`) as Module;
|
||||||
if(!module) {
|
if(!module) {
|
||||||
throw Error('Possibly undefined behavior: could not find a static id to resolve')
|
log?.warning({ message: 'Possibly undefined behavior: could not find a static id to resolve' });
|
||||||
}
|
}
|
||||||
const payload = { module, args: [Context.wrap(message, defaultPrefix), createSDT(module, deps, undefined)] }
|
const payload = { module, args: [Context.wrap(message, defaultPrefix), createSDT(module, deps, undefined)] }
|
||||||
const result = await callPlugins(payload)
|
const result = await callPlugins(payload)
|
||||||
|
|||||||
Reference in New Issue
Block a user