3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Update to discord.js v13.8.0, adding support for text-in-voice

This commit is contained in:
Dragory 2022-06-13 21:19:56 +03:00
parent ba78103807
commit b05fbe1d04
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
32 changed files with 151 additions and 149 deletions

View file

@ -3,7 +3,7 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import {
channelToTemplateSafeChannel,
savedMessageToTemplateSafeSavedMessage,
@ -15,7 +15,7 @@ import { deactivateMentions, disableCodeBlocks } from "knub/dist/helpers";
interface LogCensorData {
user: User | UnknownUser;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
reason: string;
message: SavedMessage;
}

View file

@ -3,7 +3,7 @@ import { FORMAT_NO_TIMESTAMP, LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import {
channelToTemplateSafeChannel,
savedMessageToTemplateSafeSavedMessage,
@ -16,7 +16,7 @@ import { UnknownUser, useMediaUrls } from "../../../utils";
interface LogMessageDeleteData {
user: User | UnknownUser;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
message: SavedMessage;
}

View file

@ -3,12 +3,12 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel } from "discord.js";
import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects";
interface LogMessageDeleteBareData {
messageId: string;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
}
export function logMessageDeleteBare(pluginData: GuildPluginData<LogsPluginType>, data: LogMessageDeleteBareData) {

View file

@ -3,13 +3,13 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel } from "discord.js";
import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects";
interface LogMessageDeleteBulkData {
count: number;
authorIds: string[];
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
archiveUrl: string;
}

View file

@ -3,7 +3,7 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import {
channelToTemplateSafeChannel,
savedMessageToTemplateSafeSavedMessage,
@ -14,7 +14,7 @@ import { UnknownUser } from "../../../utils";
interface LogMessageEditData {
user: User | UnknownUser;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
before: SavedMessage;
after: SavedMessage;
}

View file

@ -3,12 +3,12 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
interface LogPostedScheduledMessageData {
author: User;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
messageId: string;
}

View file

@ -3,12 +3,12 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
interface LogRepeatedMessageData {
author: User;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
datetime: string;
date: string;
time: string;

View file

@ -3,12 +3,12 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
interface LogScheduledMessageData {
author: User;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
datetime: string;
date: string;
time: string;

View file

@ -3,12 +3,12 @@ import { LogsPluginType } from "../types";
import { LogType } from "../../../data/LogType";
import { log } from "../util/log";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter";
import { BaseGuildTextChannel, ThreadChannel, User } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, ThreadChannel, User } from "discord.js";
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
interface LogScheduledRepeatedMessageData {
author: User;
channel: BaseGuildTextChannel | ThreadChannel;
channel: GuildTextBasedChannel;
datetime: string;
date: string;
time: string;

View file

@ -83,7 +83,7 @@ export async function log<TLogType extends keyof ILogTypeData>(
logChannelLoop: for (const [channelId, opts] of Object.entries(logChannels)) {
const channel = pluginData.guild.channels.cache.get(channelId as Snowflake);
if (!channel || !(channel instanceof TextChannel)) continue;
if (!channel?.isText()) continue;
if (pluginData.state.channelCooldowns.isOnCooldown(channelId)) continue;
if (opts.include?.length && !opts.include.includes(typeStr)) continue;
if (opts.exclude && opts.exclude.includes(typeStr)) continue;

View file

@ -1,4 +1,4 @@
import { BaseGuildTextChannel, Snowflake, ThreadChannel } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, Snowflake, ThreadChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { SavedMessage } from "../../../data/entities/SavedMessage";
import { LogType } from "../../../data/LogType";
@ -12,9 +12,9 @@ export async function onMessageDeleteBulk(pluginData: GuildPluginData<LogsPlugin
return;
}
const channel = pluginData.guild.channels.cache.get(savedMessages[0].channel_id as Snowflake) as
| BaseGuildTextChannel
| ThreadChannel;
const channel = pluginData.guild.channels.cache.get(
savedMessages[0].channel_id as Snowflake,
) as GuildTextBasedChannel;
const archiveId = await pluginData.state.archives.createFromSavedMessages(savedMessages, pluginData.guild);
const archiveUrl = pluginData.state.archives.getUrl(getBaseUrl(pluginData), archiveId);
const authorIds = Array.from(new Set(savedMessages.map((item) => `\`${item.user_id}\``)));

View file

@ -1,4 +1,4 @@
import { BaseGuildTextChannel, MessageEmbed, Snowflake, ThreadChannel } from "discord.js";
import { BaseGuildTextChannel, GuildTextBasedChannel, MessageEmbed, Snowflake, ThreadChannel } from "discord.js";
import { GuildPluginData } from "knub";
import cloneDeep from "lodash.clonedeep";
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
@ -49,9 +49,7 @@ export async function onMessageUpdate(
}
const user = await resolveUser(pluginData.client, savedMessage.user_id);
const channel = pluginData.guild.channels.resolve(savedMessage.channel_id as Snowflake)! as
| BaseGuildTextChannel
| ThreadChannel;
const channel = pluginData.guild.channels.resolve(savedMessage.channel_id as Snowflake)! as GuildTextBasedChannel;
logMessageEdit(pluginData, {
user,