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

Type fixes for djs

This commit is contained in:
Dark 2021-06-30 04:56:56 +02:00
parent 653d6c1dc2
commit 0822fc15e5
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
130 changed files with 8877 additions and 411 deletions

View file

@ -1,4 +1,4 @@
import { TextChannel } from "discord.js";
import { Snowflake, TextChannel } from "discord.js";
import { locateUserEvt } from "../types";
import { sendAlerts } from "../utils/sendAlerts";
@ -17,7 +17,7 @@ export const VoiceStateUpdateAlertEvt = locateUserEvt({
const voiceChannel = meta.args.oldState.channel!;
triggeredAlerts.forEach(alert => {
const txtChannel = meta.pluginData.guild.channels.resolve(alert.channel_id) as TextChannel;
const txtChannel = meta.pluginData.guild.channels.resolve(alert.channel_id as Snowflake) as TextChannel;
txtChannel.send(
`🔴 <@!${alert.requestor_id}> the user <@!${alert.user_id}> disconnected out of \`<#!${voiceChannel.id}>\``,
);

View file

@ -1,4 +1,4 @@
import { GuildMember, TextChannel } from "discord.js";
import { GuildMember, Snowflake, TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { sendErrorMessage } from "../../../pluginUtils";
import { LocateUserPluginType } from "../types";
@ -9,7 +9,7 @@ export async function moveMember(
target: GuildMember,
errorChannel: TextChannel,
) {
const modMember: GuildMember = await pluginData.guild.members.fetch(toMoveID);
const modMember: GuildMember = await pluginData.guild.members.fetch(toMoveID as Snowflake);
if (modMember.voice.channelID != null) {
try {
await modMember.edit({

View file

@ -1,4 +1,4 @@
import { TextChannel } from "discord.js";
import { Snowflake, TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { resolveMember } from "../../../utils";
import { LocateUserPluginType } from "../types";
@ -12,7 +12,7 @@ export async function sendAlerts(pluginData: GuildPluginData<LocateUserPluginTyp
triggeredAlerts.forEach(alert => {
const prepend = `<@!${alert.requestor_id}>, an alert requested by you has triggered!\nReminder: \`${alert.body}\`\n`;
const txtChannel = pluginData.guild.channels.resolve(alert.channel_id) as TextChannel;
const txtChannel = pluginData.guild.channels.resolve(alert.channel_id as Snowflake) as TextChannel;
sendWhere(pluginData, member, txtChannel, prepend);
if (alert.active) {
moveMember(pluginData, alert.requestor_id, member, txtChannel);

View file

@ -28,7 +28,6 @@ export async function sendWhere(
channel.send({
content: prepend + `<@${member.id}> is in the following channel: \`${voice.name}\` ${getInviteLink(invite)}`,
allowedMentions: { parse: ["users"] },
split: false,
});
}
}