3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 13:55:03 +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,11 +1,11 @@
import { PluginOptions, guildPlugin } from "knub";
import z from "zod";
import { Queue } from "../../Queue";
import { Webhooks } from "../../data/Webhooks";
import { makePublicFn } from "../../pluginUtils";
import { editMessage } from "./functions/editMessage";
import { sendMessage } from "./functions/sendMessage";
import { InternalPosterPluginType } from "./types";
import { Queue } from "../../Queue.js";
import { Webhooks } from "../../data/Webhooks.js";
import { makePublicFn } from "../../pluginUtils.js";
import { editMessage } from "./functions/editMessage.js";
import { sendMessage } from "./functions/sendMessage.js";
import { InternalPosterPluginType } from "./types.js";
const defaultOptions: PluginOptions<InternalPosterPluginType> = {
config: {},

View file

@ -1,7 +1,7 @@
import { Message, MessageEditOptions, WebhookClient, WebhookMessageEditOptions } from "discord.js";
import { GuildPluginData } from "knub";
import { isDiscordAPIError, noop } from "../../../utils";
import { InternalPosterPluginType } from "../types";
import { isDiscordAPIError, noop } from "../../../utils.js";
import { InternalPosterPluginType } from "../types.js";
/**
* Sends a message using a webhook or direct API requests, preferring webhooks when possible.

View file

@ -1,7 +1,7 @@
import { WebhookClient } from "discord.js";
import { GuildPluginData } from "knub";
import { InternalPosterPluginType } from "../types";
import { getOrCreateWebhookForChannel, WebhookableChannel } from "./getOrCreateWebhookForChannel";
import { InternalPosterPluginType } from "../types.js";
import { getOrCreateWebhookForChannel, WebhookableChannel } from "./getOrCreateWebhookForChannel.js";
export async function getOrCreateWebhookClientForChannel(
pluginData: GuildPluginData<InternalPosterPluginType>,

View file

@ -1,7 +1,7 @@
import { GuildBasedChannel, PermissionsBitField } from "discord.js";
import { GuildPluginData } from "knub";
import { isDiscordAPIError } from "../../../utils";
import { InternalPosterPluginType } from "../types";
import { isDiscordAPIError } from "../../../utils.js";
import { InternalPosterPluginType } from "../types.js";
type WebhookInfo = [id: string, token: string];

View file

@ -1,9 +1,9 @@
import { GuildTextBasedChannel, MessageCreateOptions, WebhookClient } from "discord.js";
import { GuildPluginData } from "knub";
import { isDiscordAPIError } from "../../../utils";
import { InternalPosterPluginType } from "../types";
import { getOrCreateWebhookClientForChannel } from "./getOrCreateWebhookClientForChannel";
import { channelIsWebhookable } from "./getOrCreateWebhookForChannel";
import { isDiscordAPIError } from "../../../utils.js";
import { InternalPosterPluginType } from "../types.js";
import { getOrCreateWebhookClientForChannel } from "./getOrCreateWebhookClientForChannel.js";
import { channelIsWebhookable } from "./getOrCreateWebhookForChannel.js";
export type InternalPosterMessageResult = {
id: string;

View file

@ -1,4 +1,4 @@
import { ZeppelinPluginInfo } from "../../types";
import { ZeppelinPluginInfo } from "../../types.js";
export const internalPosterPluginInfo: ZeppelinPluginInfo = {
prettyName: "Internal poster",

View file

@ -1,7 +1,7 @@
import { WebhookClient } from "discord.js";
import { BasePluginType } from "knub";
import { Queue } from "../../Queue";
import { Webhooks } from "../../data/Webhooks";
import { Queue } from "../../Queue.js";
import { Webhooks } from "../../data/Webhooks.js";
export interface InternalPosterPluginType extends BasePluginType {
state: {