fix: type errors

This commit is contained in:
Skillz4Killz
2021-06-19 14:04:49 +00:00
committed by GitHub
parent 1e92d44348
commit e12c36dbad
5 changed files with 11 additions and 11 deletions

View File

@@ -15,8 +15,8 @@ export async function handleThreadMemberUpdate(data: DiscordGatewayPayload) {
const member = {
...payload,
id: snowflakeToBigint(payload.id),
userId: snowflakeToBigint(payload.userId),
id: snowflakeToBigint(payload.id!),
userId: snowflakeToBigint(payload.userId!),
joinTimestamp: Date.parse(payload.joinTimestamp),
};

View File

@@ -21,9 +21,9 @@ export async function getActiveThreads(channelId: bigint) {
);
for (const member of result.members) {
const thread = threads.get(snowflakeToBigint(member.id));
thread?.members.set(snowflakeToBigint(member.userId), {
userId: snowflakeToBigint(member.userId),
const thread = threads.get(snowflakeToBigint(member.id!));
thread?.members.set(snowflakeToBigint(member.userId!), {
userId: snowflakeToBigint(member.userId!),
flags: member.flags,
joinTimestamp: Date.parse(member.joinTimestamp),
});

View File

@@ -41,9 +41,9 @@ export async function getArchivedThreads(
);
for (const member of result.members) {
const thread = threads.get(snowflakeToBigint(member.id));
thread?.members.set(snowflakeToBigint(member.userId), {
userId: snowflakeToBigint(member.userId),
const thread = threads.get(snowflakeToBigint(member.id!));
thread?.members.set(snowflakeToBigint(member.userId!), {
userId: snowflakeToBigint(member.userId!),
flags: member.flags,
joinTimestamp: Date.parse(member.joinTimestamp),
});

View File

@@ -20,7 +20,7 @@ export async function connectToVoiceChannel(
guildId,
channelId,
selfMute: Boolean(options?.selfMute),
selfDeaf: options.selfDeaf ?? true,
selfDeaf: options?.selfDeaf ?? true,
}),
});
}

View File

@@ -4,8 +4,8 @@ import { snowflakeToBigint } from "../bigint.ts";
export function threadMemberModified(member: ThreadMember) {
return {
...member,
id: snowflakeToBigint(member.id),
userId: snowflakeToBigint(member.userId),
id: snowflakeToBigint(member.id!),
userId: snowflakeToBigint(member.userId!),
joinTimestamp: Date.parse(member.joinTimestamp),
} as ThreadMemberModified;
}