Start move to d.js

This commit is contained in:
Dark 2021-05-31 03:30:55 +02:00
parent a9e0466e33
commit 9fc045cd38
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
17 changed files with 339 additions and 6317 deletions

View file

@ -1,7 +1,7 @@
import { disableInlineCode, isSnowflake } from "../utils";
import { getChannelIdFromMessageId } from "../data/getChannelIdFromMessageId";
import { GuildPluginData, TypeConversionError } from "knub";
import { TextChannel } from "eris";
import { TextChannel } from "discord.js";
const channelAndMessageIdRegex = /^(\d+)[\-\/](\d+)$/;
const messageLinkRegex = /^https:\/\/(?:\w+\.)?discord(?:app)?\.com\/channels\/\d+\/(\d+)\/(\d+)$/i;
@ -46,7 +46,7 @@ export async function resolveMessageTarget(pluginData: GuildPluginData<any>, val
return null;
}
const channel = pluginData.guild.channels.get(result.channelId);
const channel = pluginData.guild.channels.resolve(result.channelId);
if (!channel || !(channel instanceof TextChannel)) {
return null;
}