allow bridge to be one-way only

This commit is contained in:
Lea 2023-01-07 17:36:59 +01:00
parent 3dc10d34a4
commit 0582b388bd
Signed by: Lea
GPG key ID: 1BAFFE8347019C42
3 changed files with 12 additions and 0 deletions

View file

@ -122,6 +122,8 @@ client.on("messageCreate", async (message) => {
return logger.debug(`Discord: No Revolt channel associated`); return logger.debug(`Discord: No Revolt channel associated`);
if (message.system && bridgeCfg.config?.disable_system_messages) if (message.system && bridgeCfg.config?.disable_system_messages)
return logger.debug(`Discord: Not bridging system message`); return logger.debug(`Discord: Not bridging system message`);
if (bridgeCfg.config?.read_only_discord)
return logger.debug(`Discord: Channel is marked as read only`);
const channel = revoltClient.channels.get(bridgeCfg.revolt); const channel = revoltClient.channels.get(bridgeCfg.revolt);
if (!channel) if (!channel)

View file

@ -151,6 +151,8 @@ client.on("message", async (message) => {
return logger.debug( return logger.debug(
`Revolt: System message bridging disabled; ignoring` `Revolt: System message bridging disabled; ignoring`
); );
if (bridgeCfg?.config?.read_only_revolt)
return logger.debug(`Revolt: Channel is marked as read only`);
if (!bridgeCfg?.discord) if (!bridgeCfg?.discord)
return logger.debug(`Revolt: No Discord channel associated`); return logger.debug(`Revolt: No Discord channel associated`);
if (!bridgeCfg.discordWebhook) { if (!bridgeCfg.discordWebhook) {

View file

@ -15,4 +15,12 @@ export const CONFIG_KEYS = {
description: description:
"If enabled, system messages (e.g. join/leave events) won't be bridged.", "If enabled, system messages (e.g. join/leave events) won't be bridged.",
}, },
read_only_revolt: {
friendlyName: "Revolt read only",
description: "Don't bridge Revolt messages to Discord",
},
read_only_discord: {
friendlyName: "Discord read only",
description: "Don't bridge Discord messages to Revolt",
},
}; };