mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-11 15:14:52 +09:00
1.0.6 RC5
This commit is contained in:
1 parent
969a770663
commit
763dd4628f
1 file changed
+9
-9
+9
-9
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user