Type fixes for djs
This commit is contained in:
parent
653d6c1dc2
commit
0822fc15e5
130 changed files with 8877 additions and 411 deletions
|
@ -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}>\``,
|
||||
);
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue