mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
Update to discord.js v13.8.0, adding support for text-in-voice
This commit is contained in:
parent
ba78103807
commit
b05fbe1d04
32 changed files with 151 additions and 149 deletions
|
@ -1,4 +1,4 @@
|
|||
import { GuildChannel, Permissions } from "discord.js";
|
||||
import { GuildChannel, GuildTextBasedChannel, Permissions } from "discord.js";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { isDiscordAPIError } from "../../../utils";
|
||||
import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions";
|
||||
|
@ -16,7 +16,10 @@ export const AddReactionsEvt = autoReactionsEvt({
|
|||
allowSelf: true,
|
||||
|
||||
async listener({ pluginData, args: { message } }) {
|
||||
const channel = await message.guild?.channels.fetch(message.channelId);
|
||||
const channel = (await message.guild?.channels.fetch(message.channelId)) as
|
||||
| GuildTextBasedChannel
|
||||
| null
|
||||
| undefined;
|
||||
if (!channel) {
|
||||
return;
|
||||
}
|
||||
|
@ -37,11 +40,7 @@ export const AddReactionsEvt = autoReactionsEvt({
|
|||
|
||||
const me = pluginData.guild.members.cache.get(pluginData.client.user!.id)!;
|
||||
if (me) {
|
||||
const missingPermissions = getMissingChannelPermissions(
|
||||
me,
|
||||
channel as GuildChannel,
|
||||
readChannelPermissions | p.ADD_REACTIONS,
|
||||
);
|
||||
const missingPermissions = getMissingChannelPermissions(me, channel, readChannelPermissions | p.ADD_REACTIONS);
|
||||
if (missingPermissions) {
|
||||
const logs = pluginData.getPlugin(LogsPlugin);
|
||||
logs.logBotAlert({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue