fix extractTargetGroup typing

This commit is contained in:
Reto Brunner 2024-04-15 07:43:11 +02:00
parent c3fc54e158
commit 5c8951ffc3
2 changed files with 7 additions and 3 deletions

View file

@ -99,10 +99,10 @@ const input: PluginInputHandler = function (network, chan, cmd, args) {
// being sent back to us.
if (!network.irc.network.cap.isEnabled("echo-message")) {
const parsedTarget = network.irc.network.extractTargetGroup(targetName);
let targetGroup;
let targetGroup: string | undefined = undefined;
if (parsedTarget) {
targetName = parsedTarget.target as string;
targetName = parsedTarget.target;
targetGroup = parsedTarget.target_group;
}

View file

@ -117,7 +117,11 @@ declare module "irc-framework" {
isEnabled: (cap: string) => boolean;
enabled: string[];
};
extractTargetGroup: (target: string) => any;
extractTargetGroup: (target: string) => {
target: string;
target_group: string;
};
supports(feature: "MODES"): string;
supports(feature: string): boolean;
};