mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fix: make message module warn rather than throwing (#399)
This commit is contained in:
@@ -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