3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 04:45: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

@ -1,4 +1,4 @@
import { Channel, Message, NewsChannel, TextChannel, ThreadChannel } from "discord.js";
import { Channel, GuildTextBasedChannel, Message, NewsChannel, TextChannel, ThreadChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
@ -20,7 +20,7 @@ const MAX_REPEAT_UNTIL = moment.utc().add(100, "years");
export async function actualPostCmd(
pluginData: GuildPluginData<PostPluginType>,
msg: Message,
targetChannel: Channel,
targetChannel: GuildTextBasedChannel,
content: StrictMessageContent,
opts: {
"enable-mentions"?: boolean;
@ -30,12 +30,8 @@ export async function actualPostCmd(
"repeat-times"?: number;
} = {},
) {
if (
!(targetChannel instanceof TextChannel) &&
!(targetChannel instanceof NewsChannel) &&
!(targetChannel instanceof ThreadChannel)
) {
msg.channel.send(errorMessage("Specified channel is not a text channel, announcement channel, or thread"));
if (!targetChannel.isText()) {
msg.channel.send(errorMessage("Specified channel is not a text-based channel"));
return;
}

View file

@ -1,4 +1,12 @@
import { Message, MessageAttachment, MessageOptions, NewsChannel, TextChannel, ThreadChannel } from "discord.js";
import {
GuildTextBasedChannel,
Message,
MessageAttachment,
MessageOptions,
NewsChannel,
TextChannel,
ThreadChannel,
} from "discord.js";
import fs from "fs";
import { GuildPluginData } from "knub";
import { downloadFile } from "../../../utils";
@ -9,7 +17,7 @@ const fsp = fs.promises;
export async function postMessage(
pluginData: GuildPluginData<PostPluginType>,
channel: TextChannel | NewsChannel | ThreadChannel,
channel: GuildTextBasedChannel,
content: MessageOptions,
attachments: MessageAttachment[] = [],
enableMentions: boolean = false,