mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 00:05:01 +00:00
chore: esm imports
This will make merging this into 'next' much easier.
This commit is contained in:
parent
1f0c7a4349
commit
45e3fe2ef0
798 changed files with 3633 additions and 3633 deletions
|
@ -1,15 +1,15 @@
|
|||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd";
|
||||
import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd";
|
||||
import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd";
|
||||
import { AddReactionRoleEvt } from "./events/AddReactionRoleEvt";
|
||||
import { MessageDeletedEvt } from "./events/MessageDeletedEvt";
|
||||
import { ReactionRolesPluginType, zReactionRolesConfig } from "./types";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles.js";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin.js";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin.js";
|
||||
import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd.js";
|
||||
import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd.js";
|
||||
import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd.js";
|
||||
import { AddReactionRoleEvt } from "./events/AddReactionRoleEvt.js";
|
||||
import { MessageDeletedEvt } from "./events/MessageDeletedEvt.js";
|
||||
import { ReactionRolesPluginType, zReactionRolesConfig } from "./types.js";
|
||||
|
||||
const MIN_AUTO_REFRESH = 1000 * 60 * 15; // 15min minimum, let's not abuse the API
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Message } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { isDiscordAPIError } from "../../../utils";
|
||||
import { reactionRolesCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { isDiscordAPIError } from "../../../utils.js";
|
||||
import { reactionRolesCmd } from "../types.js";
|
||||
|
||||
export const ClearReactionRolesCmd = reactionRolesCmd({
|
||||
trigger: "reaction_roles clear",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canUseEmoji, isDiscordAPIError, isValidEmoji, noop, trimPluginDescription } from "../../../utils";
|
||||
import { canReadChannel } from "../../../utils/canReadChannel";
|
||||
import { TReactionRolePair, reactionRolesCmd } from "../types";
|
||||
import { applyReactionRoleReactionsToMessage } from "../util/applyReactionRoleReactionsToMessage";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { canUseEmoji, isDiscordAPIError, isValidEmoji, noop, trimPluginDescription } from "../../../utils.js";
|
||||
import { canReadChannel } from "../../../utils/canReadChannel.js";
|
||||
import { TReactionRolePair, reactionRolesCmd } from "../types.js";
|
||||
import { applyReactionRoleReactionsToMessage } from "../util/applyReactionRoleReactionsToMessage.js";
|
||||
|
||||
const CLEAR_ROLES_EMOJI = "❌";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { reactionRolesCmd } from "../types";
|
||||
import { refreshReactionRoles } from "../util/refreshReactionRoles";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { reactionRolesCmd } from "../types.js";
|
||||
import { refreshReactionRoles } from "../util/refreshReactionRoles.js";
|
||||
|
||||
export const RefreshReactionRolesCmd = reactionRolesCmd({
|
||||
trigger: "reaction_roles refresh",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Message } from "discord.js";
|
||||
import { noop, resolveMember, sleep } from "../../../utils";
|
||||
import { reactionRolesEvt } from "../types";
|
||||
import { addMemberPendingRoleChange } from "../util/addMemberPendingRoleChange";
|
||||
import { noop, resolveMember, sleep } from "../../../utils.js";
|
||||
import { reactionRolesEvt } from "../types.js";
|
||||
import { addMemberPendingRoleChange } from "../util/addMemberPendingRoleChange.js";
|
||||
|
||||
const CLEAR_ROLES_EMOJI = "❌";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { reactionRolesEvt } from "../types";
|
||||
import { reactionRolesEvt } from "../types.js";
|
||||
|
||||
export const MessageDeletedEvt = reactionRolesEvt({
|
||||
event: "messageDelete",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { zReactionRolesConfig } from "./types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
import { zReactionRolesConfig } from "./types.js";
|
||||
|
||||
export const reactionRolesPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Reaction roles",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand, pluginUtils } from "knub";
|
||||
import z from "zod";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles.js";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin.js";
|
||||
|
||||
export const zReactionRolesConfig = z.strictObject({
|
||||
auto_refresh_interval: z.number(),
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { logger } from "../../../logger";
|
||||
import { renderUsername, resolveMember } from "../../../utils";
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
import { PendingMemberRoleChanges, ReactionRolesPluginType, RoleChangeMode } from "../types";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { renderUsername, resolveMember } from "../../../utils.js";
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers.js";
|
||||
import { PendingMemberRoleChanges, ReactionRolesPluginType, RoleChangeMode } from "../types.js";
|
||||
|
||||
const ROLE_CHANGE_BATCH_DEBOUNCE_TIME = 1500;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ReactionRole } from "../../../data/entities/ReactionRole";
|
||||
import { isDiscordAPIError, sleep } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ReactionRolesPluginType } from "../types";
|
||||
import { ReactionRole } from "../../../data/entities/ReactionRole.js";
|
||||
import { isDiscordAPIError, sleep } from "../../../utils.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { ReactionRolesPluginType } from "../types.js";
|
||||
|
||||
const CLEAR_ROLES_EMOJI = "❌";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ReactionRolesPluginType } from "../types";
|
||||
import { runAutoRefresh } from "./runAutoRefresh";
|
||||
import { ReactionRolesPluginType } from "../types.js";
|
||||
import { runAutoRefresh } from "./runAutoRefresh.js";
|
||||
|
||||
export async function autoRefreshLoop(pluginData: GuildPluginData<ReactionRolesPluginType>, interval: number) {
|
||||
pluginData.state.autoRefreshTimeout = setTimeout(async () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ReactionRolesPluginType } from "../types";
|
||||
import { applyReactionRoleReactionsToMessage } from "./applyReactionRoleReactionsToMessage";
|
||||
import { ReactionRolesPluginType } from "../types.js";
|
||||
import { applyReactionRoleReactionsToMessage } from "./applyReactionRoleReactionsToMessage.js";
|
||||
|
||||
export async function refreshReactionRoles(
|
||||
pluginData: GuildPluginData<ReactionRolesPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ReactionRolesPluginType } from "../types";
|
||||
import { refreshReactionRoles } from "./refreshReactionRoles";
|
||||
import { ReactionRolesPluginType } from "../types.js";
|
||||
import { refreshReactionRoles } from "./refreshReactionRoles.js";
|
||||
|
||||
export async function runAutoRefresh(pluginData: GuildPluginData<ReactionRolesPluginType>) {
|
||||
// Refresh reaction roles on all reaction role messages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue