Files
discord-decomp/modules/guild_scheduled_events/native/handleAcceptEventInstantInvite.tsx
T
2026-11-01 12:12:55 +02:00

24 lines
1.0 KiB
TypeScript

// Metro module 9510 (f9511).
import GuildScheduledEventStore from "../GuildScheduledEventStore";
import { handleNSFWGuildInvite } from "../../age_gate/native/AgeGateUtils";
import { isGuildScheduledEventInviteEmbed } from "../../instant_invite/InviteTypeUtils";
import InstantInviteActionCreators from "../../../actions/InstantInviteActionCreators";
import { transitionToEventDetailsFromInvite } from "./GuildScheduledEventModalActionCreators";
export default function handleAcceptEventInstantInvite(a0) {
if (!handleNSFWGuildInvite(a0) && isGuildScheduledEventInviteEmbed(a0) && a0.code != null) {
const id = a0.guild_scheduled_event?.id;
const guildScheduledEvent = GuildScheduledEventStore.getGuildScheduledEvent(id);
if (guildScheduledEvent != null) {
InstantInviteActionCreators.acceptInvite({
inviteKey: a0.code,
context: {
location: "Guild Scheduled Event Invite Button Embed"
},
callback: () => {
transitionToEventDetailsFromInvite(guildScheduledEvent);
}
});
}
}
};