1.0.6 RC5

This commit is contained in:
phidias authored and GitHub committed 2026-10-13 02:14:20 +09:00
1 parent 969a770663
commit 763dd4628f
1 file changed
+9 -9
+9 -9
View File
@@ -90,15 +90,6 @@ interface Bucket {
warned: boolean;
}
/** Config is keyed by instance name; sendTo wants the controller's numeric ID. */
const findInstanceId = (instanceName: string): number | null => {
for (const [id, instance] of controller.instances) {
if (instance.name === instanceName) return id;
}
return null;
};
export default async function(context: ControllerPluginContext) {
const {controller, logger, plugin} = context;
@@ -260,6 +251,14 @@ export default async function(context: ControllerPluginContext) {
return true;
};
const findInstanceId = (instanceName: string): number | null => {
for (const [id, instance] of controller.instances) {
if (instance.name === instanceName) return id;
}
return null;
};
const onDiscordMessage = async (message: Message) => {
if (shuttingDown) return;
@@ -279,6 +278,7 @@ export default async function(context: ControllerPluginContext) {
const datetime = message.createdAt.toISOString();
const authorName = message.member?.displayName ?? message.author.username;
for (const instanceName of instanceNames) {
const instanceId = findInstanceId(instanceName);