fix: default groupPolicy to open for discord/telegram
This commit is contained in:
@@ -382,7 +382,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
|||||||
const discordCfg = account.config;
|
const discordCfg = account.config;
|
||||||
const dmConfig = discordCfg.dm;
|
const dmConfig = discordCfg.dm;
|
||||||
const guildEntries = discordCfg.guilds;
|
const guildEntries = discordCfg.guilds;
|
||||||
const groupPolicy = discordCfg.groupPolicy ?? "allowlist";
|
const groupPolicy = discordCfg.groupPolicy ?? "open";
|
||||||
const allowFrom = dmConfig?.allowFrom;
|
const allowFrom = dmConfig?.allowFrom;
|
||||||
const mediaMaxBytes =
|
const mediaMaxBytes =
|
||||||
(opts.mediaMaxMb ?? discordCfg.mediaMaxMb ?? 8) * 1024 * 1024;
|
(opts.mediaMaxMb ?? discordCfg.mediaMaxMb ?? 8) * 1024 * 1024;
|
||||||
@@ -639,7 +639,7 @@ export function createDiscordMessageHandler(params: {
|
|||||||
} = params;
|
} = params;
|
||||||
const logger = getChildLogger({ module: "discord-auto-reply" });
|
const logger = getChildLogger({ module: "discord-auto-reply" });
|
||||||
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
||||||
const groupPolicy = discordConfig?.groupPolicy ?? "allowlist";
|
const groupPolicy = discordConfig?.groupPolicy ?? "open";
|
||||||
|
|
||||||
return async (data, client) => {
|
return async (data, client) => {
|
||||||
try {
|
try {
|
||||||
@@ -1548,7 +1548,7 @@ function createDiscordNativeCommand(params: {
|
|||||||
Object.keys(guildInfo?.channels ?? {}).length > 0;
|
Object.keys(guildInfo?.channels ?? {}).length > 0;
|
||||||
const channelAllowed = channelConfig?.allowed !== false;
|
const channelAllowed = channelConfig?.allowed !== false;
|
||||||
const allowByPolicy = isDiscordGroupAllowedByPolicy({
|
const allowByPolicy = isDiscordGroupAllowedByPolicy({
|
||||||
groupPolicy: discordConfig?.groupPolicy ?? "allowlist",
|
groupPolicy: discordConfig?.groupPolicy ?? "open",
|
||||||
channelAllowlistConfigured,
|
channelAllowlistConfigured,
|
||||||
channelAllowed,
|
channelAllowed,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -982,7 +982,7 @@ export function createTelegramBot(opts: TelegramBotOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isGroup && useAccessGroups) {
|
if (isGroup && useAccessGroups) {
|
||||||
const groupPolicy = telegramCfg.groupPolicy ?? "allowlist";
|
const groupPolicy = telegramCfg.groupPolicy ?? "open";
|
||||||
if (groupPolicy === "disabled") {
|
if (groupPolicy === "disabled") {
|
||||||
await bot.api.sendMessage(
|
await bot.api.sendMessage(
|
||||||
chatId,
|
chatId,
|
||||||
@@ -1214,7 +1214,7 @@ export function createTelegramBot(opts: TelegramBotOptions) {
|
|||||||
// - "open": groups bypass allowFrom, only mention-gating applies
|
// - "open": groups bypass allowFrom, only mention-gating applies
|
||||||
// - "disabled": block all group messages entirely
|
// - "disabled": block all group messages entirely
|
||||||
// - "allowlist": only allow group messages from senders in groupAllowFrom/allowFrom
|
// - "allowlist": only allow group messages from senders in groupAllowFrom/allowFrom
|
||||||
const groupPolicy = telegramCfg.groupPolicy ?? "allowlist";
|
const groupPolicy = telegramCfg.groupPolicy ?? "open";
|
||||||
if (groupPolicy === "disabled") {
|
if (groupPolicy === "disabled") {
|
||||||
logVerbose(`Blocked telegram group message (groupPolicy: disabled)`);
|
logVerbose(`Blocked telegram group message (groupPolicy: disabled)`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user