mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:04:31 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type {
|
||||
DiscordGuildChannelConfig,
|
||||
DiscordGuildEntry,
|
||||
} from "../config/types.js";
|
||||
import type { DiscordGuildChannelConfig, DiscordGuildEntry } from "../config/types.js";
|
||||
import { resolveDiscordAccount } from "./accounts.js";
|
||||
import { fetchChannelPermissionsDiscord } from "./send.js";
|
||||
|
||||
@@ -27,9 +24,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function shouldAuditChannelConfig(
|
||||
config: DiscordGuildChannelConfig | undefined,
|
||||
) {
|
||||
function shouldAuditChannelConfig(config: DiscordGuildChannelConfig | undefined) {
|
||||
if (!config) return true;
|
||||
if (config.allow === false) return false;
|
||||
if (config.enabled === false) return false;
|
||||
@@ -48,12 +43,7 @@ function listConfiguredGuildChannelKeys(
|
||||
for (const [key, value] of Object.entries(channelsRaw)) {
|
||||
const channelId = String(key).trim();
|
||||
if (!channelId) continue;
|
||||
if (
|
||||
!shouldAuditChannelConfig(
|
||||
value as DiscordGuildChannelConfig | undefined,
|
||||
)
|
||||
)
|
||||
continue;
|
||||
if (!shouldAuditChannelConfig(value as DiscordGuildChannelConfig | undefined)) continue;
|
||||
ids.add(channelId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user