2026-08-25 06:04:03 +00:00
// Module ID: 7063
// Function ID: 7064
2026-07-20 16:05:17 +00:00
// Name: trackInvite
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 5, 5102, 7064, 7065, 7066, 7283, 7285, 7201, 5325, 4402, 1218, 1391, 7286, 1910, 4364, 4623, 4025, 4469, 4395, 7291, 1922, 676, 7293, 6050, 4373, 17, 3, 4363, 7294, 4368, 7297, 7298, 4588, 7303, 5273, 7322, 698, 4365, 7339, 7342, 4640, 7344, 1236, 1995, 4955, 709, 7356, 4593, 7357, 7206, 530, 4625, 5949, 9, 7094, 5097, 11, 1956, 1976, 7083, 5100, 7358, 7359, 7362, 7363, 4043, 7288, 1403, 5994, 7364, 7433, 7437, 7440, 7446, 7447, 7466, 687, 7467, 1955, 7368, 1363, 7468, 4744, 2]
2026-07-23 10:11:24 +00:00
2026-08-25 06:04:03 +00:00
// Module 7063 (trackInvite)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */ ;
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */ ;
import dispatcherDefault from "dispatcher" /* 709 */ ;
import getSystemLocale from "getSystemLocale" /* 1236 */ ;
import hasFlag from "hasFlag" /* 1403 */ ;
2026-08-25 06:04:03 +00:00
import combinedDefault from "combined" /* 1995 */ ;
import getUncachedChannelPermissionsDefault from "getUncachedChannelPermissions" /* 4025 */ ;
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4043 */ ;
import readSnowflake from "readSnowflake" /* 4365 */ ;
import collectGuildAnalyticsMetadataDefault from "collectGuildAnalyticsMetadata" /* 4588 */ ;
import t2 from "t" /* 4593 */ ;
import items2 from "items" /* 4955 */ ;
import redactionSettingToRenderedString from "redactionSettingToRenderedString" /* 7206 */ ;
import createMessage from "createMessage" /* 7356 */ ;
import createMessageDefault from "createMessage" /* 7356 */ ;
import snowflakeSequence from "snowflakeSequence" /* 7357 */ ;
import getInviteURLDefault from "getInviteURL" /* 7362 */ ;
import fetchAndReconcileGiftIntentDismissals from "fetchAndReconcileGiftIntentDismissals" /* 7468 */ ;
2026-08-24 06:08:38 +00:00
import closure_4 from "_slicedToArray" /* 32 */ ;
import closure_5 from "asyncGeneratorStep" /* 5 */ ;
2026-08-25 06:04:03 +00:00
import closure_6 from "_handleConnectionOpen" /* 5102 */ ;
import closure_7 from "updateSubmittedGuildJoinRequestTotal" /* 7064 */ ;
import closure_8 from "handleGuildTemplateResolveSuccess" /* 7065 */ ;
import closure_9 from "trackRoundtrip" /* 7066 */ ;
import closure_10 from "initialize" /* 7283 */ ;
import closure_11 from "getState" /* 7285 */ ;
import closure_12 from "processMessage" /* 7201 */ ;
import { ReferencedMessageState } from "processMessage" /* 7201 */ ;
import closure_14 from "loadSavedGuildStickers" /* 5325 */ ;
import closure_15 from "reset" /* 4402 */ ;
2026-08-24 06:08:38 +00:00
import closure_16 from "fetchFingerprint" /* 1218 */ ;
import closure_17 from "ensureGuildLoaded" /* 1391 */ ;
2026-08-25 06:04:03 +00:00
import closure_18 from "initialize" /* 7286 */ ;
2026-08-24 06:08:38 +00:00
import closure_19 from "createGuildRecordFromRust" /* 1910 */ ;
2026-08-25 06:04:03 +00:00
import closure_20 from "updateInvite" /* 4364 */ ;
import closure_21 from "reinjectEphemerals" /* 4623 */ ;
import closure_22 from "sortActivity" /* 4469 */ ;
import closure_23 from "generateOldThreadCutoff" /* 4395 */ ;
import { SlowmodeType } from "setCooldown" /* 7291 */ ;
2026-08-24 06:08:38 +00:00
import closure_25 from "mergeGuildAvatar" /* 1922 */ ;
import ME from "ME" /* 676 */ ;
2026-08-25 06:04:03 +00:00
import { LinkType } from "LinkType" /* 7293 */ ;
import { GuildTemplateStates } from "GUILD_TEMPLATES_MEMBER_COUNT_PROMOTION_THRESHOLD" /* 6050 */ ;
import MESSAGE_GROUP_SPACING from "MESSAGE_GROUP_SPACING" /* 4373 */ ;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1 ;
2026-07-20 16:05:17 +00:00
function trackInvite ( channelId ) {
( { inviteKey , messageId , location : _location , inviteAnalyticsMetadata , overrideProperties } = channelId ) ;
if ( overrideProperties === undefined ) {
overrideProperties = { } ;
}
2026-07-23 10:11:24 +00:00
id = id . getId ( ) ;
invite = invite . getInvite ( inviteKey ) ;
2026-08-24 06:08:38 +00:00
let obj = readSnowflake ;
2026-07-20 16:05:17 +00:00
const result = obj . parseExtraDataFromInviteKey ( inviteKey ) ;
let result1 = null != invite ;
if ( result1 ) {
2026-08-25 06:04:03 +00:00
let tmp3Result = tmp3 ( 7339 ) ;
2026-07-29 08:29:29 +00:00
result1 = tmp3Result . isEmbeddedApplicationInvite ( invite ) ;
2026-07-20 16:05:17 +00:00
}
let id1 ;
2026-07-29 08:29:29 +00:00
if ( invite != null ) {
2026-07-20 16:05:17 +00:00
const target_application = invite . target_application ;
2026-07-29 08:29:29 +00:00
if ( target_application != null ) {
2026-07-20 16:05:17 +00:00
id1 = target_application . id ;
}
}
if ( tmp8 ) {
2026-08-25 06:04:03 +00:00
tmp3Result = tmp3 ( 7298 ) ;
2026-07-29 08:29:29 +00:00
const result2 = tmp3Result . trackAppEmbedLinkSent ( id1 , LinkType . ACTIVITY_INVITE , id ) ;
2026-07-20 16:05:17 +00:00
}
let channel = store . getChannel ( channelId . channelId ) ;
if ( null != channel ) {
if ( channel . isMultiUserDM ( ) ) {
let GDM_INVITE = constants3 . GDM_INVITE ;
} else {
GDM_INVITE = null ;
if ( ! channel . isPrivate ( ) ) {
GDM_INVITE = constants3 . SERVER_INVITE ;
}
}
obj = { } ;
let STREAM = GDM_INVITE ;
if ( null != invite ) {
STREAM = GDM_INVITE ;
if ( invite . state === constants5 . RESOLVED ) {
STREAM = GDM_INVITE ;
if ( null != invite . channel ) {
channel = invite . channel ;
obj . invite_channel_id = channel . id ;
const guild = invite . guild ;
let id2 ;
2026-07-29 08:29:29 +00:00
if ( guild != null ) {
2026-07-20 16:05:17 +00:00
id2 = guild . id ;
}
obj . invite_guild_id = id2 ;
obj . invite_channel_type = channel . type ;
if ( null != invite . inviter ) {
obj . invite_inviter_id = invite . inviter . id ;
}
if ( null != invite . target_application ) {
obj . application_id = invite . target_application . id ;
}
2026-07-23 10:11:24 +00:00
lastActiveStream = lastActiveStream . getLastActiveStream ( ) ;
2026-07-20 16:05:17 +00:00
STREAM = GDM_INVITE ;
if ( null != lastActiveStream ) {
STREAM = GDM_INVITE ;
if ( lastActiveStream . channelId === channel . id ) {
obj . destination_user_id = lastActiveStream . ownerId ;
2026-08-25 06:04:03 +00:00
const streamerApplication = tmp3 ( 7342 ) . getStreamerApplication ( lastActiveStream , closure_22 ) ;
2026-07-20 16:05:17 +00:00
let id3 = null ;
if ( null != streamerApplication ) {
id3 = streamerApplication . id ;
}
obj . application_id = id3 ;
STREAM = constants3 . STREAM ;
2026-08-25 06:04:03 +00:00
const tmp3Result1 = tmp3 ( 7342 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
if ( null != inviteAnalyticsMetadata ) {
if ( null != inviteAnalyticsMetadata . suggestionData ) {
obj . is_suggested = inviteAnalyticsMetadata . suggestionData . isAffinitySuggestion ;
obj . row_num = inviteAnalyticsMetadata . suggestionData . rowNum ;
obj . num_total = inviteAnalyticsMetadata . suggestionData . numTotal ;
obj . num_affinity_connections = inviteAnalyticsMetadata . suggestionData . numAffinityConnections ;
obj . is_filtered = inviteAnalyticsMetadata . suggestionData . isFiltered ;
}
obj . source = inviteAnalyticsMetadata . source ;
}
obj = { } ;
const merged = Object . assign ( obj ) ;
2026-07-29 08:29:29 +00:00
obj . location = _location ;
obj . invite_type = STREAM ;
obj . invite_code = result . baseCode ;
obj . guild_id = channel . getGuildId ( ) ;
obj . channel_id = channel . id ;
obj . message_id = messageId ;
obj . send_type = constants4 . DIRECT_MESSAGE ;
obj . invite_guild_scheduled_event_id = result . guildScheduledEventId ;
2026-08-25 06:04:03 +00:00
let inviteInstanceId = tmp3 ( 4365 ) . getInviteInstanceId ( result . baseCode , messageId ) ;
2026-07-29 08:29:29 +00:00
if ( inviteInstanceId == null ) {
inviteInstanceId = null ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj . invite_instance_id = inviteInstanceId ;
2026-07-20 16:05:17 +00:00
const merged1 = Object . assign ( overrideProperties ) ;
2026-08-25 06:04:03 +00:00
const tmp3Result2 = tmp3 ( 4365 ) ;
2026-08-24 06:08:38 +00:00
collectGuildAnalyticsMetadataDefault . trackWithMetadata ( constants . INVITE_SENT , obj ) ;
const obj13 = collectGuildAnalyticsMetadataDefault ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmp12 = null != invite ;
if ( tmp12 ) {
tmp12 = invite . state === constants5 . RESOLVED ;
}
if ( tmp12 ) {
tmp12 = null != invite . inviter ;
}
if ( tmp12 ) {
2026-08-24 06:08:38 +00:00
obj1 = { invite_inviter_id : invite.inviter.id } ;
2026-07-29 08:29:29 +00:00
if ( null != invite . target_application ) {
obj1 . application_id = invite . target_application . id ;
}
const obj2 = { } ;
const merged2 = Object . assign ( obj1 ) ;
obj2 . location = _location ;
obj2 . invite_type = constants3 . FRIEND_INVITE ;
obj2 . invite_code = result . baseCode ;
obj2 . message_id = messageId ;
obj2 . send_type = constants4 . DIRECT_MESSAGE ;
obj2 . invite_guild_scheduled_event_id = result . guildScheduledEventId ;
2026-08-25 06:04:03 +00:00
let inviteInstanceId1 = tmp3 ( 4365 ) . getInviteInstanceId ( result . baseCode , messageId ) ;
2026-07-29 08:29:29 +00:00
if ( inviteInstanceId1 == null ) {
inviteInstanceId1 = null ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2 . invite_instance_id = inviteInstanceId1 ;
const merged3 = Object . assign ( overrideProperties ) ;
2026-08-25 06:04:03 +00:00
const tmp3Result3 = tmp3 ( 4365 ) ;
2026-08-24 06:08:38 +00:00
collectGuildAnalyticsMetadataDefault . trackWithMetadata ( constants . INVITE_SENT , obj2 ) ;
const obj8 = collectGuildAnalyticsMetadataDefault ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-24 06:08:38 +00:00
getUncachedChannelPermissionsDefault ;
2026-07-23 10:11:24 +00:00
const AbortCodes = ME . AbortCodes ;
2026-07-29 08:29:29 +00:00
( { AnalyticEvents : closure_27 , Endpoints : closure_28 , Permissions , ChannelTypes : closure_29 , LoggingInviteTypes : closure_30 , SendTypes : closure_31 , InviteStates : closure_32 , MessageFlags : closure_33 , MAX_MESSAGES_FOR_JUMP : closure_34 , MessageTypes : closure_35 , AllowedMentionTypes : closure_36 , HelpdeskArticles : closure_37 , MarketingURLs : closure_38 , MessageReferenceTypes : closure_39 , LOCAL_BOT_ID : closure_40 , NON_USER_BOT_DISCRIMINATOR : closure_41 , MessageStates : closure_42 , ActivityActionTypes : closure_43 } = ME ) ;
( { FileUploadErrorTypes : closure_46 , MessageSendLocation : closure_47 } = MESSAGE_GROUP_SPACING ) ;
2026-08-24 06:08:38 +00:00
const MediaPlayerManager = require ( "get ActivityIndicator" ) . NativeModules . MediaPlayerManager ;
let closure_49 = new timestampDefault ( "MessageActionCreators" ) ;
const tmp5 = new timestampDefault ( "MessageActionCreators" ) ;
let closure_50 = new timestampDefault ( "MessageQueue" ) ;
2026-07-29 08:29:29 +00:00
let c51 = false ;
class RemoteFetch {
}
RemoteFetch . prototype [ "markComplete" ] = function markComplete() {
this . completed = true ;
} ;
2026-07-20 16:05:17 +00:00
let obj = {
messageName : "SLOWMODE_RATE_LIMITED" ,
messageGetter ( rateLimitPerUser ) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . formatToPlainString ( getSystemLocale . t . IWntYg , { seconds : rateLimitPerUser.rateLimitPerUser } ) ;
2026-07-20 16:05:17 +00:00
}
} ;
obj = {
messageName : "INVALID_MESSAGE_SEND_NO_MUTUAL_GUILDS" ,
messageGetter ( rawRecipients ) {
2026-08-24 06:08:38 +00:00
let obj = combinedDefault ;
2026-07-20 16:05:17 +00:00
const articleURL = obj . getArticleURL ( constants7 . DM_COULD_NOT_BE_DELIVERED ) ;
rawRecipients = rawRecipients . rawRecipients ;
2026-07-29 08:29:29 +00:00
if ( rawRecipients == null ) {
2026-07-20 16:05:17 +00:00
rawRecipients = [ ] ;
}
if ( rawRecipients . isDM ( ) ) {
if ( 1 === rawRecipients . length ) {
if ( rawRecipients . some ( ( bot ) = > bot . bot ) ) {
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale . intl ;
2026-07-29 08:29:29 +00:00
obj = { helpUrl : null } ;
obj [ 0 ] = articleURL ;
2026-08-24 06:08:38 +00:00
let formatToPlainStringResult = intl2 . formatToPlainString ( getSystemLocale . t . SkGL7l , obj ) ;
2026-07-20 16:05:17 +00:00
}
return formatToPlainStringResult ;
}
}
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
formatToPlainStringResult = intl . formatToPlainString ( getSystemLocale . t . llTkqr , { helpUrl : articleURL } ) ;
2026-07-20 16:05:17 +00:00
}
} ;
obj = {
messageName : "INVALID_MESSAGE_SEND_USER" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
const obj = { helpUrl : combinedDefault.getArticleURL ( constants7 . DM_COULD_NOT_BE_DELIVERED ) } ;
return intl . formatToPlainString ( getSystemLocale . t . SkGL7l , obj ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-29 08:29:29 +00:00
let closure_54 = {
2026-07-20 16:05:17 +00:00
[ AbortCodes . SLOWMODE_RATE_LIMITED ] : obj ,
[ AbortCodes . INVALID_MESSAGE_SEND_NO_MUTUAL_GUILDS ] : obj ,
[ AbortCodes . INVALID_MESSAGE_SEND_USER ] : obj ,
[ AbortCodes . TOO_MANY_THREADS ] : {
messageName : "TOO_MANY_THREADS" ,
messageGetter ( isForumLikeChannel ) {
if ( ! isForumLikeChannel . isForumLikeChannel ( ) ) {
if ( ! isForumLikeChannel . isForumPost ( ) ) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
let stringResult = intl . string ( getSystemLocale . t [ "5EMPA7" ] ) ;
2026-07-20 16:05:17 +00:00
}
return stringResult ;
}
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale . intl ;
stringResult = intl2 . string ( getSystemLocale . t [ "/jUd2+" ] ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . TOO_MANY_ANNOUNCEMENT_THREADS ] : {
messageName : "TOO_MANY_ANNOUNCEMENT_THREADS" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t [ "aY+lLC" ] ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . HARMFUL_LINK_MESSAGE_BLOCKED ] : {
messageName : "HARMFUL_LINK_MESSAGE_BLOCKED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . formatToPlainString ( getSystemLocale . t . zSG3Qy , { helpUrl : constants8.HARMFUL_LINKS } ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . HARMFUL_URL_BLOCKED ] : {
messageName : "HARMFUL_URL_BLOCKED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . WxX2Fd ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . EMAIL_VERIFICATION_REQUIRED ] : {
messageName : "BOT_REQUIRES_EMAIL_VERIFICATION" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . k1Cjqr ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . GUILD_MESSAGE_UPDATE_RATE_LIMIT_EXCEEDED ] : {
messageName : "GUILD_MESSAGE_UPDATE_RATE_LIMIT_EXCEEDED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . Z5SUuv ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . RATE_LIMIT_DM_OPEN ] : {
messageName : "BOT_DM_RATE_LIMITED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . E8nbNb ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . SEND_MESSAGE_TEMPORARILY_DISABLED ] : {
messageName : "BOT_DM_SEND_MESSAGE_TEMPORARILY_DISABLED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . aRUbah ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . INVALID_MESSAGE_SEND_GAME_FRIEND_DM ] : {
messageName : "BOT_DM_SEND_MESSAGE_INVALID_FOR_GAME_FRIEND" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t [ "/meGhR" ] ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . INVALID_MESSAGE_SEND_PROVISIONAL_ACCOUNT_OFFLINE ] : {
messageName : "BOT_DM_SEND_MESSAGE_INVALID_OFFLINE_PROVISIONAL_ACCOUNT" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . Oc1Zjw ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . TOTAL_ATTACHMENT_SIZE_TOO_LARGE ] : {
messageName : "TOTAL_ATTACHMENT_SIZE_TOO_LARGE" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . formatToPlainString ( getSystemLocale . t . DYFPg2 , { maxSizeMb : items2.MAX_TOTAL_ATTACHMENT_SIZE_MB } ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . CLOUD_UPLOAD_NOT_FOUND ] : {
messageName : "CLOUD_UPLOAD_NOT_FOUND" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . bQldfH ) ;
2026-07-20 16:05:17 +00:00
}
} ,
[ AbortCodes . INVALID_PERMISSIONS ] : {
messageName : "INVALID_PERMISSIONS" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . zl4Weq ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
2026-07-23 10:11:24 +00:00
let obj14 = {
2026-07-29 08:29:29 +00:00
receiveMessage ( channelId , message ) {
2026-07-20 16:05:17 +00:00
let flag = arg2 ;
if ( arg2 === undefined ) {
flag = false ;
}
2026-07-29 08:29:29 +00:00
let obj = arg3 ;
if ( arg3 === undefined ) {
2026-07-20 16:05:17 +00:00
obj = { } ;
}
2026-07-29 08:29:29 +00:00
obj = { type : "MESSAGE_CREATE" , channelId , message , optimistic : flag , sendMessageOptions : obj , isPushNotification : false } ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj ) ;
2026-07-20 16:05:17 +00:00
} ,
sendBotMessage ( id , intl , messageName , nonce ) {
if ( null != messageName ) {
2026-08-24 06:08:38 +00:00
let obj = collectGuildAnalyticsMetadataDefault ;
2026-07-29 08:29:29 +00:00
obj = { message_author : "Clyde" , message_name : null } ;
obj [ 1 ] = messageName ;
2026-07-20 16:05:17 +00:00
obj . trackWithMetadata ( constants . AUTOMATED_MESSAGE_RECEIVED , obj ) ;
}
obj = { messageId : nonce , channelId : id , content : intl , loggingName : messageName } ;
2026-08-24 06:08:38 +00:00
obj14 . receiveMessage ( id , createMessage . createBotMessage ( obj ) ) ;
2026-07-20 16:05:17 +00:00
} ,
sendNitroSystemMessage ( channelId , content , nonce ) {
2026-07-29 08:29:29 +00:00
obj = { channelId , nonce , type : constants6 . NITRO_NOTIFICATION , content , flags : closure_33.EPHEMERAL , author : obj } ;
obj = { id : closure_40 , username : "Nitro Notification" , discriminator : closure_41 , avatar : "nitro" , bot : true } ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-08-24 06:08:38 +00:00
const merged = Object . assign ( createMessageDefault ( obj ) ) ;
2026-07-29 08:29:29 +00:00
obj . state = constants9 . SENT ;
obj . channel_id = channelId ;
2026-07-20 16:05:17 +00:00
obj14 . receiveMessage ( channelId , obj , true ) ;
} ,
sendGiftingPromptSystemMessage ( channelId , giftingPrompt ) {
2026-07-29 08:29:29 +00:00
obj = { channelId , type : constants6 . GIFTING_PROMPT , content : "" , flags : closure_33.EPHEMERAL , author : obj , giftingPrompt } ;
obj = { id : closure_40 , username : "Gifting Prompt" , discriminator : closure_41 , avatar : "gifting_prompt" , bot : true } ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-08-24 06:08:38 +00:00
const merged = Object . assign ( createMessageDefault ( obj ) ) ;
2026-07-29 08:29:29 +00:00
obj . state = constants9 . SENT ;
2026-07-20 16:05:17 +00:00
obj14 . receiveMessage ( channelId , obj , true ) ;
} ,
sendGuildBoostUpsellSystemMessage ( channelId , boostingPrompt ) {
2026-07-29 08:29:29 +00:00
obj = { channelId , type : constants6 . GUILD_BOOST_UPSELL , content : "" , flags : closure_33.EPHEMERAL , author : obj , boostingPrompt } ;
obj = { id : closure_40 , username : "Guild Boost Upsell" , discriminator : closure_41 , avatar : "guild_boost_upsell" , bot : true } ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-08-24 06:08:38 +00:00
const merged = Object . assign ( createMessageDefault ( obj ) ) ;
2026-07-29 08:29:29 +00:00
obj . state = constants9 . SENT ;
2026-07-20 16:05:17 +00:00
obj14 . receiveMessage ( channelId , obj , true ) ;
} ,
2026-08-24 06:08:38 +00:00
sendClydeError ( closure_0 , code ) {
2026-07-20 16:05:17 +00:00
let num = code ;
if ( code === undefined ) {
num = 0 ;
}
2026-08-24 06:08:38 +00:00
const channel = store . getChannel ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
if ( null != channel ) {
2026-07-23 10:11:24 +00:00
let obj = table [ num ] ;
2026-07-20 16:05:17 +00:00
if ( null != obj ) {
2026-08-24 06:08:38 +00:00
obj14 . sendBotMessage ( closure_0 , obj . messageGetter ( channel ) , obj . messageName ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
2026-07-29 08:29:29 +00:00
obj = { helpUrl : null } ;
2026-08-24 06:08:38 +00:00
obj [ 0 ] = combinedDefault . getArticleURL ( constants7 . DM_COULD_NOT_BE_DELIVERED ) ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
const obj3 = combinedDefault ;
obj14 . sendBotMessage ( closure_0 , intl . formatToPlainString ( getSystemLocale . t . SkGL7l , obj ) , "SEND_FAILED (" + num + ")" ) ;
const formatToPlainStringResult = intl . formatToPlainString ( getSystemLocale . t . SkGL7l , obj ) ;
2026-07-20 16:05:17 +00:00
}
}
} ,
2026-07-29 08:29:29 +00:00
sendExplicitMediaClydeError ( c0 , attachments , EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED ) {
const channel = store . getChannel ( c0 ) ;
2026-07-20 16:05:17 +00:00
if ( null != channel ) {
2026-07-29 08:29:29 +00:00
let obj = { isDM : null , isGDM : null } ;
obj [ 0 ] = channel . isDM ( ) ;
obj [ 1 ] = channel . isGroupDM ( ) ;
2026-08-24 06:08:38 +00:00
const match = t2 . match ( obj ) ;
const str = t2 ;
2026-07-29 08:29:29 +00:00
const withResult = match . with ( { isDM : true } , ( ) = > {
const obj = { message : null , messageName : "BOT_DM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
2026-07-29 08:29:29 +00:00
const withResult1 = match . with ( { isDM : true } , ( ) = > {
const obj = { message : null , messageName : "BOT_DM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
2026-07-23 10:11:24 +00:00
} ) . with ( { isDM : false , isGDM : true } , ( ) = > {
2026-07-29 08:29:29 +00:00
const obj = { message : null , messageName : "BOT_GDM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
2026-07-29 08:29:29 +00:00
( { message , messageName } = match . with ( { isDM : true } , ( ) = > {
const obj = { message : null , messageName : "BOT_DM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
2026-07-23 10:11:24 +00:00
} ) . with ( { isDM : false , isGDM : true } , ( ) = > {
2026-07-29 08:29:29 +00:00
const obj = { message : null , messageName : "BOT_GDM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) . otherwise ( ( ) = > {
2026-07-29 08:29:29 +00:00
const obj = { message : null , messageName : "BOT_GUILD_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t . i4AbAS ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ) ;
2026-07-29 08:29:29 +00:00
const otherwiseResult = match . with ( { isDM : true } , ( ) = > {
const obj = { message : null , messageName : "BOT_DM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
2026-07-23 10:11:24 +00:00
} ) . with ( { isDM : false , isGDM : true } , ( ) = > {
2026-07-29 08:29:29 +00:00
const obj = { message : null , messageName : "BOT_GDM_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t [ "mktny/" ] ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) . otherwise ( ( ) = > {
2026-07-29 08:29:29 +00:00
const obj = { message : null , messageName : "BOT_GUILD_EXPLICIT_CONTENT" } ;
const intl = callback ( 1236 ) . intl ;
obj [ 0 ] = intl . string ( callback ( 1236 ) . t . i4AbAS ) ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
2026-08-24 06:08:38 +00:00
const nonce = snowflakeSequence . createNonce ( ) ;
2026-07-29 08:29:29 +00:00
obj14 . sendBotMessage ( c0 , message , messageName , nonce ) ;
2026-08-24 06:08:38 +00:00
const obj8 = snowflakeSequence ;
2026-07-29 08:29:29 +00:00
obj = { action : null , messageId : null , channelId : null , context : null } ;
2026-08-24 06:08:38 +00:00
obj [ 0 ] = redactionSettingToRenderedString . TrackMediaRedactionActionType . EXPLICIT_MEDIA_FALSE_POSITIVE_CLYDE_MESSAGE_SENT ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = nonce ;
obj [ 2 ] = c0 ;
obj [ 3 ] = EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED ;
2026-08-24 06:08:38 +00:00
const result = redactionSettingToRenderedString . trackMediaRedactionAction ( obj ) ;
2026-07-29 08:29:29 +00:00
let tmp = null != attachments ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-29 08:29:29 +00:00
tmp = attachments . length > 0 ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
2026-08-24 06:08:38 +00:00
obj1 = dispatcherDefault ;
2026-07-29 08:29:29 +00:00
obj1 = { type : "MESSAGE_EXPLICIT_CONTENT_FP_CREATE" , messageId : null , channelId : null , attachments : null } ;
obj1 [ 1 ] = nonce ;
obj1 [ 2 ] = c0 ;
obj1 [ 3 ] = attachments ;
obj1 . dispatch ( obj1 ) ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj9 = redactionSettingToRenderedString ;
2026-07-20 16:05:17 +00:00
}
} ,
truncateMessages ( channelId , truncateBottom , truncateTop ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "TRUNCATE_MESSAGES" , channelId , truncateBottom , truncateTop } ;
obj . dispatch ( obj ) ;
} ,
clearChannel ( channelId ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "CLEAR_MESSAGES" , channelId } ;
obj . dispatch ( obj ) ;
} ,
2026-07-29 08:29:29 +00:00
jumpToPresent ( channelId ) {
let obj = obj14 ;
2026-07-20 16:05:17 +00:00
obj14 . trackJump ( channelId , null , "Present" ) ;
2026-07-29 08:29:29 +00:00
obj = { present : true } ;
2026-08-24 06:08:38 +00:00
if ( closure_21 . hasPresent ( channelId ) ) {
2026-07-29 08:29:29 +00:00
obj = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , jump : null , channelId : null , limit : null } ;
obj [ 1 ] = obj ;
obj [ 2 ] = channelId ;
obj [ 3 ] = arg1 ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj ) ;
const obj4 = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = { channelId : null , limit : null , jump : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = channelId ;
obj1 [ 1 ] = arg1 ;
obj1 [ 2 ] = obj ;
const messages = obj . fetchMessages ( obj1 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
trackJump ( channelId , id , Present , extraProperties ) {
2026-08-24 06:08:38 +00:00
let obj = collectGuildAnalyticsMetadataDefault ;
2026-07-20 16:05:17 +00:00
obj = { context : Present , channel_id : channelId , message_id : id } ;
const merged = Object . assign ( extraProperties ) ;
obj . trackWithMetadata ( constants . JUMP , obj ) ;
} ,
jumpToMessage ( arg0 ) {
( { channelId , messageId , flash } = arg0 ) ;
if ( flash === undefined ) {
flash = false ;
}
( { context , extraProperties , offset } = arg0 ) ;
if ( extraProperties === undefined ) {
extraProperties = null ;
}
( { isPreload , returnMessageId , skipLocalFetch , jumpType , avoidInitialScroll , onJumpComplete } = arg0 ) ;
2026-08-04 21:03:28 +00:00
if ( typeof context === "string" ) {
2026-07-20 16:05:17 +00:00
obj14 . trackJump ( channelId , messageId , context , extraProperties ) ;
}
2026-07-29 08:29:29 +00:00
if ( MediaPlayerManager != null ) {
const pauseAllMediaPlayers = MediaPlayerManager . pauseAllMediaPlayers ;
if ( pauseAllMediaPlayers != null ) {
pauseAllMediaPlayers ( ) ;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj14 . fetchMessages ( { channelId , limit : closure_34 , jump : { messageId , flash , offset , returnMessageId , jumpType , onJumpComplete } , isPreload , skipLocalFetch , avoidInitialScroll } ) ;
2026-07-20 16:05:17 +00:00
} ,
focusMessage ( channelId ) {
2026-07-29 08:29:29 +00:00
obj = { channelId : channelId.channelId , limit : closure_34 , focus : obj } ;
2026-07-20 16:05:17 +00:00
obj = { messageId : channelId.messageId } ;
const messages = obj14 . fetchMessages ( obj ) ;
} ,
fetchMessage ( arg0 ) {
2026-07-23 10:11:24 +00:00
( { channelId : require , messageId : importDefault } = arg0 ) ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
dependencyMap = 2 ;
if ( 0 === c2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp2 ;
closure_0 = 0 ;
2026-07-29 08:29:29 +00:00
closure_0 = undefined ;
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0 ( 530 ) . HTTP ;
obj1 = { url : null , query : null , retries : 2 , oldFormErrors : true , rejectWithError : null } ;
obj1 [ 0 ] = closure_1_28 . MESSAGES ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
const obj2 = { limit : 1 , around : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 1 ] = closure_1_1 ;
2026-07-29 08:29:29 +00:00
obj1 [ 1 ] = obj2 ;
2026-08-24 06:08:38 +00:00
obj1 [ 4 ] = closure_1_0 ( 530 ) . rejectWithMigratedError ( ) ;
2026-07-29 08:29:29 +00:00
c2 = 1 ;
dependencyMap = 1 ;
const obj3 = { value : null , done : false } ;
obj3 [ 0 ] = HTTP . get ( obj1 ) ;
return obj3 ;
}
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
const obj4 = { value : null , done : true } ;
obj4 [ 0 ] = arg1 ;
return obj4 ;
} else {
closure_0 = arg1 ;
if ( closure_0 . body . length > 0 ) {
2026-08-25 06:04:03 +00:00
obj = closure_1_0 ( 4625 ) ;
2026-07-29 08:29:29 +00:00
dependencyMap = 3 ;
const obj5 = { value : null , done : true } ;
obj5 [ 0 ] = obj . createMessageRecord ( closure_0 . body [ 0 ] ) ;
return obj5 ;
} else {
dependencyMap = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
}
} catch ( tmp11 ) {
dependencyMap = tmp ;
throw tmp11 ;
}
2026-07-20 16:05:17 +00:00
}
} ) ( ) ;
} ,
fetchMessages ( channelId ) {
channelId = channelId . channelId ;
const before = channelId . before ;
const after = channelId . after ;
const limit = channelId . limit ;
2026-07-29 08:29:29 +00:00
let jump = channelId . jump ;
2026-07-20 16:05:17 +00:00
( { focus , truncate } = channelId ) ;
2026-08-24 06:08:38 +00:00
( { forICYMI : closure_6 , avoidInitialScroll : closure_7 , fetchKey } = channelId ) ;
closure_9 = undefined ;
2026-07-29 08:29:29 +00:00
let timestamp ;
2026-07-23 10:11:24 +00:00
let messageId ;
2026-08-24 06:08:38 +00:00
obj1 = undefined ;
2026-07-20 16:05:17 +00:00
( { isPreload , skipLocalFetch , feature } = channelId ) ;
const channel = store . getChannel ( channelId ) ;
2026-07-29 08:29:29 +00:00
closure_9 = connectedOrOverlay . isConnectedOrOverlay ( ) ;
timestamp = Date . now ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != channel ) {
if ( channel . type === constants2 . GUILD_STORE ) {
return false ;
}
}
2026-07-29 08:29:29 +00:00
if ( channelId !== channelId ( limit [ 53 ] ) . FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID ) {
2026-07-20 16:05:17 +00:00
const _JSON = JSON ;
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
logger . log ( "Fetching messages for " + channelId + " between " + after + " and " + before + ". jump=" + JSON . stringify ( jump ) ) ;
2026-07-29 08:29:29 +00:00
let obj = { channelId : null , before : null , after : null , limit : null , jump : null , focus : null , truncate : null } ;
obj [ 0 ] = channelId ;
obj [ 1 ] = before ;
obj [ 2 ] = after ;
obj [ 3 ] = limit ;
obj [ 4 ] = jump ;
obj [ 5 ] = focus ;
obj [ 6 ] = truncate ;
2026-07-20 16:05:17 +00:00
if ( ! obj14 . _tryFetchMessagesCached ( obj ) ) {
2026-07-29 08:29:29 +00:00
let fetchMessages = before ( tmp5 [ 54 ] ) . fetchMessages ;
2026-07-20 16:05:17 +00:00
fetchMessages . recordStart ( ) ;
2026-07-29 08:29:29 +00:00
obj = before ( tmp5 [ 55 ] ) ;
let tmp8 = fetchKey ;
if ( fetchKey == null ) {
tmp8 = timestamp ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let result = obj . recordChannelFetchStart ( channelId , tmp8 , before , after , limit ) ;
2026-07-20 16:05:17 +00:00
if ( tmp16 ) {
obj = { } ;
const merged = Object . assign ( focus ) ;
2026-07-29 08:29:29 +00:00
jump = obj ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp6Result = tmp6 ( tmp5 [ 56 ] ) ;
const orCreate = tmp6Result . getOrCreate ( channelId ) ;
const start = orCreate . loadStart ( jump ) ;
tmp6Result = tmp6 ( tmp5 [ 56 ] ) ;
tmp6Result . commit ( start ) ;
before ( tmp5 [ 46 ] ) . dispatch ( { type : "LOAD_MESSAGES" } ) ;
2026-07-23 10:11:24 +00:00
messageId = undefined ;
2026-07-29 08:29:29 +00:00
if ( jump != null ) {
messageId = jump . messageId ;
2026-07-20 16:05:17 +00:00
}
2026-08-04 21:03:28 +00:00
if ( typeof RemoteFetch !== "function" ) {
2026-07-29 08:29:29 +00:00
HermesBuiltin . throwTypeError ( ) ;
}
obj1 = Object . create ( RemoteFetch . prototype ) ;
2026-07-20 16:05:17 +00:00
if ( ! skipLocalFetch ) {
2026-07-29 08:29:29 +00:00
const self = this ;
if ( fetchKey == null ) {
fetchKey = timestamp ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const localMessages = this . fetchLocalMessages ( channelId , fetchKey , before , after , limit , obj1 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const HTTP = tmp4 ( tmp5 [ 51 ] ) . HTTP ;
const obj2 = { url : null , query : null , retries : 2 , oldFormErrors : true , rejectWithError : null } ;
obj2 [ 0 ] = closure_28 . MESSAGES ( channelId ) ;
const obj3 = { before : null , after : null , limit : null , around : null , preload : null , feature : null } ;
obj3 [ 0 ] = before ;
obj3 [ 1 ] = after ;
obj3 [ 2 ] = limit ;
obj3 [ 3 ] = messageId ;
obj3 [ 4 ] = isPreload ;
obj3 [ 5 ] = feature ;
obj2 [ 1 ] = obj3 ;
tmp16 = null == jump && null != focus ;
const tmp24 = RemoteFetch ;
const tmp6Result1 = before ( tmp5 [ 46 ] ) ;
obj2 [ 4 ] = tmp4 ( tmp5 [ 51 ] ) . rejectWithMigratedError ( ) ;
2026-07-20 16:05:17 +00:00
const value = HTTP . get ( obj2 ) ;
return value . then ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
const fetchMessages = before ( limit [ 54 ] ) . fetchMessages ;
2026-07-20 16:05:17 +00:00
fetchMessages . recordEnd ( ) ;
2026-07-29 08:29:29 +00:00
const dispatchMessages = before ( limit [ 54 ] ) . dispatchMessages ;
2026-07-20 16:05:17 +00:00
dispatchMessages . measure ( ( ) = > {
2026-07-23 10:11:24 +00:00
body = body . body ;
2026-08-24 06:08:38 +00:00
let flag = null != closure_1_11 ;
2026-07-20 16:05:17 +00:00
if ( ! flag ) {
2026-08-24 06:08:38 +00:00
let tmp7 = body . length === closure_1_3 ;
2026-07-29 08:29:29 +00:00
if ( tmp7 ) {
let tmp8 = tmp2 ;
if ( ! tmp2 ) {
tmp8 = null == tmp && null == tmp3 ;
const tmp9 = null == tmp && null == tmp3 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp7 = tmp8 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
flag = tmp7 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag2 = null != tmp5 ;
2026-07-20 16:05:17 +00:00
if ( ! flag2 ) {
2026-07-29 08:29:29 +00:00
let tmp10 = tmp4 ;
if ( tmp4 ) {
2026-08-24 06:08:38 +00:00
tmp10 = body . length === closure_1_3 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
flag2 = tmp10 ;
2026-07-20 16:05:17 +00:00
}
let flag3 = flag2 ;
2026-07-29 08:29:29 +00:00
let tmp12 = flag ;
2026-08-24 06:08:38 +00:00
if ( null != closure_1_11 ) {
2026-07-20 16:05:17 +00:00
const _Math = Math ;
2026-08-24 06:08:38 +00:00
const rounded = Math . floor ( closure_1_3 / 2 ) ;
2026-07-29 08:29:29 +00:00
const items = [ tmp5 ] ;
2026-07-20 16:05:17 +00:00
HermesBuiltin . arraySpread ( body . map ( ( id ) = > id . id ) , 1 ) ;
const found = items . filter ( ( arg0 , arg1 , arr ) = > arr . indexOf ( arg0 ) === arg1 ) ;
2026-07-29 08:29:29 +00:00
const sorted = found . sort ( before ( limit [ 57 ] ) . compare ) ;
const index = sorted . indexOf ( tmp5 ) ;
2026-08-24 06:08:38 +00:00
if ( index < rounded + closure_1_3 % 2 - 1 ) {
2026-07-20 16:05:17 +00:00
flag = false ;
}
if ( body . length - index < rounded ) {
flag2 = false ;
}
flag3 = flag2 ;
2026-07-29 08:29:29 +00:00
tmp12 = flag ;
2026-07-20 16:05:17 +00:00
if ( flag2 ) {
flag3 = flag2 ;
2026-07-29 08:29:29 +00:00
tmp12 = flag ;
2026-07-20 16:05:17 +00:00
if ( body . length > 0 ) {
flag3 = flag2 ;
2026-07-29 08:29:29 +00:00
tmp12 = flag ;
2026-08-24 06:08:38 +00:00
if ( body [ 0 ] . id === closure_2_23 . lastMessageId ( body ) ) {
2026-07-20 16:05:17 +00:00
flag3 = false ;
2026-07-29 08:29:29 +00:00
tmp12 = flag ;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-08-24 06:08:38 +00:00
closure_2_49 . log ( "Fetched " + body . length + " messages for " + body + " isBefore:" + null != closure_1_1 + " isAfter:" + null != closure_1_2 ) ;
closure_1_12 . markComplete ( ) ;
2026-07-29 08:29:29 +00:00
let obj = before ( limit [ 46 ] ) ;
2026-08-24 06:08:38 +00:00
obj = { type : "LOAD_MESSAGES_SUCCESS" , channelId : body , messages : body , isBefore : tmp2 , isAfter : tmp4 , hasMoreBefore : tmp12 , hasMoreAfter : flag3 , limit : closure_1_3 , jump : closure_1_4 , forICYMI : closure_1_6 , isStale : null , truncate : null , avoidInitialScroll : null } ;
let tmp19 = ! closure_1_9 ;
if ( closure_1_9 ) {
tmp19 = closure_2_6 . lastTimeConnectedChanged ( ) >= closure_1_10 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj [ 10 ] = tmp19 ;
2026-08-24 06:08:38 +00:00
obj [ 11 ] = closure_1_5 ;
obj [ 12 ] = closure_1_7 ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
2026-08-24 06:08:38 +00:00
let tmp23 = closure_1_8 ;
if ( closure_1_8 == null ) {
tmp23 = closure_1_10 ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const result = before ( limit [ 55 ] ) . recordChannelFetchedNetwork ( body , tmp23 , tmp , tmp3 , closure_1_3 , body ) ;
2026-07-20 16:05:17 +00:00
} ) ;
return true ;
} , ( ) = > {
2026-08-24 06:08:38 +00:00
closure_1_49 . log ( "Failed to fetch messages for " + channelId ) ;
2026-07-29 08:29:29 +00:00
let obj = before ( limit [ 46 ] ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "LOAD_MESSAGES_FAILURE" , channelId } ;
obj . dispatch ( obj ) ;
return false ;
} ) ;
}
}
} ,
2026-07-29 08:29:29 +00:00
fetchLocalMessages ( channelId , fetchKey , before , after , limit , arg5 ) {
2026-08-24 06:08:38 +00:00
closure_0 = channelId ;
closure_1 = fetchKey ;
closure_2 = before ;
closure_3 = after ;
closure_4 = limit ;
2026-07-20 16:05:17 +00:00
const callback = arg5 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
dependencyMap = 2 ;
if ( 0 === closure_2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
c1 = tmp2 ;
2026-07-29 08:29:29 +00:00
let basicChannel = num2 ;
basicChannel = undefined ;
c1 = undefined ;
closure_2 = undefined ;
dependencyMap = undefined ;
2026-08-24 06:08:38 +00:00
basicChannel = closure_1_17 . getBasicChannel ( closure_1_0 ) ;
2026-08-25 06:04:03 +00:00
const orCreate = closure_1_1 ( 5097 ) . getOrCreate ( closure_1_0 ) ;
const obj13 = closure_1_1 ( 5097 ) ;
const databaseResult = closure_1_1 ( 1956 ) . database ( ) ;
2026-07-29 08:29:29 +00:00
c1 = databaseResult ;
if ( null != databaseResult ) {
if ( null != basicChannel ) {
if ( null == c2 ) {
if ( null == dependencyMap ) {
if ( orCreate . ready ) {
if ( ! orCreate . cached ) {
2026-08-24 06:08:38 +00:00
closure_1_1 ( 9 ) . addLocalMessages ( closure_1_0 , - 2 ) ;
const obj8 = closure_1_1 ( 9 ) ;
2026-07-29 08:29:29 +00:00
}
}
closure_2 = 1 ;
dependencyMap = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
2026-08-25 06:04:03 +00:00
obj1 [ 0 ] = closure_1_0 ( 1976 ) . tryLoadAsync ( ( ) = > closure_2_1 ( tmp [ 60 ] ) . load ( c1 , basicChannel , closure_1_4 ) ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap = 3 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-25 06:04:03 +00:00
obj14 = closure_1_1 ( 1956 ) ;
2026-08-24 06:08:38 +00:00
closure_1_1 ( 9 ) . addLocalMessages ( closure_1_0 , - 1 ) ;
const obj7 = closure_1_1 ( 9 ) ;
2026-07-29 08:29:29 +00:00
}
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
let obj2 = { value : null , done : true } ;
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
closure_2 = arg1 ;
if ( null == closure_2 ) {
2026-08-24 06:08:38 +00:00
obj = closure_1_1 ( 9 ) ;
2026-07-29 08:29:29 +00:00
obj . addLocalMessages ( basicChannel , - 3 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
closure_1_49 . log ( "fetched " + closure_2 . messages . length + " messages from local database (channel_id: " + basicChannel + ", remote_fetch_completed: " + closure_5 . completed + ")" ) ;
obj1 = closure_1_1 ( 9 ) ;
2026-07-29 08:29:29 +00:00
obj1 . addLocalMessages ( basicChannel , closure_2 . messages . length ) ;
2026-08-24 06:08:38 +00:00
if ( ! closure_5 . completed ) {
2026-07-29 08:29:29 +00:00
if ( closure_2 . messages . length > num2 ) {
2026-08-24 06:08:38 +00:00
let tmp30 = closure_2 . messages . length >= closure_4 ;
2026-07-29 08:29:29 +00:00
if ( tmp30 ) {
2026-08-24 06:08:38 +00:00
tmp30 = closure_2 . connectionId === closure_1_6 . lastTimeConnectedChanged ( ) ;
2026-07-29 08:29:29 +00:00
}
dependencyMap = tmp30 ;
2026-08-25 06:04:03 +00:00
obj2 = closure_1_1 ( 7094 ) ;
2026-08-24 06:08:38 +00:00
const result = obj2 . recordChannelFetchedLocal ( basicChannel , c1 , closure_2 , dependencyMap , closure_4 , closure_2 . messages ) ;
let obj3 = closure_1_1 ( 709 ) ;
2026-07-29 08:29:29 +00:00
obj3 = { type : "LOCAL_MESSAGES_LOADED" , guildId : null , channelId : null , users : null , members : null , messages : null , stale : null } ;
obj3 [ 1 ] = basicChannel . guild_id ;
obj3 [ 2 ] = basicChannel ;
obj3 [ 3 ] = closure_2 . users ;
obj3 [ 4 ] = closure_2 . members ;
obj3 [ 5 ] = closure_2 . messages ;
obj3 [ 6 ] = ! dependencyMap ;
obj3 . dispatch ( obj3 ) ;
}
}
} catch ( tmp64 ) {
dependencyMap = tmp ;
throw tmp64 ;
2026-07-20 16:05:17 +00:00
}
}
} ) ( ) ;
} ,
2026-08-24 06:08:38 +00:00
fetchNewLocalMessages ( channelId , closure_14 ) {
closure_0 = channelId ;
closure_1 = closure_14 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( c3 === 2 ) {
c3 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c3 = 2 ;
if ( 0 === orCreate ) {
if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
c1 = tmp2 ;
2026-07-29 08:29:29 +00:00
let basicChannel = 0 ;
basicChannel = undefined ;
c1 = undefined ;
orCreate = undefined ;
c3 = undefined ;
let id ;
let messages ;
2026-08-24 06:08:38 +00:00
basicChannel = closure_1_17 . getBasicChannel ( closure_1_0 ) ;
const databaseResult = closure_1_1 ( c3 [ 58 ] ) . database ( ) ;
2026-07-29 08:29:29 +00:00
c1 = databaseResult ;
if ( null != databaseResult ) {
if ( null != basicChannel ) {
2026-08-24 06:08:38 +00:00
obj1 = closure_1_1 ( c3 [ 56 ] ) ;
orCreate = obj1 . getOrCreate ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
if ( ! orCreate . hasMoreAfter ) {
2026-08-24 06:08:38 +00:00
let obj2 = closure_1_0 ( c3 [ 59 ] ) ;
2026-07-29 08:29:29 +00:00
orCreate = 1 ;
c3 = 1 ;
obj1 = { value : null , done : false } ;
2026-08-25 06:04:03 +00:00
obj1 [ 0 ] = obj2 . tryLoadAsync ( ( ) = > closure_2_1 ( 7083 ) . load ( c1 , basicChannel , c1 ) ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
}
}
c3 = 3 ;
2026-08-24 06:08:38 +00:00
const obj11 = closure_1_1 ( c3 [ 58 ] ) ;
2026-07-29 08:29:29 +00:00
}
} else if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
c3 = arg1 ;
if ( null != c3 ) {
2026-08-24 06:08:38 +00:00
orCreate = closure_1_1 ( c3 [ 56 ] ) . getOrCreate ( basicChannel ) ;
2026-07-20 16:05:17 +00:00
const lastResult = orCreate . last ( ) ;
id = undefined ;
2026-07-29 08:29:29 +00:00
if ( lastResult != null ) {
2026-07-20 16:05:17 +00:00
id = lastResult . id ;
}
if ( null == id ) {
2026-07-29 08:29:29 +00:00
messages = c3 . messages ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
messages = c3 . messages ;
2026-08-24 06:08:38 +00:00
messages = messages . filter ( ( id ) = > closure_2_1 ( 11 ) . compare ( id . id , id ) > 0 ) ;
2026-07-20 16:05:17 +00:00
}
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
closure_1_49 . log ( "Fetched " + c3 . messages . length + " messages from the cache after foregrounding. " + messages . length + " are new" ) ;
2026-07-20 16:05:17 +00:00
if ( 0 !== messages . length ) {
2026-07-29 08:29:29 +00:00
obj2 = { type : "LOCAL_MESSAGES_LOADED" , guildId : null , channelId : null , users : null , members : null , messages : null , stale : true , isForegroundCacheLoad : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 1 ] = closure_1_0 . guild_id ;
2026-07-29 08:29:29 +00:00
obj2 [ 2 ] = basicChannel ;
obj2 [ 3 ] = c3 . users ;
obj2 [ 4 ] = c3 . members ;
2026-08-24 06:08:38 +00:00
obj2 [ 5 ] = closure_1_5 ;
const obj8 = closure_1_1 ( c3 [ 46 ] ) ;
obj2 [ 7 ] = closure_1_0 ( c3 [ 61 ] ) . isIOSPushNotificationRawPayloadFixExperimentEnabled ( ) ;
2026-07-29 08:29:29 +00:00
obj8 . dispatch ( obj2 ) ;
2026-08-24 06:08:38 +00:00
const obj10 = closure_1_0 ( c3 [ 61 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj7 = closure_1_1 ( c3 [ 56 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} catch ( tmp27 ) {
c3 = tmp ;
throw tmp27 ;
2026-07-20 16:05:17 +00:00
}
}
} ) ( ) ;
} ,
_tryFetchMessagesCached ( arg0 ) {
( { channelId , before , after , limit , jump , focus , truncate } = arg0 ) ;
2026-08-24 06:08:38 +00:00
const messages = closure_21 . getMessages ( channelId ) ;
2026-07-20 16:05:17 +00:00
if ( ! messages . cached ) {
if ( messages . ready ) {
let messageId ;
2026-07-29 08:29:29 +00:00
if ( jump != null ) {
2026-07-20 16:05:17 +00:00
messageId = jump . messageId ;
}
if ( null == messageId ) {
let messageId1 ;
2026-07-29 08:29:29 +00:00
if ( focus != null ) {
2026-07-20 16:05:17 +00:00
messageId1 = focus . messageId ;
}
if ( null == messageId1 ) {
if ( null != before ) {
if ( messages . hasBeforeCached ( before ) ) {
2026-08-24 06:08:38 +00:00
let obj3 = dispatcherDefault ;
2026-07-29 08:29:29 +00:00
let obj = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , channelId : null , before : null , limit : null , truncate : null } ;
obj [ 1 ] = channelId ;
obj [ 2 ] = before ;
obj [ 3 ] = limit ;
obj [ 4 ] = truncate ;
2026-07-20 16:05:17 +00:00
obj3 . dispatch ( obj ) ;
let flag = true ;
}
return flag ;
}
const tmp4 = null == after || ! messages . hasAfterCached ( after ) ;
flag = ! tmp4 ;
if ( ! tmp4 ) {
2026-08-24 06:08:38 +00:00
obj1 = dispatcherDefault ;
2026-07-29 08:29:29 +00:00
obj = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , channelId : null , after : null , limit : null , truncate : null } ;
obj [ 1 ] = channelId ;
obj [ 2 ] = after ;
obj [ 3 ] = limit ;
obj [ 4 ] = truncate ;
2026-07-20 16:05:17 +00:00
obj1 . dispatch ( obj ) ;
flag = true ;
}
}
}
let messageId2 ;
2026-07-29 08:29:29 +00:00
if ( jump != null ) {
2026-07-20 16:05:17 +00:00
messageId2 = jump . messageId ;
}
if ( null != messageId2 ) {
if ( messages . has ( jump . messageId , false ) ) {
2026-07-29 08:29:29 +00:00
obj1 = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , channelId : null , jump : null , limit : null , truncate : null } ;
obj1 [ 1 ] = channelId ;
obj1 [ 2 ] = jump ;
obj1 [ 3 ] = limit ;
obj1 [ 4 ] = truncate ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj1 ) ;
2026-07-20 16:05:17 +00:00
return true ;
}
}
let messageId3 ;
2026-07-29 08:29:29 +00:00
if ( focus != null ) {
2026-07-20 16:05:17 +00:00
messageId3 = focus . messageId ;
}
let tmp13 = jump ;
if ( null != messageId3 ) {
if ( messages . has ( focus . messageId , false ) ) {
2026-07-29 08:29:29 +00:00
const obj2 = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , channelId : null , focus : null , limit : null , truncate : null } ;
obj2 [ 1 ] = channelId ;
obj2 [ 2 ] = focus ;
obj2 [ 3 ] = limit ;
obj2 [ 4 ] = truncate ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj2 ) ;
2026-07-20 16:05:17 +00:00
return true ;
} else {
obj3 = { } ;
const merged = Object . assign ( focus ) ;
tmp13 = obj3 ;
}
}
let messageId4 ;
2026-07-29 08:29:29 +00:00
if ( tmp13 != null ) {
2026-07-20 16:05:17 +00:00
messageId4 = tmp13 . messageId ;
}
2026-07-29 08:29:29 +00:00
let num = 0 ;
2026-07-20 16:05:17 +00:00
if ( null != messageId4 ) {
let messageId5 ;
2026-07-29 08:29:29 +00:00
if ( tmp13 != null ) {
2026-07-20 16:05:17 +00:00
messageId5 = tmp13 . messageId ;
}
2026-08-24 06:08:38 +00:00
num = DISCORD_EPOCHDefault . extractTimestamp ( messageId5 ) ;
const obj7 = DISCORD_EPOCHDefault ;
2026-07-20 16:05:17 +00:00
}
const firstResult = messages . first ( ) ;
const lastResult = messages . last ( ) ;
2026-07-29 08:29:29 +00:00
const hasMoreBefore = messages . hasMoreBefore ;
let flag4 = ! hasMoreBefore ;
if ( ! hasMoreBefore ) {
flag4 = null != firstResult ;
}
2026-07-20 16:05:17 +00:00
if ( flag4 ) {
2026-08-24 06:08:38 +00:00
flag4 = DISCORD_EPOCHDefault . extractTimestamp ( firstResult . id ) >= num ;
const obj8 = DISCORD_EPOCHDefault ;
2026-07-20 16:05:17 +00:00
}
if ( ! flag4 ) {
2026-07-29 08:29:29 +00:00
const hasMoreAfter = messages . hasMoreAfter ;
let tmp25 = ! hasMoreAfter ;
if ( ! hasMoreAfter ) {
tmp25 = null != lastResult ;
}
2026-07-20 16:05:17 +00:00
if ( tmp25 ) {
2026-08-24 06:08:38 +00:00
tmp25 = DISCORD_EPOCHDefault . extractTimestamp ( lastResult . id ) <= num ;
const obj9 = DISCORD_EPOCHDefault ;
2026-07-20 16:05:17 +00:00
}
flag4 = tmp25 ;
}
if ( ! flag4 ) {
let tmp28 = null != firstResult && null != lastResult ;
if ( tmp28 ) {
2026-08-24 06:08:38 +00:00
tmp28 = DISCORD_EPOCHDefault . extractTimestamp ( firstResult . id ) < num ;
const obj10 = DISCORD_EPOCHDefault ;
2026-07-20 16:05:17 +00:00
}
if ( tmp28 ) {
2026-08-24 06:08:38 +00:00
tmp28 = DISCORD_EPOCHDefault . extractTimestamp ( lastResult . id ) > num ;
const obj11 = DISCORD_EPOCHDefault ;
2026-07-20 16:05:17 +00:00
}
flag4 = tmp28 ;
}
if ( flag4 ) {
2026-07-29 08:29:29 +00:00
const obj4 = { type : "LOAD_MESSAGES_SUCCESS_CACHED" , channelId : null , jump : null , limit : null } ;
obj4 [ 1 ] = channelId ;
obj4 [ 2 ] = tmp13 ;
obj4 [ 3 ] = closure_34 ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj4 ) ;
2026-07-20 16:05:17 +00:00
flag4 = true ;
2026-08-24 06:08:38 +00:00
const obj12 = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
}
return flag4 ;
}
}
return false ;
} ,
sendMessage ( arg0 , arg1 ) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
2026-07-29 08:29:29 +00:00
let flag = arg2 ;
2026-07-20 16:05:17 +00:00
if ( arg2 === undefined ) {
flag = true ;
}
2026-08-24 06:08:38 +00:00
closure_3 = arg3 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( c4 === 2 ) {
c4 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2 ;
2026-08-24 06:08:38 +00:00
if ( 0 === obj5 ) {
2026-07-29 08:29:29 +00:00
if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp5 ;
closure_1 = tmp2 ;
closure_0 = undefined ;
2026-07-29 08:29:29 +00:00
closure_1 = undefined ;
closure_2 = undefined ;
2026-08-24 06:08:38 +00:00
if ( closure_1_1 . reaction ) {
2026-07-29 08:29:29 +00:00
c4 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = Promise . resolve ( ) ;
return obj1 ;
} else {
2026-08-24 06:08:38 +00:00
obj5 = 1 ;
2026-07-29 08:29:29 +00:00
c4 = 1 ;
let obj2 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_1 ( obj5 [ 62 ] ) ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj2 ;
}
}
} else if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = arg1 ;
return obj3 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_0 = arg1 ;
if ( null != closure_0 ) {
c4 = 3 ;
const obj4 = { value : null , done : true } ;
2026-08-24 06:08:38 +00:00
obj4 [ 0 ] = closure_1_55 . sendMessage ( closure_1_0 , closure_1_1 , closure_1_2 , obj5 ) ;
2026-07-29 08:29:29 +00:00
return obj4 ;
} else {
2026-08-24 06:08:38 +00:00
const nonce = obj5 . nonce ;
2026-07-29 08:29:29 +00:00
closure_0 = nonce ;
if ( nonce == null ) {
2026-08-24 06:08:38 +00:00
obj = closure_1_0 ( obj5 [ 49 ] ) ;
2026-07-29 08:29:29 +00:00
closure_0 = obj . createNonce ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_1 = closure_0 ;
2026-08-24 06:08:38 +00:00
obj5 = { } ;
const merged = Object . assign ( obj5 ) ;
2026-07-29 08:29:29 +00:00
obj5 . nonce = closure_1 ;
2026-08-24 06:08:38 +00:00
obj2 = closure_1_1 ( obj5 [ 63 ] ) ;
2026-07-29 08:29:29 +00:00
closure_2 = obj2 . backgroundify ( function _trySend() {
2026-08-24 06:08:38 +00:00
return closure_1_55 . _sendMessage ( closure_0 , closure_1 , c3 ) ;
2026-07-29 08:29:29 +00:00
} , undefined ) ;
2026-08-24 06:08:38 +00:00
const result = closure_1_9 . recordMessageSendAttempt ( closure_1_0 , closure_1 , obj5 ) ;
if ( closure_1_21 . isReady ( closure_1_0 ) ) {
closure_1_2 ( ) ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
if ( closure_1_2 ) {
if ( closure_1_0 !== closure_1_0 ( obj5 [ 53 ] ) . FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID ) {
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
closure_1_50 . info ( "Waiting for channel " + closure_0 + " to be ready before sending." ) ;
2026-07-29 08:29:29 +00:00
new Promise ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2_21 . whenReady ( closure_0 , ( ) = > {
closure_3_50 . info ( "Channel " + closure_0 + " is ready for sending now." ) ;
closure_1_2 ( ) . then ( closure_0 , closure_1 ) ;
2026-07-29 08:29:29 +00:00
} ) ;
} ) ;
}
}
2026-08-24 06:08:38 +00:00
closure_1_2 ( ) ;
2026-07-29 08:29:29 +00:00
}
c4 = 3 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} catch ( tmp57 ) {
c4 = tmp ;
throw tmp57 ;
2026-07-20 16:05:17 +00:00
}
}
} ) ( ) ;
} ,
getSendMessageOptionsForReply ( pendingReply ) {
if ( null == pendingReply ) {
let obj = { } ;
} else {
const channel = pendingReply . channel ;
const guildId = channel . getGuildId ( ) ;
2026-07-29 08:29:29 +00:00
obj = { messageReference : null , allowedMentions : null , mediaMention : null } ;
obj = { guild_id : null , channel_id : null , message_id : null } ;
obj [ 0 ] = guildId ;
obj [ 1 ] = pendingReply . channel . id ;
obj [ 2 ] = pendingReply . message . id ;
obj [ 0 ] = obj ;
2026-07-20 16:05:17 +00:00
let tmp2 ;
if ( ! pendingReply . shouldMention ) {
2026-07-29 08:29:29 +00:00
obj = { parse : null , replied_user : false } ;
2026-07-20 16:05:17 +00:00
const _Object = Object ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = Object . values ( closure_36 ) ;
2026-07-20 16:05:17 +00:00
tmp2 = obj ;
}
2026-07-29 08:29:29 +00:00
obj [ 1 ] = tmp2 ;
obj [ 2 ] = pendingReply . mediaMention ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ,
getSendMessageOptionsForStickers ( stickers ) {
stickers = stickers . stickers ;
if ( null != stickers ) {
if ( 0 !== stickers . length ) {
if ( ! tmp ) {
2026-07-29 08:29:29 +00:00
let obj = { stickerIds : null } ;
obj [ 0 ] = stickers ;
2026-07-20 16:05:17 +00:00
}
return obj ;
}
}
obj = { } ;
} ,
getSendMessageOptionsForScheduledMessage ( scheduledTimestamp ) {
scheduledTimestamp = scheduledTimestamp . scheduledTimestamp ;
if ( null == scheduledTimestamp ) {
let obj = { } ;
} else {
2026-07-29 08:29:29 +00:00
obj = { scheduledTimestamp : null } ;
obj [ 0 ] = scheduledTimestamp ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ,
getSendMessageOptionsForAlsoForwardToChannel ( alsoForwardToChannelId ) {
return { alsoForwardToChannelId : alsoForwardToChannelId.alsoForwardToChannelId } ;
} ,
getSendMessageOptions ( pendingReply ) {
let obj = { } ;
const merged = Object . assign ( obj14 . getSendMessageOptionsForReply ( pendingReply . pendingReply ) ) ;
obj = { } ;
const merged1 = Object . assign ( pendingReply ) ;
const merged2 = Object . assign ( obj14 . getSendMessageOptionsForStickers ( obj ) ) ;
obj = { } ;
const merged3 = Object . assign ( pendingReply ) ;
const merged4 = Object . assign ( obj14 . getSendMessageOptionsForScheduledMessage ( obj ) ) ;
const merged5 = Object . assign ( pendingReply ) ;
const merged6 = Object . assign ( obj14 . getSendMessageOptionsForAlsoForwardToChannel ( { } ) ) ;
return obj ;
} ,
2026-07-29 08:29:29 +00:00
sendInvite ( c1 , code , c3 , c4 , content ) {
2026-08-24 06:08:38 +00:00
const tmp = getInviteURLDefault ( code ) ;
2026-07-29 08:29:29 +00:00
content = tmp ;
2026-07-20 16:05:17 +00:00
if ( null != content ) {
const _HermesInternal = HermesInternal ;
2026-07-29 08:29:29 +00:00
content = "" + content + "\n" + tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj14 . _sendMessage ( c1 , { content , tts : false , validNonShortcutEmojis : [ ] , invalidEmojis : [ ] } , { location : c3 , inviteAnalyticsMetadata : c4 } ) ;
2026-07-20 16:05:17 +00:00
} ,
sendActivityBookmark ( arg0 , content , location , inviteAnalyticsMetadata ) {
let obj = { content , tts : false , validNonShortcutEmojis : [ ] , invalidEmojis : [ ] } ;
obj = { location , inviteAnalyticsMetadata } ;
return obj14 . _sendMessage ( arg0 , obj , obj ) ;
} ,
sendStickers ( id , items1 , result , arg3 ) {
let str = result ;
if ( result === undefined ) {
str = "" ;
}
2026-07-29 08:29:29 +00:00
let flag = arg4 ;
if ( arg4 === undefined ) {
2026-07-20 16:05:17 +00:00
flag = false ;
}
2026-08-04 21:03:28 +00:00
if ( typeof str === "string" ) {
2026-07-29 08:29:29 +00:00
let obj = { content : null , invalidEmojis : null , validNonShortcutEmojis : null , tts : null } ;
obj [ 0 ] = str ;
obj [ 1 ] = [ ] ;
obj [ 2 ] = [ ] ;
obj [ 3 ] = flag ;
let tmp = obj ;
2026-07-20 16:05:17 +00:00
} else {
obj = { } ;
const merged = Object . assign ( str ) ;
2026-07-29 08:29:29 +00:00
let tts = str . tts ;
if ( tts == null ) {
tts = flag ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj . tts = tts ;
tmp = obj ;
2026-07-20 16:05:17 +00:00
}
obj = { } ;
const merged1 = Object . assign ( arg3 ) ;
2026-07-29 08:29:29 +00:00
obj . stickerIds = items1 ;
return obj14 . _sendMessage ( id , tmp , obj ) ;
2026-07-20 16:05:17 +00:00
} ,
2026-08-24 06:08:38 +00:00
sendGreetMessage ( id , closure_1_14 , sendMessageOptionsForReply ) {
2026-07-23 10:11:24 +00:00
const _require = id ;
2026-08-24 06:08:38 +00:00
closure_1 = closure_1_14 ;
2026-07-29 08:29:29 +00:00
let obj = sendMessageOptionsForReply ;
2026-07-20 16:05:17 +00:00
if ( sendMessageOptionsForReply === undefined ) {
obj = { } ;
}
( { messageReference , allowedMentions } = obj ) ;
2026-07-29 08:29:29 +00:00
const HTTP = _require ( 530 ) . HTTP ;
2026-08-24 06:08:38 +00:00
obj = { url : closure_28.MESSAGES_GREET ( id ) , body : { sticker_ids : items , allowed_mentions : allowedMentions , message_reference : messageReference } , oldFormErrors : true , rejectWithError : _require ( 530 ) . rejectWithMigratedError ( ) , context : null } ;
items = [ closure_1_14 ] ;
2026-07-20 16:05:17 +00:00
obj = { location : constants10.GREET } ;
2026-07-29 08:29:29 +00:00
obj [ 4 ] = obj ;
const obj3 = _require ( 530 ) ;
2026-07-20 16:05:17 +00:00
return HTTP . post ( obj ) . then ( ( body ) = > {
2026-08-24 06:08:38 +00:00
callback ( closure_1_3 [ 65 ] ) . donateSentMessage ( body . body . content , closure_0 ) ;
closure_1_55 . receiveMessage ( closure_0 , body . body ) ;
const obj = callback ( closure_1_3 [ 65 ] ) ;
const items = [ callback ] ;
callback ( closure_1_3 [ 46 ] ) . dispatch ( { type : "STICKER_TRACK_USAGE" , stickerIds : items } ) ;
2026-07-20 16:05:17 +00:00
return body ;
} , ( messageId ) = > {
2026-08-24 06:08:38 +00:00
closure_1_49 . log ( "Failed to send greeting" ) ;
2026-07-20 16:05:17 +00:00
if ( 429 !== messageId . status ) {
2026-08-24 06:08:38 +00:00
closure_1_55 . sendClydeError ( closure_0 , messageId . body . code ) ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let obj = callback ( closure_1_3 [ 46 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "MESSAGE_SEND_FAILED" , messageId : messageId.body.id , channelId : closure_0 } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
throw messageId ;
} ) ;
} ,
2026-07-29 08:29:29 +00:00
sendPollMessage ( id , poll , arg2 ) {
2026-07-20 16:05:17 +00:00
let obj = arg2 ;
if ( arg2 === undefined ) {
obj = { } ;
}
obj = { } ;
const merged = Object . assign ( obj ) ;
2026-07-29 08:29:29 +00:00
obj . poll = poll ;
obj . location = constants10 . POLL_CREATION ;
return obj14 . _sendMessage ( id , { content : "" , tts : false , validNonShortcutEmojis : [ ] , invalidEmojis : [ ] } , obj ) ;
2026-07-20 16:05:17 +00:00
} ,
2026-07-29 08:29:29 +00:00
validateMessage ( invalidEmojis , currentUser , throwTypeErrorResult ) {
2026-07-20 16:05:17 +00:00
if ( invalidEmojis . some ( ( animated ) = > animated . animated ) ) {
2026-08-24 06:08:38 +00:00
let obj = getPremiumPlanItemDefault ;
2026-07-20 16:05:17 +00:00
if ( ! obj . canUseAnimatedEmojis ( currentUser ) ) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
let stringResult = intl . string ( getSystemLocale . t [ "V5/GgC" ] ) ;
2026-07-20 16:05:17 +00:00
let str = "INVALID_ANIMATED_EMOJI_BODY" ;
}
2026-07-29 08:29:29 +00:00
obj = { errorMessage : null , errorMessageName : null } ;
obj [ 0 ] = stringResult ;
obj [ 1 ] = str ;
2026-07-20 16:05:17 +00:00
return obj ;
}
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale . intl ;
stringResult = intl2 . string ( getSystemLocale . t [ "Q87rI/" ] ) ;
2026-07-20 16:05:17 +00:00
str = "INVALID_EXTERNAL_EMOJI_BODY" ;
} ,
_sendMessage ( arg0 , arg1 , arg2 ) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = arg2 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( c8 === 2 ) {
c8 = 3 ;
let throwTypeErrorResult = HermesBuiltin . throwTypeError ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = arg1 ;
throwTypeErrorResult = arg0 ;
throwTypeErrorResult = tmp6 ;
throwTypeErrorResult = globalThis ;
throwTypeErrorResult = null ;
if ( tmp7 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c8 = 2 ;
if ( 0 === c7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
stickerIds = tmp3 ;
c3 = tmp5 ;
2026-08-24 06:08:38 +00:00
closure_0 = undefined ;
2026-07-29 08:29:29 +00:00
closure_1 = undefined ;
2026-08-24 06:08:38 +00:00
c2 = undefined ;
2026-07-29 08:29:29 +00:00
c3 = undefined ;
stickerIds = undefined ;
let messageReference ;
2026-08-24 06:08:38 +00:00
c6 = undefined ;
2026-07-29 08:29:29 +00:00
c7 = undefined ;
c8 = undefined ;
c9 = undefined ;
2026-08-24 06:08:38 +00:00
c10 = undefined ;
closure_11 = undefined ;
2026-07-29 08:29:29 +00:00
let DEFAULT ;
2026-08-24 06:08:38 +00:00
closure_13 = undefined ;
closure_14 = undefined ;
2026-07-29 08:29:29 +00:00
let uploader ;
let obj4 ;
2026-08-24 06:08:38 +00:00
closure_17 = undefined ;
2026-07-29 08:29:29 +00:00
attachments = undefined ;
2026-08-24 06:08:38 +00:00
c19 = undefined ;
c20 = undefined ;
c21 = undefined ;
c22 = undefined ;
c23 = undefined ;
throwTypeErrorResult = closure_1_1 ;
throwTypeErrorResult = closure_1_3 ;
throwTypeErrorResult = closure_1_0 ;
const promise = closure_1_1 ( closure_1_3 [ 62 ] ) ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
if ( null != promise ) {
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_50 ;
throwTypeErrorResult = closure_1_50 . info ( "Converting channel to a private channel" ) ;
2026-07-29 08:29:29 +00:00
c8 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = promise . then ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_1_50 . info ( "Finished converting channel to a private channel" ) ;
return closure_1_55 . _sendMessage ( arg0 , closure_1 , c2 ) ;
2026-07-29 08:29:29 +00:00
} ) ;
return obj1 ;
} else {
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_1 ;
const content = closure_1_1 . content ;
closure_0 = content ;
( { invalidEmojis , validNonShortcutEmojis : closure_1 , tts } = closure_1_1 ) ;
2026-07-29 08:29:29 +00:00
let tmp40 = undefined !== tts ;
if ( tmp40 ) {
tmp40 = tts ;
}
2026-08-24 06:08:38 +00:00
( { activityAction , location : _location } = closure_1_2 ) ;
2026-07-29 08:29:29 +00:00
c2 = _location ;
2026-08-24 06:08:38 +00:00
( { inviteAnalyticsMetadata : c3 , stickerIds } = closure_1_2 ) ;
messageReference = closure_1_2 . messageReference ;
( { allowedMentions , poll } = closure_1_2 ) ;
2026-07-29 08:29:29 +00:00
c6 = poll ;
2026-08-24 06:08:38 +00:00
( { sharedCustomTheme , contentInventoryEntry } = closure_1_2 ) ;
2026-07-29 08:29:29 +00:00
c7 = contentInventoryEntry ;
2026-08-24 06:08:38 +00:00
( { attachments , attachmentsToUpload } = closure_1_2 ) ;
2026-07-29 08:29:29 +00:00
c8 = attachmentsToUpload ;
2026-08-24 06:08:38 +00:00
( { onAttachmentUploadError : c9 , announcementSendOptions , withCheckpoint , mediaMention , flags } = closure_1_2 ) ;
closure_0 = flags ;
2026-07-29 08:29:29 +00:00
if ( flags == null ) {
2026-08-24 06:08:38 +00:00
closure_0 = 0 ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp45 = closure_1_4 ( throwTypeErrorResult ( closure_1_3 [ 67 ] ) ( content ) , 2 ) ;
let addFlagResult = closure_0 ;
2026-07-29 08:29:29 +00:00
let tmp48 = content ;
if ( tmp45 [ 0 ] ) {
2026-08-24 06:08:38 +00:00
closure_0 = tmp46 ;
obj4 = closure_1_0 ( closure_1_3 [ 68 ] ) ;
addFlagResult = obj4 . addFlag ( tmp42 , closure_1_33 . SUPPRESS_NOTIFICATIONS ) ;
2026-07-29 08:29:29 +00:00
tmp48 = tmp46 ;
}
2026-08-24 06:08:38 +00:00
let channel = closure_1_17 . getChannel ( throwTypeErrorResult ) ;
2026-07-29 08:29:29 +00:00
let guild_id ;
if ( channel != null ) {
guild_id = channel . guild_id ;
}
2026-08-24 06:08:38 +00:00
const guild = closure_1_19 . getGuild ( guild_id ) ;
let obj5 = closure_1_0 ( closure_1_3 [ 69 ] ) ;
2026-07-29 08:29:29 +00:00
let addFlagResult1 = addFlagResult ;
if ( obj5 . canSendGuildOfficialMessages ( guild , channel , "_sendMessage" ) ) {
2026-08-24 06:08:38 +00:00
let obj6 = closure_1_0 ( closure_1_3 [ 68 ] ) ;
addFlagResult1 = obj6 . addFlag ( addFlagResult , closure_1_33 . IS_GUILD_OFFICIAL ) ;
2026-07-29 08:29:29 +00:00
}
c10 = false ;
const messageReference2 = tmp41 . messageReference ;
let type ;
if ( messageReference2 != null ) {
type = messageReference2 . type ;
}
2026-08-24 06:08:38 +00:00
closure_11 = tmp65 ;
2026-07-29 08:29:29 +00:00
if ( "" === tmp48 ) {
if ( null == activityAction ) {
if ( null == stickerIds ) {
if ( null == poll ) {
if ( null == sharedCustomTheme ) {
if ( null == contentInventoryEntry ) {
if ( ! tmp65 ) {
if ( null == attachments ) {
if ( ! withCheckpoint ) {
if ( null == throwTypeErrorResult . components ) {
if ( null != attachmentsToUpload ) {
if ( attachmentsToUpload . length > 0 ) {
c10 = true ;
}
}
c8 = 3 ;
let obj2 = { value : null , done : true } ;
obj2 [ 0 ] = Promise . resolve ( ) ;
return obj2 ;
}
}
}
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
2026-07-29 08:29:29 +00:00
if ( null != messageReference ) {
2026-08-24 06:08:38 +00:00
DEFAULT = closure_1_35 . REPLY ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
DEFAULT = closure_1_35 . DEFAULT ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const nonce = tmp41 . nonce ;
closure_1 = nonce ;
if ( nonce == null ) {
2026-08-24 06:08:38 +00:00
let obj8 = closure_1_0 ( closure_1_3 [ 49 ] ) ;
2026-07-29 08:29:29 +00:00
closure_1 = obj8 . createNonce ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_13 = closure_1 ;
2026-08-24 06:08:38 +00:00
closure_14 = closure_1 ;
2026-08-06 08:05:19 +00:00
let obj3 = { channelId : null , content : null , tts : null , type : null , messageReference : null , allowedMentions : null , flags : null , nonce : null , poll : null , sharedCustomTheme : null , mediaMention : null } ;
2026-07-29 08:29:29 +00:00
obj3 [ 0 ] = throwTypeErrorResult ;
obj3 [ 1 ] = tmp48 ;
obj3 [ 2 ] = tmp40 ;
obj3 [ 3 ] = DEFAULT ;
obj3 [ 4 ] = messageReference ;
obj3 [ 5 ] = allowedMentions ;
let tmp73 ;
if ( 0 !== addFlagResult1 ) {
tmp73 = addFlagResult1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj3 [ 6 ] = tmp73 ;
obj3 [ 7 ] = closure_1 ;
2026-08-24 06:08:38 +00:00
let obj10 = closure_1_0 ( closure_1_3 [ 70 ] ) ;
2026-07-29 08:29:29 +00:00
obj3 [ 8 ] = obj10 . createPollServerDataFromCreateRequest ( poll ) ;
obj3 [ 9 ] = sharedCustomTheme ;
obj3 [ 10 ] = mediaMention ;
2026-08-24 06:08:38 +00:00
const tmpResultResult = throwTypeErrorResult ( closure_1_3 [ 47 ] ) ( obj3 ) ;
if ( false !== closure_1_2 . eagerDispatch ) {
let result = closure_1_0 ( closure_1_3 [ 71 ] ) . updateComboOnMessageSend ( throwTypeErrorResult , tmpResultResult . id ) ;
2026-07-29 08:29:29 +00:00
if ( null != stickerIds ) {
const mapped = stickerIds . map ( ( arg0 ) = > stickerById . getStickerById ( arg0 ) ) ;
tmpResultResult . sticker_items = mapped . filter ( ( arg0 ) = > null != arg0 ) ;
}
2026-08-24 06:08:38 +00:00
closure_1_55 . receiveMessage ( throwTypeErrorResult , tmpResultResult , true , tmp41 ) ;
let obj12 = closure_1_0 ( closure_1_3 [ 71 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
if ( ! c51 ) {
2026-07-29 08:29:29 +00:00
if ( null != invalidEmojis ) {
if ( invalidEmojis . length > 0 ) {
2026-08-24 06:08:38 +00:00
c51 = true ;
const validateMessageResult = closure_1_55 . validateMessage ( invalidEmojis , closure_1_25 . getCurrentUser ( ) , throwTypeErrorResult ) ;
closure_1_55 . sendBotMessage ( throwTypeErrorResult , validateMessageResult . errorMessage , validateMessageResult . errorMessageName ) ;
2026-07-29 08:29:29 +00:00
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != announcementSendOptions ) {
2026-08-24 06:08:38 +00:00
let SEND = closure_1_0 ( closure_1_3 [ 72 ] ) . MessageDataType . SEND_ANNOUNCEMENT ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
SEND = closure_1_0 ( closure_1_3 [ 72 ] ) . MessageDataType . SEND ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4 = { type : null , message : null } ;
obj4 [ 0 ] = SEND ;
obj5 = { channelId : null , content : null , nonce : null , tts : null , message_reference : null , allowed_mentions : null , flags : null , analyticsLocation : null } ;
obj5 [ 0 ] = throwTypeErrorResult ;
obj5 [ 1 ] = tmp48 ;
obj5 [ 2 ] = closure_1 ;
obj5 [ 3 ] = tmp40 ;
obj5 [ 4 ] = messageReference ;
obj5 [ 5 ] = allowedMentions ;
obj5 [ 6 ] = addFlagResult1 ;
obj5 [ 7 ] = _location ;
obj4 [ 1 ] = obj5 ;
if ( null != throwTypeErrorResult . components ) {
obj4 . message . components = throwTypeErrorResult . components ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != announcementSendOptions ) {
( { createThread : obj13.message.create_thread , threadName : obj13.message.title , publish } = announcementSendOptions ) ;
c2 = publish ;
if ( publish == null ) {
c2 = false ;
}
obj4 . message . publish = c2 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != activityAction ) {
let session_id ;
if ( activityAction != null ) {
session_id = activityAction . activity . session_id ;
}
let sessionId = session_id ;
2026-08-24 06:08:38 +00:00
if ( activityAction . type !== closure_1_43 . JOIN_REQUEST ) {
2026-07-29 08:29:29 +00:00
sessionId = session_id ;
if ( activityAction . type !== tmp97 . STREAM_REQUEST ) {
sessionId = session_id ;
if ( null == session_id ) {
2026-08-24 06:08:38 +00:00
sessionId = closure_1_16 . getSessionId ( ) ;
2026-07-29 08:29:29 +00:00
}
}
}
if ( null != sessionId ) {
obj6 = { type : null , session_id : null , target_user_id : null } ;
obj6 [ 0 ] = activityAction . type ;
obj6 [ 1 ] = sessionId ;
( { targetUserId : obj15 [ 2 ] , activity } = activityAction ) ;
throwTypeErrorResult = null != activity . party ;
if ( throwTypeErrorResult ) {
throwTypeErrorResult = null != activity . party . id ;
}
if ( throwTypeErrorResult ) {
obj6 . party_id = activity . party . id ;
}
obj4 . message . application_id = activity . application_id ;
obj4 . message . activity = obj6 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if ( null != poll ) {
obj4 . message . poll = poll ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != sharedCustomTheme ) {
obj4 . message . shared_client_theme = sharedCustomTheme ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != stickerIds ) {
obj4 . message . sticker_ids = stickerIds ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_10 ;
if ( closure_1_10 . isEnabled ( ) ) {
2026-07-29 08:29:29 +00:00
obj4 . message . has_poggermode_enabled = true ;
}
if ( withCheckpoint ) {
obj4 . message . with_checkpoint = true ;
}
if ( null != contentInventoryEntry ) {
obj4 . message . content_inventory_entry = contentInventoryEntry ;
}
if ( null != mediaMention ) {
obj4 . message . media_mention = mediaMention ;
}
throwTypeErrorResult = null != attachments ;
if ( throwTypeErrorResult ) {
throwTypeErrorResult = attachments . length > 0 ;
}
if ( throwTypeErrorResult ) {
obj4 . message . attachments = attachments ;
}
if ( null != attachmentsToUpload ) {
if ( attachmentsToUpload . length > 0 ) {
c6 = 1 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_0 ;
throwTypeErrorResult = closure_1_3 ;
2026-07-29 08:29:29 +00:00
let obj7 = { channelId : null , nonce : null , items : null , message : null , shouldUploadFailureSendNotification : null } ;
obj7 [ 0 ] = throwTypeErrorResult ;
obj7 [ 1 ] = tmp70 ;
obj7 [ 2 ] = attachmentsToUpload ;
obj7 [ 3 ] = tmpResultResult ;
const doNotNotifyOnError = tmp41 . doNotNotifyOnError ;
throwTypeErrorResult = ! doNotNotifyOnError ;
obj7 [ 4 ] = throwTypeErrorResult ;
c7 = 2 ;
c8 = 1 ;
obj8 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj8 [ 0 ] = closure_1_0 ( closure_1_3 [ 73 ] ) . uploadMessageAttachments ( obj7 ) ;
2026-07-29 08:29:29 +00:00
return obj8 ;
}
}
throwTypeErrorResult = c3 ;
throwTypeErrorResult = new . target ;
throwTypeErrorResult = new . target ;
throwTypeErrorResult = new Promise ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = Date . now ( ) ;
closure_2_1 ( closure_2_3 [ 72 ] ) . length ;
2026-07-29 08:29:29 +00:00
const rounded = Math . floor ( 10000 * Math . random ( ) ) ;
2026-08-24 06:08:38 +00:00
closure_2_50 . info ( "Queueing message to be sent LogId:" + rounded ) ;
closure_2_1 ( closure_2_3 [ 72 ] ) . enqueue ( obj4 , ( ok ) = > {
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = ok ;
2026-07-29 08:29:29 +00:00
if ( ok . ok ) {
2026-08-24 06:08:38 +00:00
obj14 = closure_3_1 ( closure_3_3 [ 65 ] ) ;
obj14 . donateSentMessage ( closure_0 , closure_0 ) ;
2026-07-29 08:29:29 +00:00
let obj = { sendAnalytics : null , poll : null } ;
obj = { duration : null , queueSize : null } ;
2026-08-03 11:20:01 +00:00
obj [ 0 ] = pendingReplyActionSource ;
obj [ 1 ] = pendingReplyActionSource ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = obj ;
2026-08-24 06:08:38 +00:00
obj [ 1 ] = closure_1_6 ;
closure_3_55 . receiveMessage ( closure_0 , ok . body , true , obj ) ;
2026-07-29 08:29:29 +00:00
if ( null != c2 . alsoForwardToChannelId ) {
2026-08-24 06:08:38 +00:00
let obj17 = closure_3_1 ( closure_3_3 [ 75 ] ) ;
let obj19 = closure_3_0 ( closure_3_3 [ 52 ] ) ;
const sendForwardResult = obj17 . sendForward ( closure_3_0 ( closure_3_3 [ 52 ] ) . createMessageRecord ( ok . body ) , c2 . alsoForwardToChannelId ) ;
obj17 . sendForward ( closure_3_0 ( closure_3_3 [ 52 ] ) . createMessageRecord ( ok . body ) , c2 . alsoForwardToChannelId ) . then ( ( ) = > {
2026-08-03 11:20:01 +00:00
const body = pendingReplyActionSource . body ;
2026-08-24 06:08:38 +00:00
id = undefined ;
2026-07-29 08:29:29 +00:00
if ( body != null ) {
id = body . id ;
}
const body2 = tmp . body ;
let guild_id ;
if ( body2 != null ) {
guild_id = body2 . guild_id ;
}
const body3 = tmp . body ;
let channel_id ;
if ( body3 != null ) {
channel_id = body3 . channel_id ;
}
2026-08-24 06:08:38 +00:00
closure_4_1 ( closure_4_3 [ 37 ] ) . track ( closure_4_27 . MESSAGE_ALSO_SEND_TO_CHANNEL_SENT , { referenced_message_id : id , guild_id , channel_id , destination_channel_id : attachments.alsoForwardToChannelId } ) ;
2026-07-29 08:29:29 +00:00
} ) . catch ( ( arg0 ) = > {
2026-08-03 11:20:01 +00:00
const body = pendingReplyActionSource . body ;
2026-08-24 06:08:38 +00:00
id = undefined ;
const combined = "Failed to forward thread message to parent channel LogId:" + closure_4 ;
2026-07-29 08:29:29 +00:00
if ( body != null ) {
id = body . id ;
}
2026-08-24 06:08:38 +00:00
closure_4_49 . log ( combined , { referencedMessageId : id , channelId : closure_0 , destinationChannelId : attachments.alsoForwardToChannelId , error : arg0.toString ( ) } ) ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
const nextPromise = obj17 . sendForward ( closure_3_0 ( closure_3_3 [ 52 ] ) . createMessageRecord ( ok . body ) , c2 . alsoForwardToChannelId ) . then ( ( ) = > {
2026-08-03 11:20:01 +00:00
const body = pendingReplyActionSource . body ;
2026-08-24 06:08:38 +00:00
id = undefined ;
2026-07-29 08:29:29 +00:00
if ( body != null ) {
id = body . id ;
}
const body2 = tmp . body ;
let guild_id ;
if ( body2 != null ) {
guild_id = body2 . guild_id ;
}
const body3 = tmp . body ;
let channel_id ;
if ( body3 != null ) {
channel_id = body3 . channel_id ;
}
2026-08-24 06:08:38 +00:00
closure_4_1 ( closure_4_3 [ 37 ] ) . track ( closure_4_27 . MESSAGE_ALSO_SEND_TO_CHANNEL_SENT , { referenced_message_id : id , guild_id , channel_id , destination_channel_id : attachments.alsoForwardToChannelId } ) ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
request = request . getRequest ( closure_3_1 ( closure_3_3 [ 57 ] ) . cast ( closure_0 ) ) ;
2026-07-29 08:29:29 +00:00
if ( null != request ) {
( { guildId , userId , applicationStatus } = request ) ;
2026-08-24 06:08:38 +00:00
obj1 = { guildId : null , channelId : null , messageId : null , joinRequestStatus : null , joinRequestUserId : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = guildId ;
2026-08-24 06:08:38 +00:00
obj1 [ 1 ] = closure_0 ;
2026-07-29 08:29:29 +00:00
obj1 [ 2 ] = ok . body . id ;
obj1 [ 3 ] = applicationStatus ;
obj1 [ 4 ] = userId ;
2026-08-24 06:08:38 +00:00
let result = closure_3_0 ( closure_3_3 [ 76 ] ) . trackMemberApplicationInterviewMessage ( obj1 ) ;
const obj21 = closure_3_0 ( closure_3_3 [ 76 ] ) ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
let result1 = closure_3_9 . recordMessageSendApiResponse ( closure_1_13 ) ;
pendingReplyActionSource = closure_3_35 ;
if ( closure_1_12 === closure_3_35 . REPLY ) {
2026-07-29 08:29:29 +00:00
id = ok . body . id ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
if ( closure_1_5 != null ) {
const message_id = closure_1_5 . message_id ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_11 ;
pendingReplyActionSource = closure_3_11 . getPendingReplyActionSource ( pendingReplyActionSource ) ;
2026-07-29 08:29:29 +00:00
if ( "message_swipe" === pendingReplyActionSource ) {
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = null ;
2026-07-29 08:29:29 +00:00
if ( null != message_id ) {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_21 ;
pendingReplyActionSource = closure_3_21 . getMessage ( pendingReplyActionSource , message_id ) ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_17 ;
pendingReplyActionSource = closure_3_17 . getChannel ( pendingReplyActionSource ) ;
pendingReplyActionSource = closure_3_25 ;
pendingReplyActionSource = closure_3_25 . getCurrentUser ( ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
pendingReplyActionSource = closure_3_27 ;
2026-07-29 08:29:29 +00:00
let obj2 = { message_id : null , channel_id : null , guild_id : null , swipe_action : "reply" , is_own_message : null } ;
obj2 [ 0 ] = id ;
2026-08-03 11:20:01 +00:00
obj2 [ 1 ] = pendingReplyActionSource ;
pendingReplyActionSource = undefined ;
if ( pendingReplyActionSource != null ) {
pendingReplyActionSource = pendingReplyActionSource . guild_id ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
obj2 [ 2 ] = pendingReplyActionSource ;
pendingReplyActionSource = null != pendingReplyActionSource ;
if ( pendingReplyActionSource ) {
pendingReplyActionSource = undefined ;
if ( pendingReplyActionSource != null ) {
pendingReplyActionSource = pendingReplyActionSource . author . id ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = pendingReplyActionSource . id === pendingReplyActionSource ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
obj2 [ 4 ] = pendingReplyActionSource ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 37 ] ) . track ( closure_3_27 . MESSAGE_SWIPE_ACTION_SENT , obj2 ) ;
const obj25 = closure_3_1 ( closure_3_3 [ 37 ] ) ;
2026-07-29 08:29:29 +00:00
} else if ( "message_shortcut" === pendingReplyActionSource ) {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_17 ;
pendingReplyActionSource = closure_3_17 . getChannel ( pendingReplyActionSource ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
pendingReplyActionSource = closure_3_27 ;
2026-07-29 08:29:29 +00:00
let obj3 = { message_id : null , channel_id : null , guild_id : null , original_message_id : null , action : "reply" } ;
obj3 [ 0 ] = id ;
2026-08-03 11:20:01 +00:00
obj3 [ 1 ] = pendingReplyActionSource ;
pendingReplyActionSource = undefined ;
if ( pendingReplyActionSource != null ) {
pendingReplyActionSource = pendingReplyActionSource . guild_id ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
obj3 [ 2 ] = pendingReplyActionSource ;
2026-07-29 08:29:29 +00:00
obj3 [ 3 ] = message_id ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const obj41 = closure_3_1 ( closure_3_3 [ 37 ] ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = undefined ;
if ( pendingReplyActionSource != null ) {
pendingReplyActionSource = pendingReplyActionSource . guild_id ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = obj3 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = Object . assign ( closure_3_0 ( closure_3_3 [ 33 ] ) . collectGuildAnalyticsMetadata ( pendingReplyActionSource ) ) ;
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const obj23 = closure_3_0 ( closure_3_3 [ 33 ] ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = obj3 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = Object . assign ( closure_3_0 ( closure_3_3 [ 33 ] ) . collectChannelAnalyticsMetadata ( pendingReplyActionSource ) ) ;
pendingReplyActionSource = obj41 . track ( closure_3_27 . MESSAGE_SHORTCUT_ACTION_SENT , obj3 ) ;
const obj24 = closure_3_0 ( closure_3_3 [ 33 ] ) ;
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
const obj20 = closure_3_1 ( closure_3_3 [ 57 ] ) ;
obj4 = { type : "SLOWMODE_RESET_COOLDOWN" , slowmodeType : null , channelId : null } ;
pendingReplyActionSource = closure_3_24 ;
obj4 [ 1 ] = closure_3_24 . SendMessage ;
pendingReplyActionSource = closure_0 ;
obj4 [ 2 ] = closure_0 ;
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 46 ] ) . dispatch ( obj4 ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
const obj27 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
let obj5 = { type : "EMOJI_TRACK_USAGE" , emojiUsed : null } ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = closure_1 ;
2026-07-29 08:29:29 +00:00
obj5 [ 1 ] = closure_1 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 46 ] ) . dispatch ( obj5 ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
const obj29 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
const obj6 = { type : "STICKER_TRACK_USAGE" , stickerIds : null } ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = rounded ;
2026-07-29 08:29:29 +00:00
obj6 [ 1 ] = rounded ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 46 ] ) . dispatch ( obj6 ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
const obj31 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
let obj7 = { type : "LOCAL_MESSAGE_CREATE" , message : null } ;
const obj8 = { channel_id : null , author : null } ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
obj8 [ 0 ] = closure_0 ;
pendingReplyActionSource = closure_3_25 ;
obj8 [ 1 ] = closure_3_25 . getCurrentUser ( ) ;
2026-07-29 08:29:29 +00:00
obj7 [ 1 ] = obj8 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 46 ] ) . dispatch ( obj7 ) ;
2026-07-29 08:29:29 +00:00
let obj9 = { content : null , channelId : null , messageId : null , location : null , inviteAnalyticsMetadata : null } ;
obj9 [ 0 ] = closure_0 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
obj9 [ 1 ] = closure_0 ;
2026-07-29 08:29:29 +00:00
obj9 [ 2 ] = ok . body . id ;
let str4 = closure_2 ;
let str5 = closure_2 ;
if ( closure_2 == null ) {
str5 = "chat_input" ;
}
obj9 [ 3 ] = str5 ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = length ;
2026-07-29 08:29:29 +00:00
obj9 [ 4 ] = length ;
2026-08-03 11:20:01 +00:00
( { channelId : pendingReplyActionSource , messageId : id , location : attachments , inviteAnalyticsMetadata : pendingReplyActionSource , overrideProperties , content } = obj9 ) ;
2026-07-29 08:29:29 +00:00
if ( overrideProperties === undefined ) {
overrideProperties = { } ;
}
let messageByReference = overrideProperties ;
let id2 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_16 ;
id2 = closure_3_16 . getId ( ) ;
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
const obj33 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 28 ] ) ( content ) . forEach ( ( url ) = > {
2026-07-29 08:29:29 +00:00
( { type , code } = url ) ;
2026-08-03 11:20:01 +00:00
let obj = pendingReplyActionSource ( pendingReplyActionSource [ 29 ] ) ;
2026-07-29 08:29:29 +00:00
if ( obj . isApplicationCodedLink ( type ) ) {
let tmpResult = tmp ( tmp2 [ 29 ] ) ;
const applicationCodedLinkData = tmpResult . getApplicationCodedLinkData ( type , code , url . url ) ;
if ( null != applicationCodedLinkData ) {
( { applicationId , type : type2 } = applicationCodedLinkData ) ;
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . APP_DIRECTORY_PROFILE === type2 ) {
tmpResult = tmp ( tmp2 [ 31 ] ) ;
const result = tmpResult . trackAppDirectoryProfileEmbed ( applicationId ) ;
2026-08-24 06:08:38 +00:00
const result1 = tmp ( tmp2 [ 32 ] ) . trackAppEmbedLinkSent ( code , closure_1_44 . APP_DISCOVERY , closure_5 ) ;
2026-07-29 08:29:29 +00:00
const tmpResult1 = tmp ( tmp2 [ 32 ] ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . APP_DIRECTORY_STOREFRONT === type2 ) {
const result2 = tmp ( tmp2 [ 31 ] ) . trackAppDirectoryProfileEmbed ( applicationId , "storefront" ) ;
const tmpResult2 = tmp ( tmp2 [ 31 ] ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . APP_DIRECTORY_STOREFRONT_SKU === type2 ) {
const result3 = tmp ( tmp2 [ 31 ] ) . trackAppDirectoryProfileEmbed ( applicationId , "storefront_sku" ) ;
const tmpResult3 = tmp ( tmp2 [ 31 ] ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . ACTIVITY_BOOKMARK === type2 ) {
const params = applicationCodedLinkData . params ;
const tmpResult4 = tmp ( tmp2 [ 32 ] ) ;
2026-08-24 06:08:38 +00:00
const ACTIVITY = closure_1_44 . ACTIVITY ;
2026-07-29 08:29:29 +00:00
let referrerId = params . referrerId ;
if ( referrerId == null ) {
2026-08-24 06:08:38 +00:00
referrerId = closure_5 ;
2026-07-29 08:29:29 +00:00
}
const result4 = tmpResult4 . trackAppEmbedLinkSent ( applicationId , ACTIVITY , referrerId , params . customId ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . APP_OAUTH2_LINK === type2 ) {
2026-08-24 06:08:38 +00:00
const result5 = tmp ( tmp2 [ 32 ] ) . trackAppEmbedLinkSent ( applicationId , closure_1_44 . OAUTH , closure_5 ) ;
2026-07-29 08:29:29 +00:00
const tmpResult5 = tmp ( tmp2 [ 32 ] ) ;
obj = { application_id : null } ;
obj [ 0 ] = applicationId ;
2026-08-24 06:08:38 +00:00
id ( tmp2 [ 33 ] ) . trackWithMetadata ( closure_1_27 . APP_OAUTH2_LINK_EMBED_URL_SENT , obj ) ;
2026-07-29 08:29:29 +00:00
const obj19 = id ( tmp2 [ 33 ] ) ;
}
}
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . INVITE === type ) {
obj = { inviteKey : null , channelId : null , messageId : null , location : null , inviteAnalyticsMetadata : null , overrideProperties : null } ;
obj [ 0 ] = code ;
2026-08-03 11:20:01 +00:00
obj [ 1 ] = pendingReplyActionSource ;
2026-07-29 08:29:29 +00:00
obj [ 2 ] = id ;
obj [ 3 ] = attachments ;
2026-08-03 11:20:01 +00:00
obj [ 4 ] = pendingReplyActionSource ;
2026-08-24 06:08:38 +00:00
obj [ 5 ] = closure_4 ;
closure_1_53 ( obj ) ;
2026-07-29 08:29:29 +00:00
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . TEMPLATE === type ) {
2026-08-24 06:08:38 +00:00
const guildTemplate = closure_1_8 . getGuildTemplate ( code ) ;
2026-07-29 08:29:29 +00:00
if ( null != guildTemplate ) {
2026-08-24 06:08:38 +00:00
if ( guildTemplate . state !== closure_1_45 . RESOLVING ) {
obj1 = { guild_template_code : null , guild_template_name : null , guild_template_description : null , guild_template_guild_id : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = code ;
( { name : obj10 [ 1 ] , description : obj10 [ 2 ] , sourceGuildId : obj10 [ 3 ] } = guildTemplate ) ;
2026-08-24 06:08:38 +00:00
id ( tmp2 [ 33 ] ) . trackWithMetadata ( closure_1_27 . GUILD_TEMPLATE_LINK_SENT , obj1 ) ;
2026-07-29 08:29:29 +00:00
const obj9 = id ( tmp2 [ 33 ] ) ;
}
}
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . BUILD_OVERRIDE !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . EXPERIMENT !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . MANUAL_BUILD_OVERRIDE !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . EVENT !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . CHANNEL_LINK !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . EMBEDDED_ACTIVITY_INVITE === type ) {
2026-08-24 06:08:38 +00:00
const result6 = tmp ( tmp2 [ 32 ] ) . trackAppEmbedLinkSent ( code , closure_1_44 . ACTIVITY_INVITE , closure_5 ) ;
2026-07-29 08:29:29 +00:00
const tmpResult6 = tmp ( tmp2 [ 32 ] ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . GUILD_PRODUCT !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . SERVER_SHOP !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . SOCIAL_LAYER_STOREFRONT !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . SOCIAL_LAYER_STOREFRONT_APP !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . QUESTS_EMBED === type ) {
const adMetadataSealed = tmp ( tmp2 [ 34 ] ) . getAdMetadataSealed ( tmp ( tmp2 [ 35 ] ) . QuestContent . QUESTS_EMBED ) ;
const tmpResult7 = tmp ( tmp2 [ 34 ] ) ;
const obj2 = { questId : null , event : null , properties : null , trackGuildAndChannelMetadata : true , sourceQuestContent : null } ;
obj2 [ 0 ] = code ;
2026-08-24 06:08:38 +00:00
obj2 [ 1 ] = closure_1_27 . QUEST_LINK_SHARED ;
2026-07-29 08:29:29 +00:00
let tmp8 = null ;
if ( null != adMetadataSealed ) {
tmp8 = adMetadataSealed ;
}
const obj3 = { metadata_sealed : null } ;
obj3 [ 0 ] = tmp8 ;
obj2 [ 2 ] = obj3 ;
obj2 [ 4 ] = tmp ( tmp2 [ 35 ] ) . QuestContent . QUESTS_EMBED ;
tmp ( tmp2 [ 36 ] ) . trackQuestEvent ( obj2 ) ;
const tmpResult8 = tmp ( tmp2 [ 36 ] ) ;
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . GAME_PROFILE === type ) {
obj1 = id ( tmp2 [ 37 ] ) ;
2026-08-24 06:08:38 +00:00
obj4 = { game_id : null } ;
2026-07-29 08:29:29 +00:00
obj4 [ 0 ] = code ;
2026-08-24 06:08:38 +00:00
obj1 . track ( closure_1_27 . GAME_PROFILE_LINK_EMBED_SENT , obj4 ) ;
2026-07-29 08:29:29 +00:00
} else if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . COLLECTIBLES_SHOP !== type ) {
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . GAME_SERVER_SHARE !== type ) {
2026-08-14 17:33:39 +00:00
if ( tmp ( tmp2 [ 30 ] ) . CodedLinkType . USER_PROFILE !== type ) {
const _Error = Error ;
const _HermesInternal = HermesInternal ;
throw Error ( "Unknown coded link type: " + type ) ;
}
2026-07-29 08:29:29 +00:00
}
}
}
}
}
}
}
}
}
}
}
} ) ;
let str6 = str4 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
2026-07-29 08:29:29 +00:00
if ( str4 == null ) {
str6 = "chat_input" ;
2026-07-20 16:05:17 +00:00
}
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = c2 ;
2026-07-29 08:29:29 +00:00
id = ok . body . id ;
attachments = str6 ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = c2 . isGiftLinkSentOnBehalfOfUser ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const arr2 = closure_3_1 ( closure_3_3 [ 28 ] ) ( content ) ;
const obj37 = closure_3_0 ( closure_3_3 [ 41 ] ) ;
pendingReplyActionSource = closure_3_0 ( closure_3_3 [ 41 ] ) . findGiftCodes ( closure_0 ) . forEach ( ( arg0 ) = > {
const channel = closure_1_17 . getChannel ( pendingReplyActionSource ) ;
2026-07-29 08:29:29 +00:00
if ( null != channel ) {
const obj = { location : null , gift_code : null , guild_id : null , channel_id : null , channel_type : null , message_id : null , automatic_send : null } ;
obj [ 0 ] = attachments ;
obj [ 1 ] = arg0 ;
obj [ 2 ] = channel . getGuildId ( ) ;
( { id : obj3 [ 3 ] , type : obj3 [ 4 ] } = channel ) ;
obj [ 5 ] = id ;
2026-08-03 11:20:01 +00:00
obj [ 6 ] = pendingReplyActionSource ;
2026-08-24 06:08:38 +00:00
id ( pendingReplyActionSource [ 33 ] ) . trackWithMetadata ( closure_1_27 . GIFT_CODE_SENT , obj ) ;
2026-08-03 11:20:01 +00:00
const obj2 = id ( pendingReplyActionSource [ 33 ] ) ;
2026-07-29 08:29:29 +00:00
}
} ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = c2 ;
2026-07-29 08:29:29 +00:00
if ( null != c2 . gifMetadata ) {
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = c2 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
2026-07-29 08:29:29 +00:00
if ( str4 == null ) {
str4 = "chat_input" ;
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_17 ;
let channel = closure_3_17 . getChannel ( pendingReplyActionSource ) ;
2026-07-29 08:29:29 +00:00
if ( null != channel ) {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
pendingReplyActionSource = closure_3_27 ;
2026-07-29 08:29:29 +00:00
const obj10 = { location : null , message_id : null , gif_provider : null , load_id : null , source_object : null , gif_url : null , gif_id : null } ;
obj10 [ 0 ] = str4 ;
obj10 [ 1 ] = ok . body . id ;
( { gif_provider : obj44 [ 2 ] , load_id : obj44 [ 3 ] , source_object : obj44 [ 4 ] , gif_url : obj44 [ 5 ] , gif_id : obj44 [ 6 ] } = c2 . gifMetadata ) ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const obj43 = closure_3_1 ( closure_3_3 [ 37 ] ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = obj10 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = Object . assign ( closure_3_0 ( closure_3_3 [ 33 ] ) . collectGuildAnalyticsMetadata ( channel . getGuildId ( ) ) ) ;
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const obj45 = closure_3_0 ( closure_3_3 [ 33 ] ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = obj10 ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = Object . assign ( closure_3_0 ( closure_3_3 [ 33 ] ) . collectChannelAnalyticsMetadata ( channel ) ) ;
pendingReplyActionSource = obj43 . track ( closure_3_27 . MESSAGE_SENT_WITH_GIF , obj10 ) ;
const obj46 = closure_3_0 ( closure_3_3 [ 33 ] ) ;
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
2026-07-29 08:29:29 +00:00
attachments = ok . body . attachments ;
if ( attachments == null ) {
attachments = [ ] ;
}
2026-08-24 06:08:38 +00:00
let items = closure_1_8 ;
if ( closure_1_8 == null ) {
2026-07-29 08:29:29 +00:00
items = [ ] ;
}
id = ok . body . id ;
if ( attachments . length === items . length ) {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_17 ;
pendingReplyActionSource = closure_3_17 . getChannel ( pendingReplyActionSource ) ;
2026-08-03 11:20:01 +00:00
if ( null != pendingReplyActionSource ) {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_12 ;
messageByReference = closure_3_12 . getMessageByReference ( pendingReplyActionSource ) ;
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = items . forEach ( ( clip ) = > {
2026-07-29 08:29:29 +00:00
clip = clip . clip ;
if ( null != clip ) {
2026-08-24 06:08:38 +00:00
let someResult = closure_4 . state === closure_1_13 . LOADED ;
2026-07-29 08:29:29 +00:00
if ( someResult ) {
2026-08-24 06:08:38 +00:00
attachments = closure_4 . message . attachments ;
2026-07-29 08:29:29 +00:00
someResult = attachments . some ( ( ) = > { . . . } ) ;
}
2026-08-03 11:20:01 +00:00
let obj = id ( pendingReplyActionSource [ 37 ] ) ;
2026-07-29 08:29:29 +00:00
obj = { } ;
2026-08-03 11:20:01 +00:00
const merged = Object . assign ( attachments ( pendingReplyActionSource [ 42 ] ) . getClipBaseProperties ( clip ) ) ;
const obj3 = attachments ( pendingReplyActionSource [ 42 ] ) ;
const merged1 = Object . assign ( attachments ( pendingReplyActionSource [ 42 ] ) . getClipContextProperties ( "trackClipsShared" ) ) ;
2026-07-29 08:29:29 +00:00
obj . channel_id = clip ;
2026-08-03 11:20:01 +00:00
obj . guild_id = pendingReplyActionSource . getGuildId ( ) ;
obj . channel_type = pendingReplyActionSource . type ;
2026-07-29 08:29:29 +00:00
( { applicationId : obj2.application_id , id : obj2.clip_uuid , remoteClipId : obj2.remote_clip_id } = clip ) ;
obj . message_id = id ;
obj . attachment_id = attachments [ arg1 ] . id ;
obj . is_distributed_clip_reply = someResult ;
2026-08-24 06:08:38 +00:00
obj . track ( closure_1_27 . CLIP_SHARED , obj ) ;
obj4 = attachments ( pendingReplyActionSource [ 42 ] ) ;
2026-07-29 08:29:29 +00:00
}
} ) ;
}
}
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_1_15 ;
if ( null != closure_1_15 ) {
pendingReplyActionSource = closure_3_1 ;
pendingReplyActionSource = closure_3_3 ;
2026-07-29 08:29:29 +00:00
let obj11 = { type : "UPLOAD_COMPLETE" , channelId : null , file : null , aborted : false } ;
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_0 ;
obj11 [ 1 ] = closure_0 ;
pendingReplyActionSource = closure_1_15 ;
obj11 [ 2 ] = closure_1_15 . _file ;
pendingReplyActionSource = closure_3_1 ( closure_3_3 [ 46 ] ) . dispatch ( obj11 ) ;
const obj39 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
pendingReplyActionSource = pendingReplyActionSource ( ok ) ;
2026-08-24 06:08:38 +00:00
const findGiftCodesResult = closure_3_0 ( closure_3_3 [ 41 ] ) . findGiftCodes ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { hasErr : null , status : null , code : null , error : null } ;
( { hasErr : obj [ 0 ] , status : obj [ 1 ] , body } = ok ) ;
2026-08-24 06:08:38 +00:00
code = undefined ;
2026-07-29 08:29:29 +00:00
if ( body != null ) {
code = body . code ;
}
obj [ 2 ] = code ;
obj [ 3 ] = ok . err ;
2026-08-24 06:08:38 +00:00
closure_3_49 . log ( "Failed to send message" , obj ) ;
2026-07-29 08:29:29 +00:00
if ( ok . hasErr ) {
let flag = false ;
if ( "ABORTED" === ok . err . code ) {
flag = true ;
}
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
flag = false ;
if ( ok . status >= 400 ) {
2026-07-20 16:05:17 +00:00
flag = false ;
2026-07-29 08:29:29 +00:00
if ( ok . status < 500 ) {
2026-07-20 16:05:17 +00:00
flag = false ;
2026-07-29 08:29:29 +00:00
if ( ok . body ) {
2026-08-24 06:08:38 +00:00
if ( ok . body . code === closure_3_26 . SLOWMODE_RATE_LIMITED ) {
2026-07-29 08:29:29 +00:00
const retry_after = ok . body . retry_after ;
let tmp21 = null != retry_after ;
if ( tmp21 ) {
tmp21 = retry_after > 0 ;
}
flag = false ;
if ( tmp21 ) {
2026-08-24 06:08:38 +00:00
obj5 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
const obj12 = { type : "SLOWMODE_SET_COOLDOWN" , channelId : null , slowmodeType : null , cooldownMs : null } ;
2026-08-24 06:08:38 +00:00
obj12 [ 1 ] = closure_0 ;
obj12 [ 2 ] = closure_3_24 . SendMessage ;
obj12 [ 3 ] = retry_after * closure_3_1 ( closure_3_3 [ 77 ] ) . Millis . SECOND ;
2026-07-29 08:29:29 +00:00
obj5 . dispatch ( obj12 ) ;
flag = false ;
}
} else {
2026-08-24 06:08:38 +00:00
pendingReplyActionSource = closure_3_0 ;
pendingReplyActionSource = closure_3_3 ;
const AUTOMOD_ERROR_CODES = closure_3_0 ( closure_3_3 [ 78 ] ) . AUTOMOD_ERROR_CODES ;
2026-07-29 08:29:29 +00:00
if ( AUTOMOD_ERROR_CODES . has ( ok . body . code ) ) {
2026-08-24 06:08:38 +00:00
obj2 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
let obj13 = { type : "MESSAGE_SEND_FAILED_AUTOMOD" , messageData : null , errorResponseBody : null } ;
2026-08-24 06:08:38 +00:00
obj13 [ 1 ] = closure_1_16 ;
2026-07-29 08:29:29 +00:00
obj14 = { code : null , message : null } ;
obj14 [ 0 ] = ok . body . code ;
obj14 [ 1 ] = ok . body . message ;
obj13 [ 2 ] = obj14 ;
obj2 . dispatch ( obj13 ) ;
flag = false ;
} else if ( ok . body . code === tmp6 . POGGERMODE_TEMPORARILY_DISABLED ) {
2026-08-24 06:08:38 +00:00
obj1 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
obj1 . dispatch ( { type : "POGGERMODE_TEMPORARILY_DISABLED" } ) ;
flag = false ;
} else if ( ok . body . code === tmp6 . EXPLICIT_CONTENT ) {
2026-08-24 06:08:38 +00:00
const EXPLICIT_CONTENT = closure_3_46 . EXPLICIT_CONTENT ;
2026-07-29 08:29:29 +00:00
flag = false ;
} else {
2026-08-24 06:08:38 +00:00
let tmp8 = null != closure_1_6 || closure_1_11 ;
2026-07-29 08:29:29 +00:00
if ( ! tmp8 ) {
2026-08-24 06:08:38 +00:00
tmp8 = null != closure_1_7 ;
2026-07-29 08:29:29 +00:00
}
flag = false ;
if ( ! tmp8 ) {
2026-08-24 06:08:38 +00:00
closure_3_55 . sendClydeError ( closure_0 , ok . body . code ) ;
2026-07-29 08:29:29 +00:00
flag = false ;
}
}
}
}
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
if ( flag ) {
2026-08-24 06:08:38 +00:00
if ( null != closure_3_21 . getMessage ( closure_0 , closure_1_14 ) ) {
closure_3_55 . deleteMessage ( closure_0 , closure_1_14 , true ) ;
2026-08-03 11:20:01 +00:00
}
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
if ( null != closure_1_15 ) {
obj7 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
const obj15 = { type : "UPLOAD_FAIL" , channelId : null , file : null , messageId : null , reason : null , noSendFailed : true } ;
2026-08-24 06:08:38 +00:00
obj15 [ 1 ] = closure_0 ;
obj15 [ 2 ] = closure_1_15 . _file ;
obj15 [ 3 ] = closure_1_14 ;
2026-07-29 08:29:29 +00:00
obj15 [ 4 ] = EXPLICIT_CONTENT ;
obj7 . dispatch ( obj15 ) ;
}
let hasErr = ok . hasErr ;
if ( ! hasErr ) {
2026-08-24 06:08:38 +00:00
hasErr = EXPLICIT_CONTENT !== closure_3_46 . EXPLICIT_CONTENT ;
2026-07-29 08:29:29 +00:00
}
if ( ! hasErr ) {
let body2 = ok . body ;
let attachments1 ;
if ( body2 != null ) {
attachments1 = body2 . attachments ;
}
2026-08-24 06:08:38 +00:00
let result2 = closure_3_55 . sendExplicitMediaClydeError ( closure_0 , attachments1 , closure_3_0 ( closure_3_3 [ 50 ] ) . TrackMediaRedactionContext . EXPLICIT_MEDIA_MESSAGE_SEND_BLOCKED ) ;
const tmp38 = closure_0 ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
obj9 = closure_3_1 ( closure_3_3 [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
const obj16 = { type : "MESSAGE_SEND_FAILED" , messageId : null , channelId : null , shouldNotify : null , reason : null } ;
2026-08-24 06:08:38 +00:00
obj16 [ 1 ] = closure_1_14 ;
obj16 [ 2 ] = closure_0 ;
2026-07-29 08:29:29 +00:00
obj16 [ 3 ] = ! c2 . doNotNotifyOnError ;
obj16 [ 4 ] = EXPLICIT_CONTENT ;
obj9 . dispatch ( obj16 ) ;
2026-08-24 06:08:38 +00:00
obj11 = closure_3_0 ( closure_3_3 [ 74 ] ) ;
2026-07-29 08:29:29 +00:00
let status ;
if ( ! ok . hasErr ) {
status = ok . status ;
}
obj17 = { failureCode : null , errorMessage : null } ;
obj17 [ 0 ] = status ;
2026-08-03 11:20:01 +00:00
let message ;
2026-07-29 08:29:29 +00:00
if ( ok . hasErr ) {
2026-08-03 11:20:01 +00:00
message = ok . err . message ;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
obj17 [ 1 ] = message ;
2026-07-29 08:29:29 +00:00
let result3 = obj11 . logMessageSendFailure ( obj17 ) ;
2026-08-24 06:08:38 +00:00
obj13 = closure_3_1 ( closure_3_3 [ 72 ] ) ;
let result4 = obj13 . cancelPendingSendRequests ( closure_0 ) ;
2026-07-29 08:29:29 +00:00
const item = result4 . forEach ( ( messageId ) = > {
logger . log ( "Cancelling pending message" , messageId . nonce ) ;
2026-08-03 11:20:01 +00:00
let obj = id ( pendingReplyActionSource [ 46 ] ) ;
2026-07-29 08:29:29 +00:00
obj = { type : "MESSAGE_SEND_FAILED" , messageId : messageId.nonce , channelId : messageId.channelId } ;
obj . dispatch ( obj ) ;
} ) ;
}
id ( ok ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} , rounded ) ;
} ) ;
c8 = 3 ;
2026-08-24 06:08:38 +00:00
const throwTypeErrorResultResult = throwTypeErrorResult ( closure_1_3 [ 47 ] ) ;
tmp42 = closure_0 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} else if ( 1 === tmp8 ) {
c6 = 0 ;
2026-08-24 06:08:38 +00:00
closure_19 = messageReference ;
file = closure_19 . file ;
code = closure_19 . code ;
reason = closure_19 . reason ;
responseBody = closure_19 . responseBody ;
obj1 = closure_1_0 ( closure_1_3 [ 74 ] ) ;
2026-07-29 08:29:29 +00:00
let obj9 = { fileItems : null , failureCode : null , errorMessage : null } ;
2026-08-24 06:08:38 +00:00
obj9 [ 0 ] = file . items ;
obj9 [ 1 ] = code ;
2026-07-29 08:29:29 +00:00
let msg ;
2026-08-24 06:08:38 +00:00
if ( reason != null ) {
msg = reason . msg ;
2026-07-29 08:29:29 +00:00
}
obj9 [ 2 ] = msg ;
let result1 = obj1 . logMessageSendFailure ( obj9 ) ;
2026-08-24 06:08:38 +00:00
if ( closure_2_9 != null ) {
tmp33 ( closure_1_20 , closure_1_21 , closure_1_22 , closure_1_23 ) ;
2026-07-29 08:29:29 +00:00
}
c8 = 3 ;
obj10 = { value : null , done : true } ;
obj10 [ 0 ] = undefined ;
return obj10 ;
} else if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 0 ;
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
throwTypeErrorResult = c3 ;
2026-08-24 06:08:38 +00:00
closure_17 = arg1 ;
throwTypeErrorResult = closure_17 ;
if ( null == closure_17 ) {
2026-07-29 08:29:29 +00:00
c6 = 0 ;
c8 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c3 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_17 ;
attachments = closure_17 . attachments ;
throwTypeErrorResult = closure_17 ;
uploader = closure_17 . uploader ;
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c10 ;
if ( ! c10 ) {
if ( null != attachments ) {
2026-08-24 06:08:38 +00:00
obj4 . message . attachments = attachments . map ( ( closure_0 , closure_1 ) = > callback ( _undefined [ 45 ] ) . getAttachmentPayload ( closure_0 , closure_1 ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c6 = 0 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
c6 = 0 ;
c8 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
} catch ( throwTypeErrorResult ) {
messageReference = throwTypeErrorResult ;
throwTypeErrorResult = c6 ;
if ( tmp4 === c6 ) {
throwTypeErrorResult = tmp2 ;
c8 = tmp2 ;
throw throwTypeErrorResult ;
} else {
c7 = throwTypeErrorResult ;
}
}
}
2026-07-20 16:05:17 +00:00
}
} ) ( ) ;
} ,
startEditMessage ( channelId , messageId , content , source ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "MESSAGE_START_EDIT" , channelId , messageId , content , source } ;
obj . dispatch ( obj ) ;
} ,
startEditMessageRecord ( id , flags , source ) {
2026-08-24 06:08:38 +00:00
let obj = hasFlag ;
2026-07-29 08:29:29 +00:00
if ( obj . hasFlag ( flags . flags , closure_33 . IS_COMPONENTS_V2 ) ) {
2026-07-20 16:05:17 +00:00
const components = flags . components ;
2026-07-29 08:29:29 +00:00
const found = components . filter ( ( type ) = > type . type === callback ( table [ 79 ] ) . ComponentType . TEXT_DISPLAY ) ;
2026-07-20 16:05:17 +00:00
if ( found . length > 0 ) {
const mapped = found . map ( ( content ) = > content . content ) ;
const joined = mapped . join ( "\n" ) ;
2026-07-29 08:29:29 +00:00
obj = { type : "MESSAGE_START_EDIT" , channelId : null , messageId : null , content : null , source : null } ;
obj [ 1 ] = id ;
obj [ 2 ] = flags . id ;
obj [ 3 ] = joined ;
obj [ 4 ] = source ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj ) ;
2026-07-20 16:05:17 +00:00
}
}
obj = { type : "MESSAGE_START_EDIT" , channelId : id , messageId : flags.id , content : flags.content , source } ;
2026-08-24 06:08:38 +00:00
dispatcherDefault . dispatch ( obj ) ;
2026-07-20 16:05:17 +00:00
} ,
updateEditMessage ( channelId , textValue , richValue ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "MESSAGE_UPDATE_EDIT" , channelId , textValue , richValue } ;
obj . dispatch ( obj ) ;
} ,
endEditMessage ( id , response ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "MESSAGE_END_EDIT" , channelId : id , response } ;
obj . dispatch ( obj ) ;
} ,
editMessage ( id , id2 , parsed ) {
2026-08-24 06:08:38 +00:00
closure_0 = id ;
closure_1 = id2 ;
2026-07-23 10:11:24 +00:00
( { content : importAll , components : dependencyMap } = parsed ) ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp5 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else {
try {
dependencyMap = 2 ;
if ( 0 === obj2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp2 ;
closure_0 = tmp3 ;
2026-07-29 08:29:29 +00:00
closure_0 = undefined ;
closure_1 = undefined ;
obj2 = undefined ;
2026-08-24 06:08:38 +00:00
( function tryTrackEditMessageSwipeSend ( closure_1_1 , closure_1_0 ) {
if ( "message_swipe" === editActionSource . getEditActionSource ( closure_1_0 ) ) {
channel = channel . getChannel ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
let obj = callback ( 698 ) ;
obj = { message_id : null , channel_id : null , guild_id : null , swipe_action : "edit" , is_own_message : true } ;
2026-08-24 06:08:38 +00:00
obj [ 0 ] = closure_1_1 ;
obj [ 1 ] = closure_1_0 ;
2026-07-29 08:29:29 +00:00
let guild_id ;
if ( channel != null ) {
guild_id = channel . guild_id ;
}
obj [ 2 ] = guild_id ;
obj . track ( constants2 . MESSAGE_SWIPE_ACTION_SENT , obj ) ;
}
2026-08-24 06:08:38 +00:00
} ) ( closure_1_1 , closure_1_0 ) ;
2026-08-25 06:04:03 +00:00
obj1 = closure_1_1 ( 7368 ) ;
2026-07-29 08:29:29 +00:00
obj2 = 1 ;
dependencyMap = 1 ;
obj1 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = obj1 . unarchiveThreadIfNecessary ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
closure_0 = ( function getAllowedMentionsForMessageEdit ( closure_0 , closure_1 ) {
const message = store . getMessage ( closure_0 , closure_1 ) ;
if ( null != message ) {
if ( message . type === constants4 . REPLY ) {
messageByReference = messageByReference . getMessageByReference ( message . messageReference ) ;
if ( messageByReference . state === constants . LOADED ) {
const mentions = message . mentions ;
if ( ! mentions . includes ( messageByReference . message . author . id ) ) {
const obj = { parse : null , replied_user : false } ;
const _Object = Object ;
obj [ 0 ] = Object . values ( closure_36 ) ;
return obj ;
}
}
}
}
} ) ( closure_0 , closure_1 ) ;
closure_1 = ( function getIsCrosspostedForMessageEdit ( closure_0 , closure_1 ) {
const message = store . getMessage ( closure_0 , closure_1 ) ;
let hasFlagResult = null != message ;
if ( hasFlagResult ) {
hasFlagResult = message . hasFlag ( constants3 . CROSSPOSTED ) ;
}
return hasFlagResult ;
} ) ( closure_0 , closure_1 ) ;
obj2 = { channelId : null , messageId : null , content : null , isCrossposted : null , allowed_mentions : null , components : null } ;
obj2 [ 0 ] = closure_0 ;
obj2 [ 1 ] = closure_1 ;
obj2 [ 2 ] = obj2 ;
obj2 [ 3 ] = closure_1 ;
obj2 [ 4 ] = closure_0 ;
obj2 [ 5 ] = dependencyMap ;
const obj3 = { type : null , message : null } ;
2026-08-25 06:04:03 +00:00
obj3 [ 0 ] = closure_1_0 ( 7437 ) . MessageDataType . EDIT ;
2026-07-29 08:29:29 +00:00
obj3 [ 1 ] = obj2 ;
2026-08-25 06:04:03 +00:00
closure_1_1 ( 7437 ) . enqueue ( obj3 , ( hasErr ) = > {
2026-07-29 08:29:29 +00:00
hasErr = hasErr . hasErr ;
let hasItem = ! hasErr ;
if ( ! hasErr ) {
2026-08-25 06:04:03 +00:00
const AUTOMOD_ERROR_CODES = closure_2_0 ( 7467 ) . AUTOMOD_ERROR_CODES ;
2026-07-29 08:29:29 +00:00
hasItem = AUTOMOD_ERROR_CODES . has ( hasErr . body . code ) ;
}
if ( hasItem ) {
let obj = { type : null , message : null } ;
2026-08-25 06:04:03 +00:00
obj [ 0 ] = closure_2_0 ( 7437 ) . MessageDataType . EDIT ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = obj2 ;
2026-08-24 06:08:38 +00:00
obj1 = closure_2_1 ( 709 ) ;
2026-07-29 08:29:29 +00:00
obj = { type : "MESSAGE_EDIT_FAILED_AUTOMOD" , messageData : null , errorResponseBody : null } ;
obj [ 1 ] = obj ;
obj = { code : null , message : null } ;
obj [ 0 ] = hasErr . body . code ;
obj [ 1 ] = hasErr . body . message ;
obj [ 2 ] = obj ;
obj1 . dispatch ( obj ) ;
}
2026-08-24 06:08:38 +00:00
const AccessibilityAnnouncer = closure_2_0 ( 1363 ) . AccessibilityAnnouncer ;
2026-07-29 08:29:29 +00:00
const announce = AccessibilityAnnouncer . announce ;
2026-08-24 06:08:38 +00:00
const intl = closure_2_0 ( 1236 ) . intl ;
2026-07-29 08:29:29 +00:00
const string = intl . string ;
2026-08-24 06:08:38 +00:00
const t = closure_2_0 ( 1236 ) . t ;
2026-07-29 08:29:29 +00:00
if ( hasErr . hasErr ) {
announce ( string ( t . Atp7FP ) ) ;
} else if ( hasItem ) {
announce ( string ( t . Hym4ix ) ) ;
} else {
announce ( string ( t [ "0x1HBD" ] ) ) ;
}
let tmp14 ;
if ( ! hasErr . hasErr ) {
tmp14 = hasErr ;
}
2026-08-24 06:08:38 +00:00
closure_2_55 . endEditMessage ( closure_0 , tmp14 ) ;
2026-07-29 08:29:29 +00:00
obj1 = { channelId : tmp13 , messageId : closure_1 } ;
2026-08-24 06:08:38 +00:00
closure_2_55 . focusMessage ( obj1 ) ;
2026-07-29 08:29:29 +00:00
} ) ;
dependencyMap = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} catch ( tmp13 ) {
dependencyMap = tmp ;
throw tmp13 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ,
suppressEmbeds ( id , id2 ) {
2026-08-24 06:08:38 +00:00
closure_0 = id ;
closure_1 = id2 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else {
try {
dependencyMap = 2 ;
if ( 0 === c2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp5 ;
2026-07-29 08:29:29 +00:00
let flags = tmp2 ;
flags = undefined ;
2026-08-25 06:04:03 +00:00
obj1 = closure_1_1 ( 7368 ) ;
2026-07-29 08:29:29 +00:00
c2 = 1 ;
dependencyMap = 1 ;
obj1 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = obj1 . unarchiveThreadIfNecessary ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
flags = closure_1_21 . getMessage ( flags , closure_1 ) ;
2026-07-29 08:29:29 +00:00
if ( null != flags ) {
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0 ( 530 ) . HTTP ;
2026-07-29 08:29:29 +00:00
const obj2 = { url : null , body : null , oldFormErrors : true , rejectWithError : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_28 . MESSAGE ( flags , closure_1 ) ;
2026-07-29 08:29:29 +00:00
const obj3 = { flags : null } ;
2026-08-24 06:08:38 +00:00
obj3 [ 0 ] = closure_1_0 ( 1403 ) . setFlag ( flags . flags , closure_1_33 . SUPPRESS_EMBEDS , true ) ;
2026-07-29 08:29:29 +00:00
obj2 [ 1 ] = obj3 ;
2026-08-24 06:08:38 +00:00
const obj8 = closure_1_0 ( 1403 ) ;
obj2 [ 3 ] = closure_1_0 ( 530 ) . rejectWithMigratedError ( ) ;
2026-07-29 08:29:29 +00:00
HTTP . patch ( obj2 ) ;
2026-08-24 06:08:38 +00:00
const obj9 = closure_1_0 ( 530 ) ;
2026-07-29 08:29:29 +00:00
}
dependencyMap = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} catch ( tmp9 ) {
dependencyMap = tmp ;
throw tmp9 ;
2026-07-20 16:05:17 +00:00
}
}
} ) ( ) ;
} ,
patchMessageGuildOfficial ( id , id2 , arg2 ) {
2026-08-24 06:08:38 +00:00
closure_0 = id ;
closure_1 = id2 ;
closure_2 = arg2 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
dependencyMap = 2 ;
if ( 0 === c2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp5 ;
2026-07-29 08:29:29 +00:00
let flags = tmp2 ;
flags = undefined ;
2026-08-25 06:04:03 +00:00
obj1 = closure_1_1 ( 7368 ) ;
2026-07-29 08:29:29 +00:00
c2 = 1 ;
dependencyMap = 1 ;
obj1 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = obj1 . unarchiveThreadIfNecessary ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
flags = closure_1_21 . getMessage ( flags , closure_1 ) ;
2026-07-29 08:29:29 +00:00
if ( null != flags ) {
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0 ( 530 ) . HTTP ;
2026-07-29 08:29:29 +00:00
const obj2 = { url : null , body : null , oldFormErrors : true , rejectWithError : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_28 . MESSAGE ( flags , closure_1 ) ;
2026-07-29 08:29:29 +00:00
const obj3 = { flags : null } ;
2026-08-24 06:08:38 +00:00
obj3 [ 0 ] = closure_1_0 ( 1403 ) . setFlag ( flags . flags , closure_1_33 . IS_GUILD_OFFICIAL , c2 ) ;
2026-07-29 08:29:29 +00:00
obj2 [ 1 ] = obj3 ;
2026-08-24 06:08:38 +00:00
const obj8 = closure_1_0 ( 1403 ) ;
obj2 [ 3 ] = closure_1_0 ( 530 ) . rejectWithMigratedError ( ) ;
2026-07-29 08:29:29 +00:00
HTTP . patch ( obj2 ) ;
2026-08-24 06:08:38 +00:00
const obj9 = closure_1_0 ( 530 ) ;
2026-07-29 08:29:29 +00:00
}
dependencyMap = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} catch ( tmp9 ) {
dependencyMap = tmp ;
throw tmp9 ;
}
2026-07-20 16:05:17 +00:00
}
} ) ( ) ;
} ,
2026-07-29 08:29:29 +00:00
patchMessageAttachments ( id , id2 , found ) {
2026-08-24 06:08:38 +00:00
closure_0 = id ;
closure_1 = id2 ;
closure_2 = found ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( c2 === 2 ) {
c2 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp3 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c2 = 2 ;
if ( 0 === v0 ) {
if ( arg0 === 1 ) {
c2 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c2 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_0 = tmp4 ;
obj1 = v0 ( closure_1_3 [ 80 ] ) ;
2026-07-29 08:29:29 +00:00
v0 = 1 ;
c2 = 1 ;
obj1 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = obj1 . unarchiveThreadIfNecessary ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
} else if ( arg0 === 1 ) {
c2 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c2 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0 ( closure_1_3 [ 51 ] ) . HTTP ;
2026-07-29 08:29:29 +00:00
const obj2 = { url : null , body : null , oldFormErrors : true , rejectWithError : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_28 . MESSAGE ( closure_0 , v0 ) ;
2026-07-29 08:29:29 +00:00
const obj3 = { attachments : null } ;
obj3 [ 0 ] = c2 ;
obj2 [ 1 ] = obj3 ;
2026-08-24 06:08:38 +00:00
obj2 [ 3 ] = closure_1_0 ( closure_1_3 [ 51 ] ) . rejectWithMigratedError ( ) ;
2026-07-29 08:29:29 +00:00
HTTP . patch ( obj2 ) ;
c2 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} catch ( tmp8 ) {
c2 = tmp ;
throw tmp8 ;
}
}
2026-07-20 16:05:17 +00:00
} ) ( ) ;
} ,
deleteMessage ( arg0 , arg1 ) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
2026-07-29 08:29:29 +00:00
let flag = arg2 ;
2026-07-20 16:05:17 +00:00
if ( arg2 === undefined ) {
flag = false ;
}
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( dependencyMap === 2 ) {
dependencyMap = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp3 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
try {
dependencyMap = 2 ;
if ( 0 === c2 ) {
if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp4 ;
closure_0 = tmp4 ;
2026-07-29 08:29:29 +00:00
if ( c2 ) {
( function dispatchDelete() {
2026-08-24 06:08:38 +00:00
let obj = callback ( 709 ) ;
obj = { type : "MESSAGE_DELETE" , id : callback , channelId : closure_0 } ;
2026-07-29 08:29:29 +00:00
obj . dispatch ( obj ) . then ( ( ) = > {
2026-08-11 06:20:06 +00:00
const AccessibilityAnnouncer = callback ( 1363 ) . AccessibilityAnnouncer ;
2026-07-29 08:29:29 +00:00
const intl = callback ( 1236 ) . intl ;
AccessibilityAnnouncer . announce ( intl . string ( callback ( 1236 ) . t . RYMs7s ) ) ;
} ) ;
} ) ( ) ;
dependencyMap = 3 ;
} else {
2026-08-25 06:04:03 +00:00
obj1 = closure_1_1 ( 7368 ) ;
2026-07-29 08:29:29 +00:00
c2 = 1 ;
dependencyMap = 1 ;
obj1 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = obj1 . unarchiveThreadIfNecessary ( closure_1_0 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
}
} else if ( arg0 === 1 ) {
dependencyMap = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
2026-08-24 06:08:38 +00:00
const HTTP = closure_1_0 ( 530 ) . HTTP ;
2026-07-29 08:29:29 +00:00
const obj2 = { url : null , oldFormErrors : true , rejectWithError : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_28 . MESSAGE ( closure_0 , closure_1 ) ;
obj2 [ 2 ] = closure_1_0 ( 530 ) . rejectWithMigratedError ( ) ;
const obj7 = closure_1_0 ( 530 ) ;
2026-07-29 08:29:29 +00:00
HTTP . del ( obj2 ) . then ( ( ) = > {
2026-08-24 06:08:38 +00:00
let obj = callback ( 709 ) ;
obj = { type : "MESSAGE_DELETE" , id : callback , channelId : closure_0 } ;
2026-07-29 08:29:29 +00:00
obj . dispatch ( obj ) . then ( ( ) = > {
2026-08-11 06:20:06 +00:00
const AccessibilityAnnouncer = callback ( 1363 ) . AccessibilityAnnouncer ;
2026-07-29 08:29:29 +00:00
const intl = callback ( 1236 ) . intl ;
AccessibilityAnnouncer . announce ( intl . string ( callback ( 1236 ) . t . RYMs7s ) ) ;
} ) ;
} ) ;
const delResult = HTTP . del ( obj2 ) ;
}
dependencyMap = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} catch ( tmp10 ) {
dependencyMap = tmp ;
throw tmp10 ;
}
2026-07-20 16:05:17 +00:00
}
} ) ( ) ;
} ,
2026-07-29 08:29:29 +00:00
dismissAutomatedMessage ( loggingName ) {
if ( null != loggingName . loggingName ) {
2026-08-24 06:08:38 +00:00
let obj = collectGuildAnalyticsMetadataDefault ;
2026-07-29 08:29:29 +00:00
obj = { message_name : null , message_author : null } ;
obj [ 0 ] = loggingName . loggingName ;
obj [ 1 ] = loggingName . author . username ;
2026-07-20 16:05:17 +00:00
obj . trackWithMetadata ( constants . AUTOMATED_MESSAGE_DISMISSED , obj ) ;
}
2026-08-24 06:08:38 +00:00
const result = fetchAndReconcileGiftIntentDismissals . logGiftIntentMessageDismissed ( loggingName . channel_id , loggingName . id ) ;
2026-07-29 08:29:29 +00:00
this . deleteMessage ( loggingName . channel_id , loggingName . id , true ) ;
2026-07-20 16:05:17 +00:00
} ,
revealMessage ( id , messageId ) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault ;
2026-07-20 16:05:17 +00:00
obj = { type : "MESSAGE_REVEAL" , channelId : id , messageId } ;
obj . dispatch ( obj ) ;
} ,
2026-07-29 08:29:29 +00:00
crosspostMessage ( id , id2 ) {
2026-08-24 06:08:38 +00:00
closure_0 = id ;
closure_1 = id2 ;
2026-07-29 08:29:29 +00:00
return callback ( function * ( ) {
if ( c5 === 2 ) {
c5 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2 ;
if ( 0 === c4 ) {
if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3 ;
c0 = tmp7 ;
2026-07-29 08:29:29 +00:00
c0 = undefined ;
2026-08-24 06:08:38 +00:00
dependencyMap = 1 ;
const HTTP = closure_1_0 ( 530 ) . HTTP ;
obj1 = { url : null , oldFormErrors : true , failImmediatelyWhenRateLimited : true , rejectWithError : null } ;
obj1 [ 0 ] = closure_1_28 . MESSAGE_CROSSPOST ( closure_1_0 , closure_1_1 ) ;
obj1 [ 3 ] = closure_1_0 ( 530 ) . rejectWithMigratedError ( ) ;
2026-07-29 08:29:29 +00:00
c4 = 2 ;
c5 = 1 ;
const obj2 = { value : null , done : false } ;
obj2 [ 0 ] = HTTP . post ( obj1 ) ;
return obj2 ;
}
} else if ( 1 === tmp7 ) {
dependencyMap = 0 ;
closure_1 = closure_2 ;
if ( 429 === closure_1 . status ) {
2026-08-24 06:08:38 +00:00
const intl2 = closure_1_0 ( 1236 ) . intl ;
2026-07-29 08:29:29 +00:00
let obj3 = { retryAfter : null } ;
const _Math = Math ;
obj3 [ 0 ] = Math . floor ( closure_1 . body . retry_after / 60 ) ;
2026-08-24 06:08:38 +00:00
let formatToPlainStringResult = intl2 . formatToPlainString ( closure_1_0 ( 1236 ) . t [ "77cuqz" ] , obj3 ) ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
const intl = closure_1_0 ( 1236 ) . intl ;
formatToPlainStringResult = intl . string ( closure_1_0 ( 1236 ) . t . z2gyNF ) ;
2026-07-29 08:29:29 +00:00
}
c0 = formatToPlainStringResult ;
2026-08-25 06:04:03 +00:00
obj3 = closure_1_1 ( 4744 ) ;
2026-07-29 08:29:29 +00:00
const obj4 = { title : null , body : null , confirmText : null } ;
2026-08-24 06:08:38 +00:00
const intl3 = closure_1_0 ( 1236 ) . intl ;
obj4 [ 0 ] = intl3 . string ( closure_1_0 ( 1236 ) . t . Vd1hs6 ) ;
2026-07-29 08:29:29 +00:00
obj4 [ 1 ] = c0 ;
2026-08-24 06:08:38 +00:00
const intl4 = closure_1_0 ( 1236 ) . intl ;
obj4 [ 2 ] = intl4 . string ( closure_1_0 ( 1236 ) . t . BddRzS ) ;
2026-07-29 08:29:29 +00:00
obj3 . show ( obj4 ) ;
c5 = 3 ;
} else if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
dependencyMap = 0 ;
c5 = 3 ;
const obj5 = { value : null , done : true } ;
obj5 [ 0 ] = arg1 ;
return obj5 ;
} else {
dependencyMap = 0 ;
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp39 ) {
closure_2 = tmp39 ;
if ( tmp4 === dependencyMap ) {
c5 = tmp2 ;
throw tmp39 ;
} else {
c4 = tmp ;
}
}
}
2026-07-20 16:05:17 +00:00
} ) ( ) ;
} ,
trackInvite
} ;
2026-07-29 08:29:29 +00:00
let obj1 = {
messageName : "TOO_MANY_THREADS" ,
messageGetter ( isForumLikeChannel ) {
if ( ! isForumLikeChannel . isForumLikeChannel ( ) ) {
if ( ! isForumLikeChannel . isForumPost ( ) ) {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
let stringResult = intl . string ( getSystemLocale . t [ "5EMPA7" ] ) ;
2026-07-29 08:29:29 +00:00
}
return stringResult ;
}
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale . intl ;
stringResult = intl2 . string ( getSystemLocale . t [ "/jUd2+" ] ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj10 = {
messageName : "BOT_DM_SEND_MESSAGE_INVALID_OFFLINE_PROVISIONAL_ACCOUNT" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . Oc1Zjw ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj11 = {
messageName : "TOTAL_ATTACHMENT_SIZE_TOO_LARGE" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . formatToPlainString ( getSystemLocale . t . DYFPg2 , { maxSizeMb : items2.MAX_TOTAL_ATTACHMENT_SIZE_MB } ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj12 = {
messageName : "CLOUD_UPLOAD_NOT_FOUND" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . bQldfH ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj13 = {
messageName : "INVALID_PERMISSIONS" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . zl4Weq ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj2 = {
messageName : "TOO_MANY_ANNOUNCEMENT_THREADS" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t [ "aY+lLC" ] ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj3 = {
messageName : "HARMFUL_LINK_MESSAGE_BLOCKED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . formatToPlainString ( getSystemLocale . t . zSG3Qy , { helpUrl : constants8.HARMFUL_LINKS } ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj4 = {
messageName : "HARMFUL_URL_BLOCKED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . WxX2Fd ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj5 = {
messageName : "BOT_REQUIRES_EMAIL_VERIFICATION" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . k1Cjqr ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj6 = {
messageName : "GUILD_MESSAGE_UPDATE_RATE_LIMIT_EXCEEDED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . Z5SUuv ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj7 = {
messageName : "BOT_DM_RATE_LIMITED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . E8nbNb ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj8 = {
messageName : "BOT_DM_SEND_MESSAGE_TEMPORARILY_DISABLED" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t . aRUbah ) ;
2026-07-29 08:29:29 +00:00
}
} ;
let obj9 = {
messageName : "BOT_DM_SEND_MESSAGE_INVALID_FOR_GAME_FRIEND" ,
messageGetter() {
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale . intl ;
return intl . string ( getSystemLocale . t [ "/meGhR" ] ) ;
2026-07-29 08:29:29 +00:00
}
} ;
2026-08-24 06:08:38 +00:00
const tmp6 = new timestampDefault ( "MessageQueue" ) ;
let result = require ( "set" ) . fileFinishedImporting ( "actions/MessageActionCreators.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default obj14 ;