Turn on strict TS compilation. Fix up and tweak types accordingly.
This commit is contained in:
parent
690955a399
commit
629002b8d9
172 changed files with 720 additions and 534 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Member, TextableChannel, VoiceChannel } from "eris";
|
||||
import { Invite, Member, TextableChannel, VoiceChannel } from "eris";
|
||||
import { getInviteLink } from "knub/dist/helpers";
|
||||
import { createOrReuseInvite } from "./createOrReuseInvite";
|
||||
import { GuildPluginData } from "knub";
|
||||
|
@ -11,12 +11,14 @@ export async function sendWhere(
|
|||
channel: TextableChannel,
|
||||
prepend: string,
|
||||
) {
|
||||
const voice = pluginData.guild.channels.get(member.voiceState.channelID) as VoiceChannel;
|
||||
const voice = member.voiceState.channelID
|
||||
? (pluginData.guild.channels.get(member.voiceState.channelID) as VoiceChannel)
|
||||
: null;
|
||||
|
||||
if (voice == null) {
|
||||
channel.createMessage(prepend + "That user is not in a channel");
|
||||
} else {
|
||||
let invite = null;
|
||||
let invite: Invite;
|
||||
try {
|
||||
invite = await createOrReuseInvite(voice);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue