Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Commit

Permalink
fix createInteraction crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Tricked-dev committed Aug 1, 2021
1 parent eb64fc4 commit e816c3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
book
test.ts
9 changes: 5 additions & 4 deletions src/util/createNaticoInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import {
sendInteractionResponse,
DiscordenoInteractionResponse,
editSlashResponse,
snowflakeToBigint,
} from "../../deps.ts";
import { NaticoCommandUtil } from "../struct/commands/commandUtil.ts";
export async function createNaticoInteraction(
interaction: SlashCommandInteraction,
handler: any
): Promise<DiscordenoMessage> {
const guildId = BigInt(interaction.guildId!);
const guildId = snowflakeToBigint(interaction.guildId ?? "0");
const member = await structures.createDiscordenoMember(interaction.member!, guildId);

const channelId = BigInt(interaction.channelId!);
Expand All @@ -24,7 +25,7 @@ export async function createNaticoInteraction(
};

const message: DiscordenoMessage | any = {
id: BigInt(interaction.id),
id: snowflakeToBigint(interaction.id),
isBot: false,
// bitfield: interaction.bitfield,
get tag() {
Expand All @@ -35,12 +36,12 @@ export async function createNaticoInteraction(
},
guildId: guildId,
channelId: channelId,
authorId: BigInt(interaction.member!.user.id),
authorId: snowflakeToBigint(interaction.member!.user.id),
content: "",
mentionedUserIds: [],
mentionedRoleIds: [],
get timestamp() {
return Number(BigInt(this.id) / 4194304n + 1420070400000n);
return Number(snowflakeToBigint(this.id) / 4194304n + 1420070400000n);
},
member: member,
get channel() {
Expand Down

0 comments on commit e816c3e

Please sign in to comment.