3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00

refactor: convert /backend to ESM

This commit is contained in:
Dragory 2024-04-09 20:57:18 +03:00
parent 31d74c05aa
commit 5772e27cda
No known key found for this signature in database
766 changed files with 3473 additions and 3500 deletions

View file

@ -1,47 +1,47 @@
import { Snowflake } from "discord.js";
import { PluginOptions, guildPlugin } from "knub";
import { GuildArchives } from "../../data/GuildArchives";
import { GuildCases } from "../../data/GuildCases";
import { GuildLogs } from "../../data/GuildLogs";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { Supporters } from "../../data/Supporters";
import { makePublicFn, sendSuccessMessage } from "../../pluginUtils";
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { AboutCmd } from "./commands/AboutCmd";
import { AvatarCmd } from "./commands/AvatarCmd";
import { BanSearchCmd } from "./commands/BanSearchCmd";
import { ChannelInfoCmd } from "./commands/ChannelInfoCmd";
import { CleanCmd, cleanCmd } from "./commands/CleanCmd";
import { ContextCmd } from "./commands/ContextCmd";
import { EmojiInfoCmd } from "./commands/EmojiInfoCmd";
import { HelpCmd } from "./commands/HelpCmd";
import { InfoCmd } from "./commands/InfoCmd";
import { InviteInfoCmd } from "./commands/InviteInfoCmd";
import { JumboCmd } from "./commands/JumboCmd";
import { LevelCmd } from "./commands/LevelCmd";
import { MessageInfoCmd } from "./commands/MessageInfoCmd";
import { NicknameCmd } from "./commands/NicknameCmd";
import { NicknameResetCmd } from "./commands/NicknameResetCmd";
import { PingCmd } from "./commands/PingCmd";
import { ReloadGuildCmd } from "./commands/ReloadGuildCmd";
import { RoleInfoCmd } from "./commands/RoleInfoCmd";
import { RolesCmd } from "./commands/RolesCmd";
import { SearchCmd } from "./commands/SearchCmd";
import { ServerInfoCmd } from "./commands/ServerInfoCmd";
import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd";
import { SourceCmd } from "./commands/SourceCmd";
import { UserInfoCmd } from "./commands/UserInfoCmd";
import { VcdisconnectCmd } from "./commands/VcdisconnectCmd";
import { VcmoveAllCmd, VcmoveCmd } from "./commands/VcmoveCmd";
import { AutoJoinThreadEvt, AutoJoinThreadSyncEvt } from "./events/AutoJoinThreadEvt";
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed";
import { hasPermission } from "./functions/hasPermission";
import { activeReloads } from "./guildReloads";
import { refreshMembersIfNeeded } from "./refreshMembers";
import { UtilityPluginType, zUtilityConfig } from "./types";
import { GuildArchives } from "../../data/GuildArchives.js";
import { GuildCases } from "../../data/GuildCases.js";
import { GuildLogs } from "../../data/GuildLogs.js";
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
import { Supporters } from "../../data/Supporters.js";
import { makePublicFn, sendSuccessMessage } from "../../pluginUtils.js";
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners.js";
import { LogsPlugin } from "../Logs/LogsPlugin.js";
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin.js";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js";
import { AboutCmd } from "./commands/AboutCmd.js";
import { AvatarCmd } from "./commands/AvatarCmd.js";
import { BanSearchCmd } from "./commands/BanSearchCmd.js";
import { ChannelInfoCmd } from "./commands/ChannelInfoCmd.js";
import { CleanCmd, cleanCmd } from "./commands/CleanCmd.js";
import { ContextCmd } from "./commands/ContextCmd.js";
import { EmojiInfoCmd } from "./commands/EmojiInfoCmd.js";
import { HelpCmd } from "./commands/HelpCmd.js";
import { InfoCmd } from "./commands/InfoCmd.js";
import { InviteInfoCmd } from "./commands/InviteInfoCmd.js";
import { JumboCmd } from "./commands/JumboCmd.js";
import { LevelCmd } from "./commands/LevelCmd.js";
import { MessageInfoCmd } from "./commands/MessageInfoCmd.js";
import { NicknameCmd } from "./commands/NicknameCmd.js";
import { NicknameResetCmd } from "./commands/NicknameResetCmd.js";
import { PingCmd } from "./commands/PingCmd.js";
import { ReloadGuildCmd } from "./commands/ReloadGuildCmd.js";
import { RoleInfoCmd } from "./commands/RoleInfoCmd.js";
import { RolesCmd } from "./commands/RolesCmd.js";
import { SearchCmd } from "./commands/SearchCmd.js";
import { ServerInfoCmd } from "./commands/ServerInfoCmd.js";
import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd.js";
import { SourceCmd } from "./commands/SourceCmd.js";
import { UserInfoCmd } from "./commands/UserInfoCmd.js";
import { VcdisconnectCmd } from "./commands/VcdisconnectCmd.js";
import { VcmoveAllCmd, VcmoveCmd } from "./commands/VcmoveCmd.js";
import { AutoJoinThreadEvt, AutoJoinThreadSyncEvt } from "./events/AutoJoinThreadEvt.js";
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed.js";
import { hasPermission } from "./functions/hasPermission.js";
import { activeReloads } from "./guildReloads.js";
import { refreshMembersIfNeeded } from "./refreshMembers.js";
import { UtilityPluginType, zUtilityConfig } from "./types.js";
const defaultOptions: PluginOptions<UtilityPluginType> = {
config: {

View file

@ -1,13 +1,13 @@
import { APIEmbed, GuildChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import LCL from "last-commit-log";
import { shuffle } from "lodash";
import shuffle from "lodash/shuffle.js";
import moment from "moment-timezone";
import { rootDir } from "../../../paths";
import { getCurrentUptime } from "../../../uptime";
import { resolveMember, sorter } from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { utilityCmd } from "../types";
import { rootDir } from "../../../paths.js";
import { getCurrentUptime } from "../../../uptime.js";
import { resolveMember, sorter } from "../../../utils.js";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js";
import { utilityCmd } from "../types.js";
export const AboutCmd = utilityCmd({
trigger: "about",

View file

@ -1,8 +1,8 @@
import { APIEmbed, ImageFormat } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { UnknownUser, renderUsername } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { UnknownUser, renderUsername } from "../../../utils.js";
import { utilityCmd } from "../types.js";
export const AvatarCmd = utilityCmd({
trigger: ["avatar", "av"],

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { archiveSearch, displaySearch, SearchType } from "../search";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { archiveSearch, displaySearch, SearchType } from "../search.js";
import { utilityCmd } from "../types.js";
// Separate from BanSearchCmd to avoid a circular reference from ./search.ts
export const banSearchSignature = {

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const ChannelInfoCmd = utilityCmd({
trigger: ["channel", "channelinfo"],

View file

@ -1,15 +1,15 @@
import { Message, Snowflake, TextChannel, User } from "discord.js";
import { GuildPluginData } from "knub";
import { allowTimeout } from "../../../RegExpRunner";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { SavedMessage } from "../../../data/entities/SavedMessage";
import { humanizeDurationShort } from "../../../humanizeDurationShort";
import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { ModActionsPlugin } from "../../../plugins/ModActions/ModActionsPlugin";
import { DAYS, SECONDS, chunkArray, getInviteCodesInString, noop } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { UtilityPluginType, utilityCmd } from "../types";
import { allowTimeout } from "../../../RegExpRunner.js";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { LogType } from "../../../data/LogType.js";
import { SavedMessage } from "../../../data/entities/SavedMessage.js";
import { humanizeDurationShort } from "../../../humanizeDurationShort.js";
import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
import { ModActionsPlugin } from "../../../plugins/ModActions/ModActionsPlugin.js";
import { DAYS, SECONDS, chunkArray, getInviteCodesInString, noop } from "../../../utils.js";
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
import { UtilityPluginType, utilityCmd } from "../types.js";
const MAX_CLEAN_COUNT = 300;
const MAX_CLEAN_TIME = 1 * DAYS;

View file

@ -1,9 +1,9 @@
import { Snowflake, TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { messageLink } from "../../../utils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { messageLink } from "../../../utils.js";
import { canReadChannel } from "../../../utils/canReadChannel.js";
import { utilityCmd } from "../types.js";
export const ContextCmd = utilityCmd({
trigger: "context",

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getCustomEmojiId } from "../functions/getCustomEmojiId";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { getCustomEmojiId } from "../functions/getCustomEmojiId.js";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const EmojiInfoCmd = utilityCmd({
trigger: ["emoji", "emojiinfo"],

View file

@ -1,7 +1,7 @@
import { LoadedGuildPlugin, PluginCommandDefinition } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { createChunkedMessage } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { createChunkedMessage } from "../../../utils.js";
import { utilityCmd } from "../types.js";
export const HelpCmd = utilityCmd({
trigger: "help",

View file

@ -1,21 +1,21 @@
import { Snowflake } from "discord.js";
import { getChannelId, getRoleId } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { getCustomEmojiId } from "../functions/getCustomEmojiId";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { getGuildPreview } from "../functions/getGuildPreview";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils.js";
import { canReadChannel } from "../../../utils/canReadChannel.js";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget.js";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed.js";
import { getCustomEmojiId } from "../functions/getCustomEmojiId.js";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed.js";
import { getGuildPreview } from "../functions/getGuildPreview.js";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed.js";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed.js";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed.js";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed.js";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed.js";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const InfoCmd = utilityCmd({
trigger: "info",

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { parseInviteCodeInput } from "../../../utils";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { parseInviteCodeInput } from "../../../utils.js";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const InviteInfoCmd = utilityCmd({
trigger: ["invite", "inviteinfo"],

View file

@ -2,10 +2,10 @@ import photon from "@silvia-odwyer/photon-node";
import { AttachmentBuilder } from "discord.js";
import fs from "fs";
import twemoji from "twemoji";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { downloadFile, isEmoji, SECONDS } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { downloadFile, isEmoji, SECONDS } from "../../../utils.js";
import { utilityCmd } from "../types.js";
const fsp = fs.promises;

View file

@ -1,7 +1,7 @@
import { helpers } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { renderUsername } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { renderUsername } from "../../../utils.js";
import { utilityCmd } from "../types.js";
const { getMemberLevel } = helpers;

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { canReadChannel } from "../../../utils/canReadChannel.js";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const MessageInfoCmd = utilityCmd({
trigger: ["message", "messageinfo"],

View file

@ -1,8 +1,8 @@
import { escapeBold } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils.js";
import { errorMessage } from "../../../utils.js";
import { utilityCmd } from "../types.js";
export const NicknameCmd = utilityCmd({
trigger: ["nickname", "nick"],

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage } from "../../../utils";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils.js";
import { errorMessage } from "../../../utils.js";
import { utilityCmd } from "../types.js";
export const NicknameResetCmd = utilityCmd({
trigger: ["nickname reset", "nick reset"],

View file

@ -1,7 +1,7 @@
import { Message } from "discord.js";
import { performance } from "perf_hooks";
import { noop, trimLines } from "../../../utils";
import { utilityCmd } from "../types";
import { noop, trimLines } from "../../../utils.js";
import { utilityCmd } from "../types.js";
export const PingCmd = utilityCmd({
trigger: ["ping", "pong"],

View file

@ -1,6 +1,6 @@
import { TextChannel } from "discord.js";
import { activeReloads } from "../guildReloads";
import { utilityCmd } from "../types";
import { activeReloads } from "../guildReloads.js";
import { utilityCmd } from "../types.js";
export const ReloadGuildCmd = utilityCmd({
trigger: "reload_guild",

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const RoleInfoCmd = utilityCmd({
trigger: ["roleinfo"],

View file

@ -1,9 +1,9 @@
import { Role } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { chunkArray, sorter, trimLines } from "../../../utils";
import { refreshMembersIfNeeded } from "../refreshMembers";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { chunkArray, sorter, trimLines } from "../../../utils.js";
import { refreshMembersIfNeeded } from "../refreshMembers.js";
import { utilityCmd } from "../types.js";
export const RolesCmd = utilityCmd({
trigger: "roles",

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { archiveSearch, displaySearch, SearchType } from "../search";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { archiveSearch, displaySearch, SearchType } from "../search.js";
import { utilityCmd } from "../types.js";
// Separate from SearchCmd to avoid a circular reference from ./search.ts
export const searchCmdSignature = {

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const ServerInfoCmd = utilityCmd({
trigger: ["server", "serverinfo"],

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const SnowflakeInfoCmd = utilityCmd({
trigger: ["snowflake", "snowflakeinfo"],

View file

@ -1,8 +1,8 @@
import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils.js";
import { canReadChannel } from "../../../utils/canReadChannel.js";
import { utilityCmd } from "../types.js";
export const SourceCmd = utilityCmd({
trigger: "source",

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed.js";
import { utilityCmd } from "../types.js";
export const UserInfoCmd = utilityCmd({
trigger: ["user", "userinfo", "whois"],

View file

@ -1,9 +1,9 @@
import { VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { renderUsername } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
import { renderUsername } from "../../../utils.js";
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
import { utilityCmd } from "../types.js";
export const VcdisconnectCmd = utilityCmd({
trigger: ["vcdisconnect", "vcdisc", "vcdc", "vckick", "vck"],

View file

@ -1,9 +1,9 @@
import { ChannelType, Snowflake, VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { channelMentionRegex, isSnowflake, renderUsername, simpleClosestStringMatch } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
import { channelMentionRegex, isSnowflake, renderUsername, simpleClosestStringMatch } from "../../../utils.js";
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
import { utilityCmd } from "../types.js";
export const VcmoveCmd = utilityCmd({
trigger: "vcmove",

View file

@ -1,4 +1,4 @@
import { utilityEvt } from "../types";
import { utilityEvt } from "../types.js";
export const AutoJoinThreadEvt = utilityEvt({
event: "threadCreate",

View file

@ -1,8 +1,8 @@
import { APIEmbed, ChannelType, Snowflake, StageChannel, VoiceChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { EmbedWith, MINUTES, formatNumber, preEmbedPadding, trimLines, verboseUserMention } from "../../../utils";
import { UtilityPluginType } from "../types";
import { EmbedWith, MINUTES, formatNumber, preEmbedPadding, trimLines, verboseUserMention } from "../../../utils.js";
import { UtilityPluginType } from "../types.js";
const TEXT_CHANNEL_ICON =
"https://cdn.discordapp.com/attachments/740650744830623756/740656843545772062/text-channel.png";

View file

@ -1,7 +1,7 @@
import { APIEmbed } from "discord.js";
import { GuildPluginData } from "knub";
import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils";
import { UtilityPluginType } from "../types";
import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils.js";
import { UtilityPluginType } from "../types.js";
export async function getEmojiInfoEmbed(
pluginData: GuildPluginData<UtilityPluginType>,

View file

@ -1,5 +1,5 @@
import { Client, GuildPreview, Snowflake } from "discord.js";
import { MINUTES, memoize } from "../../../utils";
import { MINUTES, memoize } from "../../../utils.js";
/**
* Memoized getGuildPreview

View file

@ -11,9 +11,9 @@ import {
renderUsername,
resolveInvite,
trimLines,
} from "../../../utils";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp";
import { UtilityPluginType } from "../types";
} from "../../../utils.js";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js";
import { UtilityPluginType } from "../types.js";
export async function getInviteInfoEmbed(
pluginData: GuildPluginData<UtilityPluginType>,

View file

@ -8,8 +8,8 @@ import {
renderUsername,
trimEmptyLines,
trimLines,
} from "../../../utils";
import { UtilityPluginType } from "../types";
} from "../../../utils.js";
import { UtilityPluginType } from "../types.js";
const MESSAGE_ICON = "https://cdn.discordapp.com/attachments/740650744830623756/740685652152025088/message.png";

View file

@ -1,8 +1,8 @@
import { APIEmbed, PermissionFlagsBits, Role } from "discord.js";
import { GuildPluginData } from "knub";
import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils";
import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils.js";
import { PERMISSION_NAMES } from "../../../utils/permissionNames.js";
import { UtilityPluginType } from "../types";
import { UtilityPluginType } from "../types.js";
const MENTION_ICON = "https://cdn.discordapp.com/attachments/705009450855039042/839284872152481792/mention.png";

View file

@ -11,10 +11,10 @@ import {
resolveInvite,
resolveUser,
trimLines,
} from "../../../utils";
import { idToTimestamp } from "../../../utils/idToTimestamp";
import { UtilityPluginType } from "../types";
import { getGuildPreview } from "./getGuildPreview";
} from "../../../utils.js";
import { idToTimestamp } from "../../../utils/idToTimestamp.js";
import { UtilityPluginType } from "../types.js";
import { getGuildPreview } from "./getGuildPreview.js";
const prettifyFeature = (feature: string): string =>
`\`${feature

View file

@ -1,6 +1,6 @@
import { APIEmbed } from "discord.js";
import { EmbedWith, preEmbedPadding } from "../../../utils";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp";
import { EmbedWith, preEmbedPadding } from "../../../utils.js";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js";
const SNOWFLAKE_ICON = "https://cdn.discordapp.com/attachments/740650744830623756/742020790471491668/snowflake.png";

View file

@ -1,6 +1,6 @@
import { APIEmbed } from "discord.js";
import { GuildPluginData } from "knub";
import { CaseTypes } from "../../../data/CaseTypes";
import { CaseTypes } from "../../../data/CaseTypes.js";
import {
EmbedWith,
messageLink,
@ -12,8 +12,8 @@ import {
trimEmptyLines,
trimLines,
UnknownUser,
} from "../../../utils";
import { UtilityPluginType } from "../types";
} from "../../../utils.js";
import { UtilityPluginType } from "../types.js";
const MAX_ROLES_TO_DISPLAY = 15;

View file

@ -1,6 +1,6 @@
import { GuildMember, Snowflake } from "discord.js";
import { GuildPluginData } from "knub";
import { UtilityPluginType } from "../types";
import { UtilityPluginType } from "../types.js";
export async function hasPermission(
pluginData: GuildPluginData<UtilityPluginType>,

View file

@ -1,5 +1,5 @@
import { ZeppelinPluginInfo } from "../../types";
import { zUtilityConfig } from "./types";
import { ZeppelinPluginInfo } from "../../types.js";
import { zUtilityConfig } from "./types.js";
export const utilityPluginInfo: ZeppelinPluginInfo = {
showInDocs: true,

View file

@ -1,5 +1,5 @@
import { Guild } from "discord.js";
import { HOURS, noop } from "../../utils";
import { HOURS, noop } from "../../utils.js";
const MEMBER_REFRESH_FREQUENCY = 1 * HOURS; // How often to do a full member refresh when using commands that need it
const memberRefreshLog = new Map<string, { time: number; promise: Promise<void> }>();

View file

@ -12,8 +12,8 @@ import {
import escapeStringRegexp from "escape-string-regexp";
import { ArgsFromSignatureOrArray, GuildPluginData } from "knub";
import moment from "moment-timezone";
import { RegExpRunner, allowTimeout } from "../../RegExpRunner";
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
import { RegExpRunner, allowTimeout } from "../../RegExpRunner.js";
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils.js";
import {
InvalidRegexError,
MINUTES,
@ -22,14 +22,14 @@ import {
renderUsername,
sorter,
trimLines,
} from "../../utils";
import { asyncFilter } from "../../utils/async";
import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions";
import { banSearchSignature } from "./commands/BanSearchCmd";
import { searchCmdSignature } from "./commands/SearchCmd";
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed";
import { refreshMembersIfNeeded } from "./refreshMembers";
import { UtilityPluginType } from "./types";
} from "../../utils.js";
import { asyncFilter } from "../../utils/async.js";
import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions.js";
import { banSearchSignature } from "./commands/BanSearchCmd.js";
import { searchCmdSignature } from "./commands/SearchCmd.js";
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed.js";
import { refreshMembersIfNeeded } from "./refreshMembers.js";
import { UtilityPluginType } from "./types.js";
import Timeout = NodeJS.Timeout;
const SEARCH_RESULTS_PER_PAGE = 15;

View file

@ -1,11 +1,11 @@
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub";
import z from "zod";
import { RegExpRunner } from "../../RegExpRunner";
import { GuildArchives } from "../../data/GuildArchives";
import { GuildCases } from "../../data/GuildCases";
import { GuildLogs } from "../../data/GuildLogs";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { Supporters } from "../../data/Supporters";
import { RegExpRunner } from "../../RegExpRunner.js";
import { GuildArchives } from "../../data/GuildArchives.js";
import { GuildCases } from "../../data/GuildCases.js";
import { GuildLogs } from "../../data/GuildLogs.js";
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
import { Supporters } from "../../data/Supporters.js";
export const zUtilityConfig = z.strictObject({
can_roles: z.boolean(),