@eryxenx/insta-chat 2.0.1 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +112 -8
  2. package/index.js +105 -1
  3. package/module/login.js +51 -1
  4. package/package.json +9 -2
  5. package/src/api/action/getAppState.js +19 -1
  6. package/src/api/action/getCookies.js +7 -1
  7. package/src/api/action/getCurrentUserID.js +7 -1
  8. package/src/api/action/setOptions.js +8 -1
  9. package/src/api/messaging/editMessage.js +19 -1
  10. package/src/api/messaging/markAsRead.js +7 -1
  11. package/src/api/messaging/resolvePhotoUrl.js +8 -1
  12. package/src/api/messaging/sendMessage.js +45 -1
  13. package/src/api/messaging/sendMessageSync.js +8 -1
  14. package/src/api/messaging/sendTypingIndicator.js +7 -1
  15. package/src/api/messaging/setMessageReaction.js +19 -1
  16. package/src/api/messaging/shareContact.js +19 -1
  17. package/src/api/messaging/unsendMessage.js +16 -1
  18. package/src/api/realtime/getInbox.js +7 -1
  19. package/src/api/realtime/listen.js +7 -1
  20. package/src/api/realtime/stopListening.js +7 -1
  21. package/src/api/threads/getThreadHistory.js +16 -1
  22. package/src/api/threads/getThreadInfo.js +59 -1
  23. package/src/api/threads/getThreadList.js +22 -1
  24. package/src/api/users/getUID.js +12 -1
  25. package/src/api/users/getUserInfo.js +37 -1
  26. package/src/api.js +253 -1
  27. package/src/app/InstaClient.js +352 -1
  28. package/src/app/InstaContext.js +46 -1
  29. package/src/app/createFcaClient.js +59 -1
  30. package/src/app/loadApiMethods.js +30 -1
  31. package/src/constants.js +53 -1
  32. package/src/cookies.js +41 -1
  33. package/src/deviceIdentity.js +31 -1
  34. package/src/events/normalizeEvent.js +142 -1
  35. package/src/http.js +381 -1
  36. package/src/messageContent.js +73 -1
  37. package/src/methods/inbox.js +464 -1
  38. package/src/methods/media.js +224 -1
  39. package/src/methods/message.js +115 -1
  40. package/src/methods/reactions.js +52 -1
  41. package/src/methods/thread.js +96 -1
  42. package/src/methods/typing.js +35 -1
  43. package/src/methods/user.js +33 -1
  44. package/src/session.js +94 -1
  45. package/src/threadDetail.js +36 -1
  46. package/src/utils/antiSuspension.js +284 -0
  47. package/src/utils/dataDir.js +11 -0
  48. package/src/utils/errors.js +106 -0
  49. package/src/utils/format.js +38 -1
  50. package/src/utils/messageStyle.js +57 -1
  51. package/src/utils/sessionGuard.js +93 -0
package/CHANGELOG.md CHANGED
@@ -4,20 +4,124 @@ All notable changes to `@eryxenx/insta-chat` are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/) and uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
- ## [2.0.0] - 2026-10-09
7
+ ## [2.0.4] - 2026-10-10
8
+
9
+ ### Fixed
10
+
11
+ - **Captioned media lagged behind its text.** A message carrying both text and
12
+ an attachment uploads the media first, then commits the caption and the media
13
+ back-to-back, so the text and the image land together instead of the image
14
+ trailing by the whole upload time. Instagram's DM media mutation has no caption
15
+ field, so caption + attachment is still two messages; this only removes the
16
+ perceived gap after the caption.
8
17
 
9
18
  ### Added
10
19
 
11
- - `getPictureUrl(idOrUsername)` alias for `getProfilePictureUrl`, so the frozen
12
- GoatBot-Pro `pp.js` (which probes `typeof api.getPictureUrl === "function"`)
13
- resolves avatars through the direct lookup instead of falling back silently.
20
+ - `antiSuspension.waitForTurn(threadID, { immediate })`: an immediate turn that
21
+ still counts against the volume caps but skips the inter-message gap, so a
22
+ captioned attachment can follow its caption at once.
23
+
24
+ ## [1.0.12] - 2026-10-10
25
+
26
+ ### Fixed
27
+
28
+ - **Bot logged out on a network blip.** `init()` treated every failed probe
29
+ (timeout, 5xx, 429) as an expired cookie. It now distinguishes a dead session
30
+ (`IG_SESSION_INVALID`), a security check (`IG_CHALLENGE`), a suspended account
31
+ (`IG_SUSPENDED`) and a temporary failure (`IG_TRANSIENT`, with `retryAfterMs`),
32
+ and retries transient failures before giving up.
33
+ - **Poller stopped on a single redirect.** `listen()` shut down on the first
34
+ 3xx. It now requires two consecutive auth failures plus a fresh session check
35
+ before reporting the session dead, stops at once only on a challenge or a
36
+ suspension, and keeps polling through transient errors with backoff.
37
+ - **Rotated cookies were never reused.** The saved `appstate.json` is now
38
+ merged back in on the next start when it belongs to the same `sessionid`, and
39
+ snapshots are written atomically so a crash cannot leave a truncated file.
40
+ - **Poll cadence looked scripted.** Poll interval floor raised to 15s (default
41
+ 20s) with +/-20% jitter, and polling slows down while a cooldown is active.
42
+ - **Cooldown did nothing.** The old cooldown added 2-5s per send and the
43
+ hourly/daily caps only added a short delay. Sends are now serialized with a
44
+ global gap, a per-thread gap and jitter; caps and cooldown enforce a real
45
+ gap, strikes decay, and repeated cooldowns escalate (1h up to 6h).
46
+ - Suspicion signals are now detected on every request (challenge, checkpoint,
47
+ `feedback_required`, suspended), not only on sends, and one failing request
48
+ counts as one strike instead of two.
49
+ - The legacy broadcast fallback is no longer attempted while rate-limited,
50
+ challenged or cooling down.
51
+ - Responses carrying `x-ig-set-www-claim` are tracked and echoed back like the
52
+ web client does, instead of always sending `0`.
53
+ - Redirects are no longer followed on API calls, so a dead session fails on the
54
+ first response instead of after five wasted requests.
55
+
56
+ ### Added
57
+
58
+ - `INSTA_DATA_DIR` environment variable: directory for `device.json`,
59
+ `session-params.json` and `appstate.json` (point it at a persistent volume on
60
+ Render/Railway so the identity survives restarts).
61
+ - `appStateFile` option on `InstaAPI`.
62
+
63
+ ## [1.0.11] - 2026-10-10
14
64
 
15
65
  ### Fixed
16
66
 
17
- - `InstaClient` test double now stubs `addUserToGroup` / `removeUserFromGroup`
18
- and the inbox, so the FCA client surface test exercises the real delegation
19
- (FCA `(userID, threadID)` → native `(threadID, userID)`) and offline mention
20
- resolution instead of throwing / short-circuiting.
67
+ - **Attachment caption order.** A message carrying both text and an attachment
68
+ (e.g. `sendMessage({ body, attachment })`) sent the media first and the text
69
+ second, so the image rendered above its caption. The text is now sent before
70
+ the media upload, so the recipient sees the caption on top and the
71
+ photo/attachment underneath — matching how ported GoatBot-Pro commands format
72
+ a header line followed by an image.
73
+
74
+ ## [1.0.10] - 2026-10-10
75
+
76
+ ### Fixed
77
+
78
+ - **Silent message drop.** Instagram answers a rejected Relay mutation with HTTP
79
+ 200 plus a top-level `errors` array. `postGraphQL` returned that payload as if
80
+ it were a success, so `sendMessage` reported a `messageID` for a message
81
+ Instagram never stored. Write operations (text send, media commit, caption,
82
+ reaction, edit) now pass `{ throwOnError: true }`, which throws an
83
+ `InstagramGraphQLError` carrying the relay `errors`. Read/query paths keep the
84
+ old lenient behaviour so `getThreadHistory` still maps a rejected query to `[]`.
85
+ - `sessionGuard` now snapshots the cookie jar once at install time instead of
86
+ waiting for the first 5-minute interval, so a crash right after login no longer
87
+ leaves no good `appstate.json` on disk.
88
+ - `_resolveMentionsOffline` falls back to a live `getUserInfoByUsername` (and
89
+ indexes the result) when a handle was never seen in the inbox, instead of
90
+ dropping the mention.
91
+ - `addUserToGroup` / `removeUserFromGroup` degrade to a `false` stub when the
92
+ native client does not expose the pair, matching the other group-management
93
+ stubs.
94
+ - Reaction send/remove now note a failed mutation to the anti-suspension pacer,
95
+ and reaction removal is paced like every other outbound send. Previously a
96
+ checkpoint surfaced by a reaction was never counted as a strike, and removals
97
+ bypassed the pacer entirely.
98
+ - Adds `test/safetyWiring.test.js`, which asserts the pacer is actually invoked
99
+ (paced before the network call, noted on failure) by the text and reaction
100
+ send paths, rather than merely being exported.
101
+
102
+ ## [1.0.9] - 2026-10-09
103
+
104
+ ### Added
105
+
106
+ - **Anti-suspension send pacer** (`src/utils/antiSuspension.js`), ported from
107
+ `@eryxenx/fca`. Every outbound DM (text, media, reactions) is paced with a
108
+ per-thread gap plus jitter, capped per hour/day, and throttled for 45 min when
109
+ a response or error mentions a checkpoint/spam/rate-limit signal. A freshly
110
+ logged-in session starts under a stricter warmup ceiling (40/hr → 350/hr).
111
+ This is the main reason an account survives weeks instead of days.
112
+ - **Session guard** (`src/utils/sessionGuard.js`), ported from `@eryxenx/fca`.
113
+ Snapshots the live cookie jar to `appstate.json` every 5 min, keeps the
114
+ previous copy as `.bak`, and refuses to overwrite a good file with a shorter
115
+ one (truncation guard). Installed automatically on every `InstaClient`;
116
+ disable with `login(cookie, { sessionGuard: false })`.
117
+
118
+ ### Changed
119
+
120
+ - `listen()` no longer piles polls on top of an HTTP 429. It tears down the
121
+ current poll, re-arms with exponential backoff (30s → 10min), and resets on a
122
+ clean poll. A dead session (redirect to the login page) now stops the listener
123
+ instead of spinning forever. The poll interval is floored at 10s.
124
+ - Exported `antiSuspension` and `sessionGuard` from the package root.
21
125
 
22
126
  ## [1.1.0] - 2026-10-08
23
127
 
package/index.js CHANGED
@@ -4,4 +4,108 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- 'use strict';const _0x2f35af=_0x48d7,_0x390a9c=_0x48d7;(function(_0x4c896f,_0x1d01bd){const _0x5bbe93=_0x48d7,_0x1db9a2=_0x48d7,_0x32317d=_0x4c896f();while(!![]){try{const _0x4bc625=-parseInt(_0x5bbe93(0xad,'eCll'))/0x1+-parseInt(_0x5bbe93(0xac,'JcEp'))/0x2*(parseInt(_0x1db9a2(0x9f,'eCll'))/0x3)+parseInt(_0x5bbe93(0xb9,'w*fC'))/0x4*(-parseInt(_0x5bbe93(0x9a,'NKXL'))/0x5)+-parseInt(_0x5bbe93(0xd2,'bi7o'))/0x6*(parseInt(_0x5bbe93(0x9d,'U[35'))/0x7)+-parseInt(_0x1db9a2(0xe3,'Sgd$'))/0x8+parseInt(_0x5bbe93(0xcd,'CB9t'))/0x9*(-parseInt(_0x5bbe93(0xf6,'vSeK'))/0xa)+parseInt(_0x5bbe93(0x88,'Tdlq'))/0xb*(parseInt(_0x1db9a2(0xd9,'QwL4'))/0xc);if(_0x4bc625===_0x1d01bd)break;else _0x32317d['push'](_0x32317d['shift']());}catch(_0xbf4edb){_0x32317d['push'](_0x32317d['shift']());}}}(_0x1e5b,0xeaf8a));function _0x48d7(_0x3254eb,_0x43396d){_0x3254eb=_0x3254eb-0x85;const _0x1e5b8c=_0x1e5b();let _0x48d7b8=_0x1e5b8c[_0x3254eb];if(_0x48d7['RFgvQw']===undefined){var _0x726688=function(_0x3a3c49){const _0x1c3236='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xf78283='',_0xfa1a42='';for(let _0x4a1dcd=0x0,_0x4f9ec4,_0x2ab9a3,_0x565f22=0x0;_0x2ab9a3=_0x3a3c49['charAt'](_0x565f22++);~_0x2ab9a3&&(_0x4f9ec4=_0x4a1dcd%0x4?_0x4f9ec4*0x40+_0x2ab9a3:_0x2ab9a3,_0x4a1dcd++%0x4)?_0xf78283+=String['fromCharCode'](0xff&_0x4f9ec4>>(-0x2*_0x4a1dcd&0x6)):0x0){_0x2ab9a3=_0x1c3236['indexOf'](_0x2ab9a3);}for(let _0x444945=0x0,_0x2f01f2=_0xf78283['length'];_0x444945<_0x2f01f2;_0x444945++){_0xfa1a42+='%'+('00'+_0xf78283['charCodeAt'](_0x444945)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xfa1a42);};const _0x56f985=function(_0x39522f,_0xb51c7f){let _0x428458=[],_0xde41bf=0x0,_0x53e11a,_0x1f9c3e='';_0x39522f=_0x726688(_0x39522f);let _0x96dfcd;for(_0x96dfcd=0x0;_0x96dfcd<0x100;_0x96dfcd++){_0x428458[_0x96dfcd]=_0x96dfcd;}for(_0x96dfcd=0x0;_0x96dfcd<0x100;_0x96dfcd++){_0xde41bf=(_0xde41bf+_0x428458[_0x96dfcd]+_0xb51c7f['charCodeAt'](_0x96dfcd%_0xb51c7f['length']))%0x100,_0x53e11a=_0x428458[_0x96dfcd],_0x428458[_0x96dfcd]=_0x428458[_0xde41bf],_0x428458[_0xde41bf]=_0x53e11a;}_0x96dfcd=0x0,_0xde41bf=0x0;for(let _0x3ccbfa=0x0;_0x3ccbfa<_0x39522f['length'];_0x3ccbfa++){_0x96dfcd=(_0x96dfcd+0x1)%0x100,_0xde41bf=(_0xde41bf+_0x428458[_0x96dfcd])%0x100,_0x53e11a=_0x428458[_0x96dfcd],_0x428458[_0x96dfcd]=_0x428458[_0xde41bf],_0x428458[_0xde41bf]=_0x53e11a,_0x1f9c3e+=String['fromCharCode'](_0x39522f['charCodeAt'](_0x3ccbfa)^_0x428458[(_0x428458[_0x96dfcd]+_0x428458[_0xde41bf])%0x100]);}return _0x1f9c3e;};_0x48d7['ImCVwe']=_0x56f985,_0x48d7['sHjsrD']={},_0x48d7['RFgvQw']=!![];}const _0x2f74c9=_0x1e5b8c[0x0],_0x49416c=_0x3254eb+_0x2f74c9,_0x5673c6=_0x48d7['sHjsrD'][_0x49416c];return!_0x5673c6?(_0x48d7['ZbtDNN']===undefined&&(_0x48d7['ZbtDNN']=!![]),_0x48d7b8=_0x48d7['ImCVwe'](_0x48d7b8,_0x43396d),_0x48d7['sHjsrD'][_0x49416c]=_0x48d7b8):_0x48d7b8=_0x5673c6,_0x48d7b8;}const InstaAPI=require(_0x2f35af(0xed,'rO!&')+_0x390a9c(0x87,'45PL')),constants=require(_0x2f35af(0xbd,'ZRXZ')+_0x2f35af(0xde,'!dBC')+_0x390a9c(0xfa,'v3TG')),{normalizeCookie}=require(_0x390a9c(0x91,'2hY*')+'cookie'+'s'),{harvestSessionParams,findChromium}=require(_0x2f35af(0xa7,'v3TG')+_0x2f35af(0xf2,'(V)i')+'n'),InstaClient=require(_0x390a9c(0x8a,'EMDb')+'app/In'+_0x390a9c(0xec,'gg&g')+_0x2f35af(0xb2,'@5S%')),{InstaContext}=require(_0x2f35af(0x92,'Ghur')+_0x390a9c(0xc0,'EKND')+_0x2f35af(0x9c,'EMDb')+_0x390a9c(0xc2,'CB9t')),{createFcaClient}=require(_0x390a9c(0xe6,'RV]R')+_0x2f35af(0xc6,'eCll')+_0x2f35af(0xe9,'QwL4')+_0x390a9c(0x90,'EKND')+'t'),EventNormalizer=require(_0x2f35af(0x92,'Ghur')+_0x2f35af(0xf4,'9%TC')+_0x390a9c(0xd0,'NKXL')+_0x2f35af(0xdb,'Sgd$')+_0x2f35af(0xf8,'rO!&')),loadApiMethods=require(_0x390a9c(0xd3,'QwL4')+_0x390a9c(0xe7,'EKND')+_0x390a9c(0xab,'cHoe')+_0x2f35af(0x93,'#Kpn')),moduleLogin=require(_0x390a9c(0xe5,'cHoe')+_0x390a9c(0xf9,'Tdlq')+'in');function login(_0x50ae3d,_0x2d6697,_0x436146){const _0x200feb=_0x2f35af,_0x3c80b8=_0x2f35af,_0x3b84d8={'UNQgL':function(_0x576ea1,_0x557688){return _0x576ea1===_0x557688;},'ZHdEu':_0x200feb(0xe8,'cHoe')+'on','BgvQr':_0x3c80b8(0xbb,'U[35'),'CbDoC':function(_0x182375,_0x3f1ea2){return _0x182375||_0x3f1ea2;}};_0x3b84d8[_0x200feb(0xb7,'cHoe')](typeof _0x2d6697,_0x3b84d8[_0x200feb(0xd8,'Sgd$')])&&(_0x3b84d8[_0x200feb(0xee,'w*fC')]!==_0x3b84d8[_0x3c80b8(0xa5,'#Kpn')]?(_0x4a1dcd=_0x4f9ec4,_0x2ab9a3={}):(_0x436146=_0x2d6697,_0x2d6697={}));_0x2d6697=_0x3b84d8[_0x200feb(0xfc,'m3qr')](_0x2d6697,{});const _0x304de3=((async()=>{const _0x48ab2f=_0x3c80b8,_0x17abfc=_0x200feb,_0x1e717d=new InstaAPI(_0x50ae3d,_0x2d6697);return await _0x1e717d[_0x48ab2f(0xbf,'EMDb')](),_0x2d6697[_0x48ab2f(0xb0,'QLkU')]?_0x1e717d:new InstaClient(_0x1e717d,_0x2d6697);})());if(_0x3b84d8[_0x3c80b8(0x86,'v3TG')](typeof _0x436146,_0x3c80b8(0xe1,'rO!&')+'on'))return _0x304de3[_0x3c80b8(0xaf,'w*fC')](_0x5faf5e=>_0x436146(null,_0x5faf5e),_0x46e133=>_0x436146(_0x46e133,null)),undefined;return _0x304de3;}function createClient(_0x40b313,_0x41b35a){const _0x21e51f={'ZNpUy':function(_0x2003da,_0x4be8ae,_0x1ae0f5){return _0x2003da(_0x4be8ae,_0x1ae0f5);}};return _0x21e51f['ZNpUy'](login,_0x40b313,_0x41b35a);}function wrap(_0x3b451d,_0x9942ad){return new InstaClient(_0x3b451d,_0x9942ad);}function createContext(_0x5a58c0,_0x3a1c0a){const _0x824240=_0x390a9c,_0x44bacb=_0x390a9c,_0x1a2891={'FDVMk':function(_0x2e4a11,_0x1154ce){return _0x2e4a11 instanceof _0x1154ce;},'ZUWvE':function(_0x5cb9f3,_0x474c0c){return _0x5cb9f3(_0x474c0c);}},_0x461cc5=_0x1a2891[_0x824240(0xc7,'Sgd$')](_0x5a58c0,InstaClient)?_0x5a58c0:_0x1a2891[_0x44bacb(0xbc,'IC*z')](wrap,_0x5a58c0);return new InstaContext(_0x461cc5,_0x3a1c0a);}function _0x1e5b(){const _0x367953=['x8oHASkbrq','tmo6AJxdTmoJ','WRFcLKRcUSk3pmoi','WP/cPunb','k8kZWPVdN8oOFq','uCoHFrxcOWa','WOPkW4ldKa','WRRdLt3dSCoGwSk3WPRcTCkzx8kWWOO','xComFxBdMSoU','nCoNW7/cOSoRW4W','kfZdRXNcJSkO','DwJcS2hcIq','lftdR1NcN8kU','W5m/WPH+W44','W7yeW40pjrm','kaldIhi','WQhdOdideHC6W5ZcOCo9gmox','W4SEWOJcLCoGF8oqEmkLnmozWQ3dIG','W59TW71QwSkp','W6elf0lcJYK','W63dGtpdVsSE','bcK7WQTKia','a8kKlcZcVcnAxCkO','WQjhWRNcR8kbjG','WOhdGdldUYmh','W5jinmksWQTe','W4ZcI2dcQ8k6dq','W7CTW6ZcPmkpza','AwtcGwNcLW','WR1AWOZcICkYqmo9yW','WRtcIq7dPfxcQa','x0xcN0NcP8oD','kmkeWQ/cS1m','pw8MumkZWP4','WP7cIbpdO0dcIG','WPJcJvDimGm','WOhdS8k/WO00zmogzW','xSoby3RdNmoZ','W6FdTSkMbMX6','aH3dLX/dLmktWPKHWP/dR23cO8kYlW','W4RcH8ohWRJcPHy','Cv/dHg0mW68','WPhdSamxWPaa','k8kZWPVdN8onFa','oqxdH2eCW7m','W6KjWR7cUmkKAG','W7yCcKtcIda','WOFcImkmWQbsgW','f8kFWQNcMvf3','fSkBFMVdI8k1','dYa+WO53','W7OjW6j3W69x','raqQFSoKWPS','W7KFW40ajq','cCoidNbfW7G','W4nJiCkoWQPz','W5xcT8kCWRCqxG','W6RcNh/cR8kHha','W5hdGmkLWQnqpSkwkW','b33cL8o4W53dTa','xCoAEq','sYldGSo2W7OL','qCo1W4y','WPlcLrddSvJcGG','W4rCgguI','umovF2/dJCoP','W47dOCkXaha','ESopW6tcPMG','agtcKa','h37dNSkJWQz1awdcNCktWOVdQ389','yCkNWQ7dTSkQWP0SzLlcOMHK','W5JdPfLhbJW','WPmJz8orWPPfbYRdOCk4','tSoLz8kCCSo7W75aBbRdHfW','W5RcPWakWOfB','WR1FW77cHCkjt8o+rmkn','ySoHWQq+kSkQ','k8kaWOFcMCoeFq','WOG0iSktWRSc','ySk0oG9naW','WRT+esG3W64','FNCrWRn1mfvG','W5/cR8knWRWCwq','gCoFggjyW7i','W6RcQXKjWOa','bSkWFYBdOSkG','i8o1prHwwa','W7FcL2RcVWqxiCkdWQ3dRW','AmoJWR4VjCkD','WOxcV0T2cN0','WQddOZychb0jW6tcVSo0d8oU','W5NcJmkCWQ0mqG','FH7cQWpdMmoUWQ08rHFdOSkG','W4VdOmkLhx9p','W5X+iW','W4rsnw8puq','WQFdLYZdOdql','WPTxW4RdI8kHoq','WPXTdXyH','b8k7Bq','aCkUW4BcS0FcPG','cmkeWQ/cS1m','WPJcNW3dV0BcNW','W6VcImogWRRcOIy','pHtdQhibW5C','ah0GWRGwWPX+','EHJcRaBdLmoIWO4BvbxdTCkn','W4SfWPHJW4NcTG','os8TWRe','W7SgW4z/W6Tt','W4FdUHGguYTBrvuDWRmUWQVcKW','gCk8ja','smk7W6ldLCkKaq','tmoZW5dcOfddRa','W47dSHKmvIrDqeCoWO0OWRtcTG','iM8VtmkQWPy','cJ7dUguK','W7/cU2vgr0O','Ehn8W6TtjKrxuw8','CCoAFM3dICoz','W5dcShnqqG'];_0x1e5b=function(){return _0x367953;};return _0x1e5b();}login[_0x390a9c(0xa0,'pw1L')+'PI']=InstaAPI,login[_0x390a9c(0x9b,'1]XO')+_0x390a9c(0xc9,'goqg')]=InstaClient,login[_0x2f35af(0xba,'rO!&')+_0x2f35af(0x95,'9%TC')]=InstaContext,login[_0x2f35af(0xd7,'OV4^')+_0x390a9c(0xa2,'m3qr')]=createClient,login[_0x2f35af(0xca,'V11B')+'FcaCli'+'ent']=createFcaClient,login['wrap']=wrap,login[_0x2f35af(0xb4,'v3TG')+_0x2f35af(0xd4,'NKXL')+'t']=createContext,login[_0x390a9c(0xd6,'K$v5')+_0x390a9c(0x97,'RV]R')]={'parse':normalizeCookie},login[_0x390a9c(0xe4,'a8A7')+_0x2f35af(0xae,'goqg')+_0x2f35af(0xef,'QLkU')+'ms']=harvestSessionParams,login[_0x390a9c(0xf7,'45PL')+_0x2f35af(0xcf,'A2*L')]=findChromium,login[_0x390a9c(0xb8,'U[35')+_0x2f35af(0x85,'pw1L')]=moduleLogin,module[_0x2f35af(0xc8,'eCll')+'s']=login,module[_0x2f35af(0xe2,'pw1L')+'s'][_0x390a9c(0xa8,'gg&g')]=login,module[_0x390a9c(0xc8,'eCll')+'s'][_0x2f35af(0x98,'ZRXZ')+'t']=login,module['export'+'s'][_0x2f35af(0xc1,'bi7o')+_0x390a9c(0x8f,'1]XO')]=createClient,module['export'+'s'][_0x2f35af(0xd1,'w*fC')+'PI']=InstaAPI,module['export'+'s'][_0x390a9c(0xda,'!dBC')+_0x2f35af(0xf1,'V11B')]=InstaClient,module['export'+'s'][_0x390a9c(0xaa,'a8A7')+_0x2f35af(0x99,'Ghur')]=InstaContext,module[_0x390a9c(0xf3,'2hY*')+'s'][_0x390a9c(0xc5,'ygZU')+_0x2f35af(0xf0,'[S4t')+_0x390a9c(0xa6,'ZRXZ')]=createFcaClient,module[_0x390a9c(0x8d,'RV]R')+'s']['EventN'+_0x2f35af(0xfb,'!dBC')+_0x2f35af(0xa1,'2hY*')]=EventNormalizer,module[_0x390a9c(0xeb,'vSeK')+'s']['loadAp'+_0x2f35af(0x9e,'9%TC')+'ds']=loadApiMethods,module[_0x2f35af(0xeb,'vSeK')+'s'][_0x390a9c(0xcb,'cHoe')]=wrap,module[_0x2f35af(0xf5,'K$v5')+'s'][_0x390a9c(0x96,'(V)i')+'Contex'+'t']=createContext,module[_0x2f35af(0xa3,'NKXL')+'s'][_0x2f35af(0xb3,'7nrG')+'Utils']={'parse':normalizeCookie},module[_0x390a9c(0xc4,'rO!&')+'s'][_0x2f35af(0xfd,'rO!&')+_0x2f35af(0xd5,'2hY*')+_0x390a9c(0xdf,'PVva')+'ms']=harvestSessionParams,module[_0x2f35af(0xea,'A2*L')+'s'][_0x390a9c(0xce,'ATeF')+_0x390a9c(0xb6,'hgh7')]=findChromium,module[_0x390a9c(0xa9,'!dBC')+'s']['consta'+'nts']=constants,module[_0x2f35af(0xa4,'CB9t')+'s'][_0x2f35af(0xdd,'hgh7')+_0x390a9c(0xdc,'gg&g')]=moduleLogin;
7
+
8
+ "use strict";
9
+
10
+ const InstaAPI = require("./src/api");
11
+ const constants = require("./src/constants");
12
+ const { normalizeCookie } = require("./src/cookies");
13
+ const { harvestSessionParams, findChromium } = require("./src/session");
14
+ const InstaClient = require("./src/app/InstaClient");
15
+ const { InstaContext } = require("./src/app/InstaContext");
16
+ const { createFcaClient } = require("./src/app/createFcaClient");
17
+ const EventNormalizer = require("./src/events/normalizeEvent");
18
+ const loadApiMethods = require("./src/app/loadApiMethods");
19
+ const moduleLogin = require("./module/login");
20
+
21
+ /**
22
+ * Log in to Instagram with a browser cookie / sessionid and return a ready
23
+ * client. Mirrors the classic FCA `login(credentials, callback)` shape so bot
24
+ * projects can swap it in the same way they swap an FCA package.
25
+ *
26
+ * By default it resolves to an {@link InstaClient} — the FCA-shaped surface
27
+ * (sendMessage, setMessageReaction, getThreadInfo, ...) — which is what
28
+ * GoatBot-Pro commands are written against. Pass `{ native: true }` to get the
29
+ * bare {@link InstaAPI} instead.
30
+ *
31
+ * @param {string|object} cookie sessionid string, "k=v; k=v" cookie string,
32
+ * a cookie object, or a browser cookie array.
33
+ * @param {object} [options] { native, sessionParams, sessionParamsFile,
34
+ * deviceFile, pollInterval }
35
+ * @param {function} [callback] (err, api) classic node-callback style.
36
+ * @returns {Promise<InstaClient|InstaAPI>}
37
+ */
38
+ function login(cookie, options, callback) {
39
+ if (typeof options === "function") {
40
+ callback = options;
41
+ options = {};
42
+ }
43
+ options = options || {};
44
+
45
+ const promise = (async () => {
46
+ const native = new InstaAPI(cookie, options);
47
+ await native.init();
48
+ return options.native ? native : new InstaClient(native, options);
49
+ })();
50
+
51
+ if (typeof callback === "function") {
52
+ promise.then((api) => callback(null, api), (err) => callback(err, null));
53
+ return undefined;
54
+ }
55
+ return promise;
56
+ }
57
+
58
+ /**
59
+ * Alias kept for parity with FCA-style packages that expose `createClient`.
60
+ */
61
+ function createClient(cookie, options) {
62
+ return login(cookie, options);
63
+ }
64
+
65
+ /**
66
+ * Wraps an already-initialised native InstaAPI in the FCA-shaped client.
67
+ */
68
+ function wrap(native, options) {
69
+ return new InstaClient(native, options);
70
+ }
71
+
72
+ /**
73
+ * Wraps an already-initialised native client in a per-thread context.
74
+ */
75
+ function createContext(nativeOrClient, threadID) {
76
+ const client = nativeOrClient instanceof InstaClient ? nativeOrClient : wrap(nativeOrClient);
77
+ return new InstaContext(client, threadID);
78
+ }
79
+
80
+ login.InstaAPI = InstaAPI;
81
+ login.InstaClient = InstaClient;
82
+ login.InstaContext = InstaContext;
83
+ login.createClient = createClient;
84
+ login.createFcaClient = createFcaClient;
85
+ login.wrap = wrap;
86
+ login.createContext = createContext;
87
+ login.CookieUtils = { parse: normalizeCookie };
88
+ login.harvestSessionParams = harvestSessionParams;
89
+ login.findChromium = findChromium;
90
+ login.moduleLogin = moduleLogin;
91
+
92
+ module.exports = login;
93
+
94
+ module.exports.login = login;
95
+ module.exports.default = login;
96
+ module.exports.createClient = createClient;
97
+ module.exports.InstaAPI = InstaAPI;
98
+ module.exports.InstaClient = InstaClient;
99
+ module.exports.InstaContext = InstaContext;
100
+ module.exports.createFcaClient = createFcaClient;
101
+ module.exports.EventNormalizer = EventNormalizer;
102
+ module.exports.loadApiMethods = loadApiMethods;
103
+ module.exports.wrap = wrap;
104
+ module.exports.createContext = createContext;
105
+ module.exports.CookieUtils = { parse: normalizeCookie };
106
+ module.exports.harvestSessionParams = harvestSessionParams;
107
+ module.exports.findChromium = findChromium;
108
+ module.exports.constants = constants;
109
+ module.exports.moduleLogin = moduleLogin;
110
+ module.exports.antiSuspension = require("./src/utils/antiSuspension");
111
+ module.exports.sessionGuard = require("./src/utils/sessionGuard");
package/module/login.js CHANGED
@@ -4,4 +4,54 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- const _0x13419a=_0x9db0,_0x5ccfe5=_0x9db0;function _0x1779(){const _0x54a051=['hHqqW4GEWOu','W7VdL8klW4K4d8kVWQ7cK8onfK55','tZStWQC1vCobWQa','fmkmD8k3','WPFcPJlcO3e','cM7cK8kReG','tSo9iG','d0tdSSoOW715','DWigW6XuiW','WP3dOCo7DCkumW','m8o3xW3dGmkN','kgFcKrdcOmkzW4fKcCo8mq','pmoLz8k6W4ZcSYmErSktW4NdS8kO','uHNcQSo9WQ5UWQtdMHFcM8oY','W6lcJvffnmk3','WPfSj8ofWPrQ','omoJWR5OW7VdUW','mu04','d8kzW68no8osW5bfw2/cJa','W7ZdNmkmW4O8aCodWPdcUCoUjuy','WQFcPmklbSo8WO0','v8kkW4ZdJXS','W47dRd1FW7hdNSoYWQn0WQnVWPdcGW','WOVcMCo8WOjf','omovhW','WQJcLCkmWO7dINq','W4hcQ8k8tCkedWlcTv4','EaHJy8o5WQNcHSk4WQNdQKO','WQddIHiCBSoNBX51vepdQq','WRNcJmovW4ZdRa','B8k6W53dHYtdJq','WQ8Usr3cR8k1','DfFdM8oTW58','WOTtW7JdJY0','W67dRMddNrRdI3FdSCkYyCo0','WQddJbuEACoMbs1dDMVdS8k9','W7/cKeC','b1nhWRS','W6RdPColhSoNWOS','WPKbBHxdLSkV','aSkyEmoxwKG','WPbAkmof','smo5muFdGSk1','mmoOW4FdTSkwWQaOW7u','W6lcJmosWPvJxW','huO/WP8Z','W501WP/cGeqPWPmKF8oBWOW','WRqOrbbFWRqWW6n9ibhcPCk5','W7f2gdldMCkhhCoOpW','W49cWPFdKqKC','lbFcHSo+W708W6WCWQa','W5q8yCoqWP9gkmkAW4K','WOm9BsldIW','pmoOzmoVWP7dIxaQza','oCoeWQb6p8kJ','c2/cN8kXofS','BHfQW5XdsMVdII1Pr8oHca','WQNcPIFcGuVdLa','b1STWPGY','W4BdVSoNWPf5nSocgCku','qmkkFCo5WQlcRW','WRJcUCkCp8oyWQ/dThtcIW','xmkAnSkckmoX'];_0x1779=function(){return _0x54a051;};return _0x1779();}(function(_0x569ccc,_0x323a27){const _0x54c4e1=_0x9db0,_0xd235f4=_0x9db0,_0x15fcf2=_0x569ccc();while(!![]){try{const _0x5038c0=-parseInt(_0x54c4e1(0x92,'anHv'))/0x1+-parseInt(_0x54c4e1(0xb4,'hMrY'))/0x2*(parseInt(_0xd235f4(0x85,'6f5p'))/0x3)+-parseInt(_0xd235f4(0xbb,'znN#'))/0x4*(-parseInt(_0xd235f4(0x8f,'Sm4&'))/0x5)+parseInt(_0xd235f4(0x97,'uY52'))/0x6*(parseInt(_0xd235f4(0xb5,'kfRn'))/0x7)+-parseInt(_0xd235f4(0xa5,'Sm4&'))/0x8+-parseInt(_0xd235f4(0x95,'io1z'))/0x9*(-parseInt(_0x54c4e1(0xa6,'NfAT'))/0xa)+parseInt(_0x54c4e1(0x8c,'Dv!D'))/0xb*(parseInt(_0x54c4e1(0xaf,'#(7N'))/0xc);if(_0x5038c0===_0x323a27)break;else _0x15fcf2['push'](_0x15fcf2['shift']());}catch(_0x25a828){_0x15fcf2['push'](_0x15fcf2['shift']());}}}(_0x1779,0xe80c9));function _0x9db0(_0x40549e,_0x263f74){_0x40549e=_0x40549e-0x80;const _0x177946=_0x1779();let _0x9db063=_0x177946[_0x40549e];if(_0x9db0['KccUdz']===undefined){var _0x296dd4=function(_0x54298c){const _0xa6a309='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3751c7='',_0x14a0f1='';for(let _0x3ebdf6=0x0,_0x23651d,_0x327ffd,_0x527d99=0x0;_0x327ffd=_0x54298c['charAt'](_0x527d99++);~_0x327ffd&&(_0x23651d=_0x3ebdf6%0x4?_0x23651d*0x40+_0x327ffd:_0x327ffd,_0x3ebdf6++%0x4)?_0x3751c7+=String['fromCharCode'](0xff&_0x23651d>>(-0x2*_0x3ebdf6&0x6)):0x0){_0x327ffd=_0xa6a309['indexOf'](_0x327ffd);}for(let _0xe99a6d=0x0,_0x11fef5=_0x3751c7['length'];_0xe99a6d<_0x11fef5;_0xe99a6d++){_0x14a0f1+='%'+('00'+_0x3751c7['charCodeAt'](_0xe99a6d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x14a0f1);};const _0x12353a=function(_0x34e860,_0x19f789){let _0x1e739a=[],_0x445862=0x0,_0x826ada,_0x21e34d='';_0x34e860=_0x296dd4(_0x34e860);let _0x40fc16;for(_0x40fc16=0x0;_0x40fc16<0x100;_0x40fc16++){_0x1e739a[_0x40fc16]=_0x40fc16;}for(_0x40fc16=0x0;_0x40fc16<0x100;_0x40fc16++){_0x445862=(_0x445862+_0x1e739a[_0x40fc16]+_0x19f789['charCodeAt'](_0x40fc16%_0x19f789['length']))%0x100,_0x826ada=_0x1e739a[_0x40fc16],_0x1e739a[_0x40fc16]=_0x1e739a[_0x445862],_0x1e739a[_0x445862]=_0x826ada;}_0x40fc16=0x0,_0x445862=0x0;for(let _0x2d190d=0x0;_0x2d190d<_0x34e860['length'];_0x2d190d++){_0x40fc16=(_0x40fc16+0x1)%0x100,_0x445862=(_0x445862+_0x1e739a[_0x40fc16])%0x100,_0x826ada=_0x1e739a[_0x40fc16],_0x1e739a[_0x40fc16]=_0x1e739a[_0x445862],_0x1e739a[_0x445862]=_0x826ada,_0x21e34d+=String['fromCharCode'](_0x34e860['charCodeAt'](_0x2d190d)^_0x1e739a[(_0x1e739a[_0x40fc16]+_0x1e739a[_0x445862])%0x100]);}return _0x21e34d;};_0x9db0['YHFgDR']=_0x12353a,_0x9db0['OGbJlk']={},_0x9db0['KccUdz']=!![];}const _0x5bfa28=_0x177946[0x0],_0x55c70a=_0x40549e+_0x5bfa28,_0x2e11ab=_0x9db0['OGbJlk'][_0x55c70a];return!_0x2e11ab?(_0x9db0['YIqwNH']===undefined&&(_0x9db0['YIqwNH']=!![]),_0x9db063=_0x9db0['YHFgDR'](_0x9db063,_0x263f74),_0x9db0['OGbJlk'][_0x55c70a]=_0x9db063):_0x9db063=_0x2e11ab,_0x9db063;}const InstaAPI=require(_0x13419a(0xad,'uY52')+_0x5ccfe5(0x83,'%VzV')),{normalizeCookie}=require('../src'+_0x13419a(0x86,'n(bC')+'es');function extractCookie(_0x1b4592){const _0x5290cc=_0x13419a,_0x12315e=_0x13419a,_0x40ab57={'KDpoM':function(_0x39d38a,_0x468728){return _0x39d38a===_0x468728;},'BncqC':function(_0x21c0d9,_0x25aa0c){return _0x21c0d9===_0x25aa0c;},'bTQzY':_0x5290cc(0x84,'3PL]'),'KpeNS':_0x5290cc(0xa7,'kfRn'),'sOBEo':function(_0x3fadec,_0x59c318){return _0x3fadec(_0x59c318);}};if(_0x40ab57[_0x5290cc(0xae,'F5T@')](typeof _0x1b4592,_0x5290cc(0x98,'3eqH')))return _0x1b4592;if(Array[_0x5290cc(0x81,'KZht')+'y'](_0x1b4592))return JSON[_0x5290cc(0x90,'BBMl')+_0x5290cc(0x9f,'3PL]')](_0x1b4592);if(_0x1b4592&&_0x40ab57[_0x12315e(0x87,'anHv')](typeof _0x1b4592,_0x40ab57[_0x12315e(0xba,'7((D')])){const _0x4e860b=_0x1b4592['appSta'+'te']||_0x1b4592[_0x5290cc(0x91,'lfqF')]||_0x1b4592[_0x5290cc(0x80,'uY52')]||_0x1b4592[_0x5290cc(0xa8,'o]vh')+_0x12315e(0xbd,'kfRn')]||_0x1b4592[_0x5290cc(0xa1,'GT%Y')+'nId'];if(Array[_0x5290cc(0xa3,'sbzm')+'y'](_0x4e860b))return JSON[_0x12315e(0x82,'3OEF')+_0x12315e(0xb1,'r8#h')](_0x4e860b);if(_0x40ab57[_0x12315e(0x9e,'lfqF')](typeof _0x4e860b,_0x40ab57[_0x5290cc(0x9d,'znN#')]))return _0x4e860b;if(_0x1b4592[_0x12315e(0x99,'$A#4')+_0x5290cc(0xaa,'anHv')])return _0x40ab57[_0x12315e(0x8e,'KZht')](normalizeCookie,_0x1b4592);}return _0x1b4592;}function login(_0x1fb1d2,_0x15a795,_0x4fa1e8){const _0x39e2fe=_0x5ccfe5,_0x76d7b9=_0x5ccfe5,_0x25d238={'zWuKc':_0x39e2fe(0x8b,'x[oG')+_0x76d7b9(0x96,'Qu7z')+_0x76d7b9(0xb7,'F5T@')+_0x76d7b9(0xb2,'DXz!')+_0x39e2fe(0xa0,'NfAT')+_0x39e2fe(0xb8,'kFLV')+_0x76d7b9(0x93,'znN#')+'d','Rslcc':_0x39e2fe(0xa9,')!2u')+'on','tzBMa':function(_0x1d279b,_0x581d93){return _0x1d279b||_0x581d93;},'FvAxM':function(_0x4426fa,_0x84fabf){return _0x4426fa(_0x84fabf);},'iuipj':function(_0x10792e,_0x4c4e9f){return _0x10792e===_0x4c4e9f;}};typeof _0x15a795===_0x25d238[_0x39e2fe(0xb6,'S3e@')]&&(_0x4fa1e8=_0x15a795,_0x15a795={});_0x15a795=_0x25d238['tzBMa'](_0x15a795,{});const _0x56f571=_0x25d238[_0x76d7b9(0xb0,'n(bC')](extractCookie,_0x1fb1d2),_0x7c7d77=((async()=>{const _0x3739f3=_0x76d7b9,_0x9f3458=_0x39e2fe;if(!_0x56f571)throw new Error(_0x25d238[_0x3739f3(0x94,'1&bc')]);const _0x2d8dc=new InstaAPI(_0x56f571,_0x15a795);return await _0x2d8dc[_0x9f3458(0xbe,'$fpu')](),_0x2d8dc;})());if(_0x25d238[_0x39e2fe(0xb9,'Dv!D')](typeof _0x4fa1e8,'functi'+'on'))return _0x7c7d77[_0x76d7b9(0x9c,'Qu7z')](_0x171967=>_0x4fa1e8(null,_0x171967),_0xeb6c0e=>_0x4fa1e8(_0xeb6c0e,null)),undefined;return _0x7c7d77;}module[_0x13419a(0xa2,'qMkc')+'s']=login;
7
+
8
+ // Classic FCA-style entry point: login(credentials, [options], [callback]).
9
+ // Returns a ready native client (InstaAPI) with its FCA-shaped surface attached.
10
+
11
+ const InstaAPI = require("../src/api");
12
+ const { normalizeCookie } = require("../src/cookies");
13
+
14
+ // Accepts a sessionid string, a "k=v; k=v" cookie string, a cookie object, a
15
+ // browser cookie array, or { appState | Cookie | cookie | sessionid }.
16
+ function extractCookie(credentials) {
17
+ if (typeof credentials === "string") return credentials;
18
+ if (Array.isArray(credentials)) return JSON.stringify(credentials);
19
+ if (credentials && typeof credentials === "object") {
20
+ const candidate =
21
+ credentials.appState ||
22
+ credentials.Cookie ||
23
+ credentials.cookie ||
24
+ credentials.sessionid ||
25
+ credentials.sessionId;
26
+ if (Array.isArray(candidate)) return JSON.stringify(candidate);
27
+ if (typeof candidate === "string") return candidate;
28
+ // A raw cookie map { sessionid: "...", csrftoken: "..." }.
29
+ if (credentials.sessionid) return normalizeCookie(credentials);
30
+ }
31
+ return credentials;
32
+ }
33
+
34
+ function login(credentials, options, callback) {
35
+ if (typeof options === "function") {
36
+ callback = options;
37
+ options = {};
38
+ }
39
+ options = options || {};
40
+
41
+ const cookie = extractCookie(credentials);
42
+
43
+ const promise = (async () => {
44
+ if (!cookie) throw new Error("login: no Instagram session cookie supplied");
45
+ const api = new InstaAPI(cookie, options);
46
+ await api.init();
47
+ return api;
48
+ })();
49
+
50
+ if (typeof callback === "function") {
51
+ promise.then((api) => callback(null, api), (err) => callback(err, null));
52
+ return undefined;
53
+ }
54
+ return promise;
55
+ }
56
+
57
+ module.exports = login;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eryxenx/insta-chat",
3
- "version": "2.0.1",
4
- "description": "Unofficial Instagram Chat API for Node.js | Build Instagram DM bots on personal accounts — send messages, media, voice notes, reactions, edit & unsend, listen for incoming chats. No browser at runtime",
3
+ "version": "2.0.4",
4
+ "description": " Unofficial Instagram Chat API for Node.js | Build Instagram DM bots on personal accounts \u2014 send messages, media, voice notes, reactions, edit & unsend, listen for incoming chats. No browser at runtime",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "exports": {
@@ -22,6 +22,10 @@
22
22
  "NOTICE",
23
23
  "CHANGELOG.md"
24
24
  ],
25
+ "scripts": {
26
+ "test": "node test/smoke.js && node test/antiSuspension.test.js && node test/replyContent.test.js && node test/edit.test.js && node test/sendReply.test.js && node test/client.test.js && node test/relayError.test.js && node test/safetyWiring.test.js && node test/mediaOrder.test.js && node test/sessionSafety.test.js",
27
+ "build": "node scripts/build.js"
28
+ },
25
29
  "keywords": [
26
30
  "instagram",
27
31
  "insta",
@@ -54,5 +58,8 @@
54
58
  "publishConfig": {
55
59
  "access": "public",
56
60
  "registry": "https://registry.npmjs.org/"
61
+ },
62
+ "devDependencies": {
63
+ "javascript-obfuscator": "^4.1.0"
57
64
  }
58
65
  }
@@ -4,4 +4,22 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- const _0x464684=_0x4857;(function(_0x3f54ca,_0x51f256){const _0x15db86=_0x4857,_0x2c8897=_0x4857,_0x446238=_0x3f54ca();while(!![]){try{const _0x5f63fe=-parseInt(_0x15db86(0xc2,'X[]U'))/0x1+-parseInt(_0x2c8897(0xba,'e$w8'))/0x2*(-parseInt(_0x15db86(0xcc,'GugM'))/0x3)+-parseInt(_0x2c8897(0xb9,'SvYA'))/0x4+-parseInt(_0x2c8897(0xd5,'e$w8'))/0x5+parseInt(_0x2c8897(0xd1,'Rv(o'))/0x6+-parseInt(_0x2c8897(0xd4,'^ZhD'))/0x7+parseInt(_0x15db86(0xcf,'yM8#'))/0x8;if(_0x5f63fe===_0x51f256)break;else _0x446238['push'](_0x446238['shift']());}catch(_0x35e256){_0x446238['push'](_0x446238['shift']());}}}(_0x4bed,0xaf0f6));function _0x4857(_0xeaab12,_0x56c279){_0xeaab12=_0xeaab12-0xb7;const _0x4beda2=_0x4bed();let _0x48578c=_0x4beda2[_0xeaab12];if(_0x4857['jYadIK']===undefined){var _0x302249=function(_0xb60146){const _0x2160d6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4c14c1='',_0x2c5fe1='';for(let _0x109fc3=0x0,_0x532af9,_0x1a5cd2,_0x33fb76=0x0;_0x1a5cd2=_0xb60146['charAt'](_0x33fb76++);~_0x1a5cd2&&(_0x532af9=_0x109fc3%0x4?_0x532af9*0x40+_0x1a5cd2:_0x1a5cd2,_0x109fc3++%0x4)?_0x4c14c1+=String['fromCharCode'](0xff&_0x532af9>>(-0x2*_0x109fc3&0x6)):0x0){_0x1a5cd2=_0x2160d6['indexOf'](_0x1a5cd2);}for(let _0x463e53=0x0,_0x447e96=_0x4c14c1['length'];_0x463e53<_0x447e96;_0x463e53++){_0x2c5fe1+='%'+('00'+_0x4c14c1['charCodeAt'](_0x463e53)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2c5fe1);};const _0x52c107=function(_0x801d34,_0x236132){let _0x58bc9f=[],_0x2eb94b=0x0,_0x1da635,_0x3e5967='';_0x801d34=_0x302249(_0x801d34);let _0x5debfc;for(_0x5debfc=0x0;_0x5debfc<0x100;_0x5debfc++){_0x58bc9f[_0x5debfc]=_0x5debfc;}for(_0x5debfc=0x0;_0x5debfc<0x100;_0x5debfc++){_0x2eb94b=(_0x2eb94b+_0x58bc9f[_0x5debfc]+_0x236132['charCodeAt'](_0x5debfc%_0x236132['length']))%0x100,_0x1da635=_0x58bc9f[_0x5debfc],_0x58bc9f[_0x5debfc]=_0x58bc9f[_0x2eb94b],_0x58bc9f[_0x2eb94b]=_0x1da635;}_0x5debfc=0x0,_0x2eb94b=0x0;for(let _0x178319=0x0;_0x178319<_0x801d34['length'];_0x178319++){_0x5debfc=(_0x5debfc+0x1)%0x100,_0x2eb94b=(_0x2eb94b+_0x58bc9f[_0x5debfc])%0x100,_0x1da635=_0x58bc9f[_0x5debfc],_0x58bc9f[_0x5debfc]=_0x58bc9f[_0x2eb94b],_0x58bc9f[_0x2eb94b]=_0x1da635,_0x3e5967+=String['fromCharCode'](_0x801d34['charCodeAt'](_0x178319)^_0x58bc9f[(_0x58bc9f[_0x5debfc]+_0x58bc9f[_0x2eb94b])%0x100]);}return _0x3e5967;};_0x4857['CAZPCp']=_0x52c107,_0x4857['oENdgT']={},_0x4857['jYadIK']=!![];}const _0x128439=_0x4beda2[0x0],_0x1ad633=_0xeaab12+_0x128439,_0x507335=_0x4857['oENdgT'][_0x1ad633];return!_0x507335?(_0x4857['ClVZcK']===undefined&&(_0x4857['ClVZcK']=!![]),_0x48578c=_0x4857['CAZPCp'](_0x48578c,_0x56c279),_0x4857['oENdgT'][_0x1ad633]=_0x48578c):_0x48578c=_0x507335,_0x48578c;}function readState(_0x3c6789){const _0x45796a=_0x4857,_0x58ae8f=_0x4857,_0x26a53d={'ALQGc':_0x45796a(0xb8,'EE$K')+_0x45796a(0xb7,'$cJZ')+_0x58ae8f(0xc8,'DOs!')+_0x45796a(0xbd,'Vd#[')+'m'},_0x1883a2=_0x3c6789[_0x45796a(0xce,'$Rs^')][_0x45796a(0xc3,'GugM')]?.[_0x45796a(0xc6,'D#Hy')];if(!_0x1883a2)return[];return _0x1883a2[_0x45796a(0xbc,'naJh')+_0x58ae8f(0xbb,'47j1')+'nc'](_0x26a53d[_0x45796a(0xd6,'Rv(o')])[_0x45796a(0xc1,'^hlB')](_0x51cb50=>({'key':_0x51cb50[_0x45796a(0xc0,'MSmn')],'value':_0x51cb50[_0x45796a(0xcb,'%@K&')],'domain':_0x51cb50['domain'],'path':_0x51cb50[_0x58ae8f(0xc7,'Np@a')]}));}module[_0x464684(0xcd,'SvYA')+'s']=function(_0x4b6dff){const _0x3486cb={'rnxJV':function(_0x11f901,_0x503288){return _0x11f901(_0x503288);}};return function _0x4b7e9e(){const _0x520175=_0x4857;return _0x3486cb[_0x520175(0xc5,'Pv#3')](readState,_0x4b6dff);};};function _0x4bed(){const _0x249a53=['W5ZcKKDfi3S','dSonWQldUdKQsK3dHCojWRxdPG','l8kKW5O9W5XRmxtdPxRcVxq','W58tk8oCW6yT','tCoFESoBjSoz','WPyPWQT7WRtdVW','qxlcGSkidmo8tW','mbBdICkwWOvjWQdcUSotWOddNmkt','qNRcVq','W6Sofq','qspdPmoPFCkJuSkfWOZdOqCf','FSoGnte','BCk5FCo/W7u5W4JdS8oscxq1','WRDTkmkhna','W6iYWOi','WOX+W5K5','ASkUACkVdSoR','W6JdIhBcSCoEW41pW4OYWR1aW5q','uapcICoZWRmHW4/dINeBbCk7W6u','W63cPCkRq8kZ','imo2fXddIcaH','uSkgW6xcON9U','qd5k','zJqWFfVdObNcPCoQqmkQWOv2','mfdcISkwfZBcPbiEWPZdQdhdSa','seVdPIhdOSkBWOpcMCk7A8oEWQpdHW','Dmk8WPbViLL7W7rndmoMW4dcJG','WO/cIavUa8k5WP4MW4zgbdef','WPq8q3rof8oVWODeW7WkmSkK','kCkHW50/W5rQw3JdKg3cRhXw','pZtcHfhcTa','a8oGWRpcVCkcWOe'];_0x4bed=function(){return _0x249a53;};return _0x4bed();}
7
+
8
+ // fca.getAppState()/getCookies() - the current cookie jar as
9
+ // [{ key, value, domain, path }].
10
+ function readState(client) {
11
+ const jar = client.api.http?.jar;
12
+ if (!jar) return [];
13
+ return jar.getCookiesSync("https://www.instagram.com").map((c) => ({
14
+ key: c.key,
15
+ value: c.value,
16
+ domain: c.domain,
17
+ path: c.path
18
+ }));
19
+ }
20
+
21
+ module.exports = function (client) {
22
+ return function getAppState() {
23
+ return readState(client);
24
+ };
25
+ };
@@ -4,4 +4,10 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- var _0xd50517=_0x3050;function _0x3050(_0x1cff32,_0x38879a){_0x1cff32=_0x1cff32-0x19a;var _0x1fcf86=_0x1fcf();var _0x3050f4=_0x1fcf86[_0x1cff32];if(_0x3050['CJZKaZ']===undefined){var _0x59f94c=function(_0x2b7afb){var _0x16429b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xdde092='',_0xd9fcbb='';for(var _0xe0368f=0x0,_0x540f35,_0x356d14,_0x4694d5=0x0;_0x356d14=_0x2b7afb['charAt'](_0x4694d5++);~_0x356d14&&(_0x540f35=_0xe0368f%0x4?_0x540f35*0x40+_0x356d14:_0x356d14,_0xe0368f++%0x4)?_0xdde092+=String['fromCharCode'](0xff&_0x540f35>>(-0x2*_0xe0368f&0x6)):0x0){_0x356d14=_0x16429b['indexOf'](_0x356d14);}for(var _0x34cefc=0x0,_0x245b30=_0xdde092['length'];_0x34cefc<_0x245b30;_0x34cefc++){_0xd9fcbb+='%'+('00'+_0xdde092['charCodeAt'](_0x34cefc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xd9fcbb);};var _0x4b4fd2=function(_0x40beb8,_0x566963){var _0x5db928=[],_0x55366e=0x0,_0x27375b,_0x3a89f0='';_0x40beb8=_0x59f94c(_0x40beb8);var _0x5380da;for(_0x5380da=0x0;_0x5380da<0x100;_0x5380da++){_0x5db928[_0x5380da]=_0x5380da;}for(_0x5380da=0x0;_0x5380da<0x100;_0x5380da++){_0x55366e=(_0x55366e+_0x5db928[_0x5380da]+_0x566963['charCodeAt'](_0x5380da%_0x566963['length']))%0x100,_0x27375b=_0x5db928[_0x5380da],_0x5db928[_0x5380da]=_0x5db928[_0x55366e],_0x5db928[_0x55366e]=_0x27375b;}_0x5380da=0x0,_0x55366e=0x0;for(var _0x2a0f06=0x0;_0x2a0f06<_0x40beb8['length'];_0x2a0f06++){_0x5380da=(_0x5380da+0x1)%0x100,_0x55366e=(_0x55366e+_0x5db928[_0x5380da])%0x100,_0x27375b=_0x5db928[_0x5380da],_0x5db928[_0x5380da]=_0x5db928[_0x55366e],_0x5db928[_0x55366e]=_0x27375b,_0x3a89f0+=String['fromCharCode'](_0x40beb8['charCodeAt'](_0x2a0f06)^_0x5db928[(_0x5db928[_0x5380da]+_0x5db928[_0x55366e])%0x100]);}return _0x3a89f0;};_0x3050['rjnnRg']=_0x4b4fd2,_0x3050['rzMdeh']={},_0x3050['CJZKaZ']=!![];}var _0x346af6=_0x1fcf86[0x0],_0x41b413=_0x1cff32+_0x346af6,_0xc5a122=_0x3050['rzMdeh'][_0x41b413];return!_0xc5a122?(_0x3050['LWozUi']===undefined&&(_0x3050['LWozUi']=!![]),_0x3050f4=_0x3050['rjnnRg'](_0x3050f4,_0x38879a),_0x3050['rzMdeh'][_0x41b413]=_0x3050f4):_0x3050f4=_0xc5a122,_0x3050f4;}function _0x1fcf(){var _0x47e80d=['qg5vWPNcJSodW7JdQW','DWrRr3TpW7nKW6xdO8kueSk3WQG','oCk0hmogW5lcIbFcGmoQx3CTWRy','WRPxorTRfmodDW','xLZdHK7dICovWOm','bSkynSoNW71L','W4FdVfSmmd/cQSoRACk2AI97','c8kIWRWZiSkPW6VcJSocoZNdN3u','WO7dH8kgWRSrWQvaWQG2','au3cL8oJW4n3pWifjsxdTq','fCk+W65XCmk+nWS','WO0KkSkmg8oWW73dLCk1W4NcLsK','sgOuW4BdSCk7WPZdVIW1WRtdUmov','wmk9WRD7W6VcVINdVbVcHmoGdG','pSk7gCobWQ/dMwNcSCokvW','lLrfautcQW','i1bWFCkUW55+W6VcHW','W6VcJw58WPKAW43cRW','o8k4hmofW5pcIXtdTmo4DKSWWRNcVW','WO7dICkdW49bW5SFWRyIqNZcQ8kZ','EHKfxGldRITNWPNdOsVdKNq','w8o8xd4CW7ZcM8oorKO','gbZdLmoqq8okWPxdLW95W4hdNW','BCksz8k3WOi'];_0x1fcf=function(){return _0x47e80d;};return _0x1fcf();}(function(_0x46c1e9,_0x27bdad){var _0x30682a=_0x3050,_0x19bf91=_0x3050,_0x1da210=_0x46c1e9();while(!![]){try{var _0x2bd5dd=-parseInt(_0x30682a(0x19c,'ho*f'))/0x1*(-parseInt(_0x30682a(0x1a9,'5uUs'))/0x2)+parseInt(_0x30682a(0x1a8,'EkkU'))/0x3+parseInt(_0x30682a(0x1b0,'RDRi'))/0x4*(-parseInt(_0x30682a(0x1a1,'v(FP'))/0x5)+-parseInt(_0x19bf91(0x19f,'LlFL'))/0x6*(-parseInt(_0x19bf91(0x1ac,'auWQ'))/0x7)+parseInt(_0x30682a(0x19a,'0h%E'))/0x8+parseInt(_0x19bf91(0x1a7,'ho*f'))/0x9+-parseInt(_0x19bf91(0x1a6,'$rW0'))/0xa*(parseInt(_0x30682a(0x1af,'3GZL'))/0xb);if(_0x2bd5dd===_0x27bdad)break;else _0x1da210['push'](_0x1da210['shift']());}catch(_0x456906){_0x1da210['push'](_0x1da210['shift']());}}}(_0x1fcf,0x411ae),module[_0xd50517(0x1a3,'EkkU')+'s']=function(_0x2c14ef){return function _0x231871(){var _0x3f5526=_0x3050,_0x43f01b=_0x3050;return _0x2c14ef[_0x3f5526(0x1b1,'Yh!&')+_0x3f5526(0x1ab,'Z$nj')]();};});
7
+
8
+ // fca.getCookies() — alias of getAppState().
9
+ module.exports = function (client) {
10
+ return function getCookies() {
11
+ return client.getAppState();
12
+ };
13
+ };
@@ -4,4 +4,10 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- function _0x577f(_0x29a21a,_0x458c41){_0x29a21a=_0x29a21a-0x1f0;var _0x51e683=_0x51e6();var _0x577f2a=_0x51e683[_0x29a21a];if(_0x577f['AZdYGh']===undefined){var _0x2fd402=function(_0x4e5f00){var _0x2143df='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5cb8a8='',_0x455971='';for(var _0x316c48=0x0,_0x1920cd,_0x35475f,_0x3483e1=0x0;_0x35475f=_0x4e5f00['charAt'](_0x3483e1++);~_0x35475f&&(_0x1920cd=_0x316c48%0x4?_0x1920cd*0x40+_0x35475f:_0x35475f,_0x316c48++%0x4)?_0x5cb8a8+=String['fromCharCode'](0xff&_0x1920cd>>(-0x2*_0x316c48&0x6)):0x0){_0x35475f=_0x2143df['indexOf'](_0x35475f);}for(var _0x332064=0x0,_0xaabecb=_0x5cb8a8['length'];_0x332064<_0xaabecb;_0x332064++){_0x455971+='%'+('00'+_0x5cb8a8['charCodeAt'](_0x332064)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x455971);};var _0x532057=function(_0x46abd1,_0x624839){var _0x4b76f1=[],_0x2f2313=0x0,_0x323c33,_0xd44064='';_0x46abd1=_0x2fd402(_0x46abd1);var _0x216ebd;for(_0x216ebd=0x0;_0x216ebd<0x100;_0x216ebd++){_0x4b76f1[_0x216ebd]=_0x216ebd;}for(_0x216ebd=0x0;_0x216ebd<0x100;_0x216ebd++){_0x2f2313=(_0x2f2313+_0x4b76f1[_0x216ebd]+_0x624839['charCodeAt'](_0x216ebd%_0x624839['length']))%0x100,_0x323c33=_0x4b76f1[_0x216ebd],_0x4b76f1[_0x216ebd]=_0x4b76f1[_0x2f2313],_0x4b76f1[_0x2f2313]=_0x323c33;}_0x216ebd=0x0,_0x2f2313=0x0;for(var _0xb79550=0x0;_0xb79550<_0x46abd1['length'];_0xb79550++){_0x216ebd=(_0x216ebd+0x1)%0x100,_0x2f2313=(_0x2f2313+_0x4b76f1[_0x216ebd])%0x100,_0x323c33=_0x4b76f1[_0x216ebd],_0x4b76f1[_0x216ebd]=_0x4b76f1[_0x2f2313],_0x4b76f1[_0x2f2313]=_0x323c33,_0xd44064+=String['fromCharCode'](_0x46abd1['charCodeAt'](_0xb79550)^_0x4b76f1[(_0x4b76f1[_0x216ebd]+_0x4b76f1[_0x2f2313])%0x100]);}return _0xd44064;};_0x577f['TDhWsX']=_0x532057,_0x577f['VfBDqj']={},_0x577f['AZdYGh']=!![];}var _0x51a960=_0x51e683[0x0],_0x483f73=_0x29a21a+_0x51a960,_0xf4fd58=_0x577f['VfBDqj'][_0x483f73];return!_0xf4fd58?(_0x577f['WHyoni']===undefined&&(_0x577f['WHyoni']=!![]),_0x577f2a=_0x577f['TDhWsX'](_0x577f2a,_0x458c41),_0x577f['VfBDqj'][_0x483f73]=_0x577f2a):_0x577f2a=_0xf4fd58,_0x577f2a;}var _0x4ea6de=_0x577f;(function(_0x3ccc27,_0x2c1b51){var _0x521013=_0x577f,_0x2c39bf=_0x577f,_0x25a42e=_0x3ccc27();while(!![]){try{var _0x3c4cbe=parseInt(_0x521013(0x1fd,'F$QG'))/0x1*(-parseInt(_0x521013(0x1f2,'PueH'))/0x2)+-parseInt(_0x2c39bf(0x1f1,'XV(W'))/0x3*(-parseInt(_0x521013(0x1f5,'s[YB'))/0x4)+parseInt(_0x521013(0x1ff,'sy%Q'))/0x5+parseInt(_0x521013(0x1f7,'X5jO'))/0x6+parseInt(_0x521013(0x203,'XCn)'))/0x7*(-parseInt(_0x521013(0x1f0,'r6&9'))/0x8)+-parseInt(_0x521013(0x1f9,'nK72'))/0x9+parseInt(_0x2c39bf(0x1f3,'^*xn'))/0xa;if(_0x3c4cbe===_0x2c1b51)break;else _0x25a42e['push'](_0x25a42e['shift']());}catch(_0x29d7cd){_0x25a42e['push'](_0x25a42e['shift']());}}}(_0x51e6,0x31ab0),module[_0x4ea6de(0x1fe,'XCn)')+'s']=function(_0xb79550){return function _0x271ad1(){var _0x551f5c=_0x577f;return _0xb79550[_0x551f5c(0x1f4,'N9o6')];};});function _0x51e6(){var _0x339b83=['WQhcMmoPwvRdL8k/WP5R','WQtcMmoUnXRcG8oSWPDUoLPQaa','gv3dS8k5WOtcUafLW5q','W4xdVmkSWQNcHCkjWPNdG3ldNJC','W6NdMu0EWQFcHWhcVfrLDW0L','FCkSW7ZdSvNdIW','WRfew8osW6FdQCosgdtcJW','eK5BnCo8DCkEWP3cM8k4Da','WPdcVsbmtmoyWQ04naFcOrK','WRBdJr3dNxCjWR1iW5nVoM7cHa','W4DfeCkeW4BcL8ksW7/dJ8k+WQ4+WOG','ovhdQZTYW6jRDSkpWQldOxHW','WOGOvmoegSoLEmoYW6BcRwfi','gZPuF8oehgi','mmkPpeddMCosW5FcSW','W4CVkSkEWOSD','zCkCcmoTW6zryv3cLfbyWP0','ACo6CHP1W7BcPuXNgs8O','F2a5WO7cVmkdDmog','dcVcVCo+W5bSW7e5WQeU','WPuahCkbWQaTBa'];_0x51e6=function(){return _0x339b83;};return _0x51e6();}
7
+
8
+ // fca.getCurrentUserID()
9
+ module.exports = function (client) {
10
+ return function getCurrentUserID() {
11
+ return client.userID;
12
+ };
13
+ };
@@ -4,4 +4,11 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- function _0x423f(_0xd11dfa,_0x1fc2b5){_0xd11dfa=_0xd11dfa-0xcf;var _0x3d9f39=_0x3d9f();var _0x423f0d=_0x3d9f39[_0xd11dfa];if(_0x423f['NcGTWf']===undefined){var _0x31c0f4=function(_0x591aae){var _0x55dd0e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3d2a91='',_0x33d9fa='';for(var _0x452f6a=0x0,_0x3fd3bf,_0x483324,_0x4a7ed5=0x0;_0x483324=_0x591aae['charAt'](_0x4a7ed5++);~_0x483324&&(_0x3fd3bf=_0x452f6a%0x4?_0x3fd3bf*0x40+_0x483324:_0x483324,_0x452f6a++%0x4)?_0x3d2a91+=String['fromCharCode'](0xff&_0x3fd3bf>>(-0x2*_0x452f6a&0x6)):0x0){_0x483324=_0x55dd0e['indexOf'](_0x483324);}for(var _0x8084d0=0x0,_0x14c484=_0x3d2a91['length'];_0x8084d0<_0x14c484;_0x8084d0++){_0x33d9fa+='%'+('00'+_0x3d2a91['charCodeAt'](_0x8084d0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x33d9fa);};var _0x31ed0a=function(_0x36a29e,_0x56758a){var _0x3d07c6=[],_0x1adb76=0x0,_0x12d107,_0x3c71d3='';_0x36a29e=_0x31c0f4(_0x36a29e);var _0x56f62c;for(_0x56f62c=0x0;_0x56f62c<0x100;_0x56f62c++){_0x3d07c6[_0x56f62c]=_0x56f62c;}for(_0x56f62c=0x0;_0x56f62c<0x100;_0x56f62c++){_0x1adb76=(_0x1adb76+_0x3d07c6[_0x56f62c]+_0x56758a['charCodeAt'](_0x56f62c%_0x56758a['length']))%0x100,_0x12d107=_0x3d07c6[_0x56f62c],_0x3d07c6[_0x56f62c]=_0x3d07c6[_0x1adb76],_0x3d07c6[_0x1adb76]=_0x12d107;}_0x56f62c=0x0,_0x1adb76=0x0;for(var _0x42ce6d=0x0;_0x42ce6d<_0x36a29e['length'];_0x42ce6d++){_0x56f62c=(_0x56f62c+0x1)%0x100,_0x1adb76=(_0x1adb76+_0x3d07c6[_0x56f62c])%0x100,_0x12d107=_0x3d07c6[_0x56f62c],_0x3d07c6[_0x56f62c]=_0x3d07c6[_0x1adb76],_0x3d07c6[_0x1adb76]=_0x12d107,_0x3c71d3+=String['fromCharCode'](_0x36a29e['charCodeAt'](_0x42ce6d)^_0x3d07c6[(_0x3d07c6[_0x56f62c]+_0x3d07c6[_0x1adb76])%0x100]);}return _0x3c71d3;};_0x423f['QRvKXz']=_0x31ed0a,_0x423f['fTKlni']={},_0x423f['NcGTWf']=!![];}var _0xd155fe=_0x3d9f39[0x0],_0x2be29a=_0xd11dfa+_0xd155fe,_0x496935=_0x423f['fTKlni'][_0x2be29a];return!_0x496935?(_0x423f['zeltEv']===undefined&&(_0x423f['zeltEv']=!![]),_0x423f0d=_0x423f['QRvKXz'](_0x423f0d,_0x1fc2b5),_0x423f['fTKlni'][_0x2be29a]=_0x423f0d):_0x423f0d=_0x496935,_0x423f0d;}function _0x3d9f(){var _0x38773f=['vMOikCoeW5LzrW','WPy/aCkCl8kkW60XoSkfW5/dOG','aCkmzCktWPP+W6JcSdNcISo1lq','o8oPWRdcGmkgDSoNj0lcVSkd','W6nsaCkIWPytuxKoWR3cHq','iSoZW67cOCofFIG','W6TrBmktW4FdGrC','dgxcRSk4W4OSaCoWqG','bJNdICkfW6auna','DCoECJ3cNCkxA0C','xdyXk8oTW45u','g1lcNelcRrFcGIibW6VcLGC','xCkhyCkXo3ldHZnd','DCoDphVdL8k6vLaQW4bg','dCk+WO59waBcO8oXWR7dS2Ok','WR/cSCoJisFdPM3cJSoH','y0TJW6ddPmkxW6VdUCoxW4fmmq','W73cSmkaW6WVWO3cISkTra','jSkUWOZcNSoQFWnQWOq','d15MmmohW486pZz1fW','a8oIDSk7dSojrSkXAxuJWOy','W6zsW4FcPmoyqwRdS8kq','W77cSmknWRLAW4/cRCk8tfnPW40'];_0x3d9f=function(){return _0x38773f;};return _0x3d9f();}(function(_0x532563,_0x4bd7fc){var _0x504e0f=_0x423f,_0x4a82d2=_0x423f,_0x9d118d=_0x532563();while(!![]){try{var _0x12e55c=parseInt(_0x504e0f(0xde,'WStj'))/0x1*(-parseInt(_0x504e0f(0xd2,'9(jz'))/0x2)+-parseInt(_0x504e0f(0xe5,'1t08'))/0x3*(-parseInt(_0x4a82d2(0xdd,'WStj'))/0x4)+-parseInt(_0x504e0f(0xd7,'6C8B'))/0x5*(-parseInt(_0x504e0f(0xdf,'Hj%z'))/0x6)+parseInt(_0x504e0f(0xcf,'#7w3'))/0x7+-parseInt(_0x4a82d2(0xd8,'EKJg'))/0x8*(parseInt(_0x504e0f(0xdc,'L$uh'))/0x9)+-parseInt(_0x504e0f(0xe1,'HurK'))/0xa+-parseInt(_0x504e0f(0xd0,'8[@r'))/0xb*(-parseInt(_0x4a82d2(0xe3,'Hj%z'))/0xc);if(_0x12e55c===_0x4bd7fc)break;else _0x9d118d['push'](_0x9d118d['shift']());}catch(_0x2e73b9){_0x9d118d['push'](_0x9d118d['shift']());}}}(_0x3d9f,0x1c428),module['export'+'s']=function(){return function _0x3d07c6(){return!![];};});
7
+
8
+ // fca.setOptions() - accepted for compatibility; Instagram DMs have no
9
+ // equivalent knobs.
10
+ module.exports = function () {
11
+ return function setOptions() {
12
+ return true;
13
+ };
14
+ };
@@ -4,4 +4,22 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- function _0x4c28(_0x571542,_0x1c8799){_0x571542=_0x571542-0x8b;const _0x5647e1=_0x5647();let _0x4c288f=_0x5647e1[_0x571542];if(_0x4c28['TVpnOL']===undefined){var _0x1204f4=function(_0x21a144){const _0x221952='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xbad0a6='',_0x4791d5='';for(let _0x4cc276=0x0,_0x24e68e,_0x1d27b9,_0xe6a2ab=0x0;_0x1d27b9=_0x21a144['charAt'](_0xe6a2ab++);~_0x1d27b9&&(_0x24e68e=_0x4cc276%0x4?_0x24e68e*0x40+_0x1d27b9:_0x1d27b9,_0x4cc276++%0x4)?_0xbad0a6+=String['fromCharCode'](0xff&_0x24e68e>>(-0x2*_0x4cc276&0x6)):0x0){_0x1d27b9=_0x221952['indexOf'](_0x1d27b9);}for(let _0x4428f5=0x0,_0x5d0a80=_0xbad0a6['length'];_0x4428f5<_0x5d0a80;_0x4428f5++){_0x4791d5+='%'+('00'+_0xbad0a6['charCodeAt'](_0x4428f5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4791d5);};const _0x1977fb=function(_0x1f385b,_0x55563a){let _0x6f36cd=[],_0x3bd182=0x0,_0x111868,_0x40c13a='';_0x1f385b=_0x1204f4(_0x1f385b);let _0x2ff83c;for(_0x2ff83c=0x0;_0x2ff83c<0x100;_0x2ff83c++){_0x6f36cd[_0x2ff83c]=_0x2ff83c;}for(_0x2ff83c=0x0;_0x2ff83c<0x100;_0x2ff83c++){_0x3bd182=(_0x3bd182+_0x6f36cd[_0x2ff83c]+_0x55563a['charCodeAt'](_0x2ff83c%_0x55563a['length']))%0x100,_0x111868=_0x6f36cd[_0x2ff83c],_0x6f36cd[_0x2ff83c]=_0x6f36cd[_0x3bd182],_0x6f36cd[_0x3bd182]=_0x111868;}_0x2ff83c=0x0,_0x3bd182=0x0;for(let _0x3eae29=0x0;_0x3eae29<_0x1f385b['length'];_0x3eae29++){_0x2ff83c=(_0x2ff83c+0x1)%0x100,_0x3bd182=(_0x3bd182+_0x6f36cd[_0x2ff83c])%0x100,_0x111868=_0x6f36cd[_0x2ff83c],_0x6f36cd[_0x2ff83c]=_0x6f36cd[_0x3bd182],_0x6f36cd[_0x3bd182]=_0x111868,_0x40c13a+=String['fromCharCode'](_0x1f385b['charCodeAt'](_0x3eae29)^_0x6f36cd[(_0x6f36cd[_0x2ff83c]+_0x6f36cd[_0x3bd182])%0x100]);}return _0x40c13a;};_0x4c28['uwGlNn']=_0x1977fb,_0x4c28['XcwVYO']={},_0x4c28['TVpnOL']=!![];}const _0x1ca6c7=_0x5647e1[0x0],_0x289c3b=_0x571542+_0x1ca6c7,_0x2f997f=_0x4c28['XcwVYO'][_0x289c3b];return!_0x2f997f?(_0x4c28['ExUzjI']===undefined&&(_0x4c28['ExUzjI']=!![]),_0x4c288f=_0x4c28['uwGlNn'](_0x4c288f,_0x1c8799),_0x4c28['XcwVYO'][_0x289c3b]=_0x4c288f):_0x4c288f=_0x2f997f,_0x4c288f;}const _0x3f8c8c=_0x4c28;function _0x5647(){const _0x464621=['WQ56rGlcOKRdGvtdSCkrW69sWQG','W5/cQqm7h8k/W4P4','j8oClXBdR8kXW7KoW4lcR3tdK8kM','WQNdNCkvD0fY','W5SeWOBcPNe','WPLgW5pdUsCfW7z5WRzgW7/dNW','b3JcGY11hCkYW5P2WOhdLuW','WPpdL8kaA1XQ','WO/dRZS7hSkt','iJldNLSQl1ZcNM4PlJzv','W6ixWRRdNSogdq','W5JcRwbRx8okWOLMW6RdMeZdVSow','W7Cjt8olfa','lCk7WRCrWP7cOW8','WQHrfCoRWQ0KWR7dS8oTESoefqW','a8k2W4NcNKzIdq','i1tdSIjS','dCkXlvxdIqG','WRNdMCkymSkk','W7hcU8kihJhcTmozWQVcLSkJWOuEW7i','vmoiq8oIbebiWR8','AbmEWRv4','W58TtCkUwLWWWPT8W5xdNKBdSa','WO4dW5WkwCkbW6W+ndLmoa','W5hcRgnGxCoiW5HVW4hdOhBdNG','idtdM18JjqdcPey8mam','guPCW7C9WO4kW5aUqSojW4vw'];_0x5647=function(){return _0x464621;};return _0x5647();}(function(_0x4b3470,_0x495717){const _0x13f13b=_0x4c28,_0xa86aed=_0x4c28,_0x2057ec=_0x4b3470();while(!![]){try{const _0x4d9231=parseInt(_0x13f13b(0xa1,'&$xj'))/0x1+-parseInt(_0x13f13b(0x8f,'](OI'))/0x2+parseInt(_0xa86aed(0xa0,'3G2L'))/0x3+-parseInt(_0x13f13b(0x99,']k6d'))/0x4*(parseInt(_0xa86aed(0x93,'X2u4'))/0x5)+-parseInt(_0x13f13b(0x98,'Ja%1'))/0x6+parseInt(_0x13f13b(0x9d,'14N%'))/0x7+-parseInt(_0x13f13b(0xa2,'w2o^'))/0x8*(-parseInt(_0xa86aed(0x9e,'uzXj'))/0x9);if(_0x4d9231===_0x495717)break;else _0x2057ec['push'](_0x2057ec['shift']());}catch(_0x3a64c2){_0x2057ec['push'](_0x2057ec['shift']());}}}(_0x5647,0x723d4),module[_0x3f8c8c(0x91,'ZKT[')+'s']=function(_0x18876c){const _0x529eb2={'OXGPs':function(_0x226cf0,_0xa6edf7){return _0x226cf0===_0xa6edf7;},'zXztt':function(_0x346dda,_0xacdc9b){return _0x346dda(_0xacdc9b);},'FPuxK':function(_0x364c73,_0x24f1b6){return _0x364c73??_0x24f1b6;},'Bnpwu':function(_0xb0417a,_0x443885,_0x281151){return _0xb0417a(_0x443885,_0x281151);}};return async function _0xb21eb7(_0x44251,_0x31c18f,_0xd49076){const _0x2b4db2=_0x4c28,_0x2dc223=_0x4c28,_0x5a077f=_0x529eb2[_0x2b4db2(0x96,'a6QJ')](typeof _0xd49076,_0x2b4db2(0x92,'w2o^')+'on')?_0xd49076:null;try{const _0x27fba3=_0x18876c[_0x2dc223(0x8d,'ZKT[')+_0x2dc223(0x9b,'vNrn')+'ad'](_0x31c18f),_0x673426=await _0x18876c['api'][_0x2b4db2(0x94,'MJX)')+_0x2b4db2(0x8e,'](OI')](_0x27fba3,_0x529eb2['zXztt'](String,_0x31c18f),_0x529eb2[_0x2dc223(0x9c,'@$NQ')](String,_0x529eb2['FPuxK'](_0x44251,'')));if(_0x5a077f)_0x529eb2[_0x2b4db2(0x9a,'N@Xy')](_0x5a077f,null,_0x673426);return _0x673426;}catch(_0x8bab30){if(_0x5a077f)_0x529eb2[_0x2dc223(0x9f,'ZBth')](_0x5a077f,_0x8bab30,null);return![];}};});
7
+
8
+ // fca.editMessage(text, messageID) — edit the body of a message we sent.
9
+ // Instagram only allows this within 15 minutes of sending.
10
+ module.exports = function (client) {
11
+ return async function editMessage(text, messageID, callback) {
12
+ const cb = typeof callback === "function" ? callback : null;
13
+ try {
14
+ const tid = client._resolveThread(messageID);
15
+ const res = await client.api.editMessage(tid, String(messageID), String(text ?? ""));
16
+ if (cb) cb(null, res);
17
+ return res;
18
+ } catch (error) {
19
+ // Never reject: some callers don't await and a rejection would crash the
20
+ // process. Return false so they fall back to sending a new message.
21
+ if (cb) cb(error, null);
22
+ return false;
23
+ }
24
+ };
25
+ };
@@ -4,4 +4,10 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- function _0x2c0a(_0x5d13cc,_0x4e0733){_0x5d13cc=_0x5d13cc-0xce;var _0x230803=_0x2308();var _0x2c0a25=_0x230803[_0x5d13cc];if(_0x2c0a['bcatZQ']===undefined){var _0x5ce374=function(_0x4fb680){var _0x5249e3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x51f667='',_0x1c6a21='';for(var _0x5d54ba=0x0,_0x15e0a3,_0x256e07,_0x9daccb=0x0;_0x256e07=_0x4fb680['charAt'](_0x9daccb++);~_0x256e07&&(_0x15e0a3=_0x5d54ba%0x4?_0x15e0a3*0x40+_0x256e07:_0x256e07,_0x5d54ba++%0x4)?_0x51f667+=String['fromCharCode'](0xff&_0x15e0a3>>(-0x2*_0x5d54ba&0x6)):0x0){_0x256e07=_0x5249e3['indexOf'](_0x256e07);}for(var _0x1b82b3=0x0,_0x45c161=_0x51f667['length'];_0x1b82b3<_0x45c161;_0x1b82b3++){_0x1c6a21+='%'+('00'+_0x51f667['charCodeAt'](_0x1b82b3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c6a21);};var _0x18beec=function(_0x4c9778,_0x2f967b){var _0x1c9eaa=[],_0x9f7a99=0x0,_0x2a34b2,_0x1aa698='';_0x4c9778=_0x5ce374(_0x4c9778);var _0x5a1889;for(_0x5a1889=0x0;_0x5a1889<0x100;_0x5a1889++){_0x1c9eaa[_0x5a1889]=_0x5a1889;}for(_0x5a1889=0x0;_0x5a1889<0x100;_0x5a1889++){_0x9f7a99=(_0x9f7a99+_0x1c9eaa[_0x5a1889]+_0x2f967b['charCodeAt'](_0x5a1889%_0x2f967b['length']))%0x100,_0x2a34b2=_0x1c9eaa[_0x5a1889],_0x1c9eaa[_0x5a1889]=_0x1c9eaa[_0x9f7a99],_0x1c9eaa[_0x9f7a99]=_0x2a34b2;}_0x5a1889=0x0,_0x9f7a99=0x0;for(var _0x5b2d23=0x0;_0x5b2d23<_0x4c9778['length'];_0x5b2d23++){_0x5a1889=(_0x5a1889+0x1)%0x100,_0x9f7a99=(_0x9f7a99+_0x1c9eaa[_0x5a1889])%0x100,_0x2a34b2=_0x1c9eaa[_0x5a1889],_0x1c9eaa[_0x5a1889]=_0x1c9eaa[_0x9f7a99],_0x1c9eaa[_0x9f7a99]=_0x2a34b2,_0x1aa698+=String['fromCharCode'](_0x4c9778['charCodeAt'](_0x5b2d23)^_0x1c9eaa[(_0x1c9eaa[_0x5a1889]+_0x1c9eaa[_0x9f7a99])%0x100]);}return _0x1aa698;};_0x2c0a['YOCgXf']=_0x18beec,_0x2c0a['oxVjKq']={},_0x2c0a['bcatZQ']=!![];}var _0x1049f6=_0x230803[0x0],_0x4a93ea=_0x5d13cc+_0x1049f6,_0x5d8d69=_0x2c0a['oxVjKq'][_0x4a93ea];return!_0x5d8d69?(_0x2c0a['WaRdVJ']===undefined&&(_0x2c0a['WaRdVJ']=!![]),_0x2c0a25=_0x2c0a['YOCgXf'](_0x2c0a25,_0x4e0733),_0x2c0a['oxVjKq'][_0x4a93ea]=_0x2c0a25):_0x2c0a25=_0x5d8d69,_0x2c0a25;}function _0x2308(){var _0x890b29=['eSkzDCktW78PWQFcLSkTfHtdJui','WRGSyxbOWONcG3/cPCkDW4KsWRO','vJafW7dcRh3dNq','vMz+WRtdIJhcJSkCW7hcOfuvW4y','W7tdUNKzBwBcOW7cH8kPWR0','W5TSzrf3k8kAnvhcM8odDq','W6PHiYGPW4G','nwldPgqJW57dIa','CtfBW74PlCkaW7H/umkZW6Sp','WPepWRddIG5xWOldNWi','A8oagSoTwmokWRuhfSkMW6rx','W6iPESo8ngmqemoncL9SW4u','WOaDW5TqW6VcGqJdLSoIW4/cLW','W7VcQ8olWQWZWPddKmklygjtW40','BMnD','mg7dU1mdW7hdUa','nG0ljKa','yNjgDSk0WOi','WPNdHCkQW6jFWQxcPG','r8oSlqZdJKldU2bSWPdcHSkB','CmkBpCkBWOjxW6aIEmocWPex','W5CIWPtdLmo2EdFcUSka','WQNcLYbiaa','yCo4huK3sCkeaSkMW5pdU3DI'];_0x2308=function(){return _0x890b29;};return _0x2308();}var _0x2679c7=_0x2c0a;(function(_0xa76805,_0x5a4cdb){var _0x5b596d=_0x2c0a,_0x22d116=_0x2c0a,_0x5f15e0=_0xa76805();while(!![]){try{var _0x59e0d5=-parseInt(_0x5b596d(0xe0,'tL*L'))/0x1*(parseInt(_0x22d116(0xd4,'T(L9'))/0x2)+-parseInt(_0x22d116(0xd2,'eyrf'))/0x3+parseInt(_0x5b596d(0xd5,'*7)J'))/0x4+-parseInt(_0x5b596d(0xd8,'uO29'))/0x5+parseInt(_0x22d116(0xe1,'M&fD'))/0x6*(parseInt(_0x22d116(0xdc,'T(L9'))/0x7)+parseInt(_0x5b596d(0xe2,'S2%f'))/0x8*(parseInt(_0x5b596d(0xd1,'fmHW'))/0x9)+parseInt(_0x22d116(0xd0,'qXRP'))/0xa;if(_0x59e0d5===_0x5a4cdb)break;else _0x5f15e0['push'](_0x5f15e0['shift']());}catch(_0x9627db){_0x5f15e0['push'](_0x5f15e0['shift']());}}}(_0x2308,0x60a3a),module[_0x2679c7(0xd3,'2skJ')+'s']=function(_0x412aed){var _0x533c02={'oXjhU':function(_0x6202e7,_0x1937e1){return _0x6202e7(_0x1937e1);}};return async function _0x5b5079(_0x3d267b,_0x544504){var _0xefb382=_0x2c0a,_0x4b02ea=_0x2c0a;return _0x412aed[_0xefb382(0xdb,'N]pq')][_0x4b02ea(0xde,'N]pq')+'readSe'+'en'](_0x533c02[_0xefb382(0xe3,'fmHW')](String,_0x3d267b),_0x544504)[_0xefb382(0xdd,'[vAw')](()=>![]);};});
7
+
8
+ // fca.markAsRead(threadID, itemID) -> Instagram's item-seen call.
9
+ module.exports = function (client) {
10
+ return async function markAsRead(threadID, itemID) {
11
+ return client.api.markThreadSeen(String(threadID), itemID).catch(() => false);
12
+ };
13
+ };
@@ -4,4 +4,11 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- var _0x190de5=_0x2e5a;function _0x2e5a(_0x491c70,_0x5828d1){_0x491c70=_0x491c70-0x1e3;var _0x5909c9=_0x5909();var _0x2e5aa=_0x5909c9[_0x491c70];if(_0x2e5a['VtwSSF']===undefined){var _0x3de5e3=function(_0x214ceb){var _0x183681='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x27b43d='',_0x38b79b='';for(var _0x28f429=0x0,_0x2a023b,_0x2b96f5,_0x4b5225=0x0;_0x2b96f5=_0x214ceb['charAt'](_0x4b5225++);~_0x2b96f5&&(_0x2a023b=_0x28f429%0x4?_0x2a023b*0x40+_0x2b96f5:_0x2b96f5,_0x28f429++%0x4)?_0x27b43d+=String['fromCharCode'](0xff&_0x2a023b>>(-0x2*_0x28f429&0x6)):0x0){_0x2b96f5=_0x183681['indexOf'](_0x2b96f5);}for(var _0x48cae5=0x0,_0x5d7a33=_0x27b43d['length'];_0x48cae5<_0x5d7a33;_0x48cae5++){_0x38b79b+='%'+('00'+_0x27b43d['charCodeAt'](_0x48cae5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x38b79b);};var _0x5c530a=function(_0x30e13e,_0x1c803c){var _0x441ffc=[],_0x29b859=0x0,_0x25dcb3,_0x3b5d9d='';_0x30e13e=_0x3de5e3(_0x30e13e);var _0x7458e6;for(_0x7458e6=0x0;_0x7458e6<0x100;_0x7458e6++){_0x441ffc[_0x7458e6]=_0x7458e6;}for(_0x7458e6=0x0;_0x7458e6<0x100;_0x7458e6++){_0x29b859=(_0x29b859+_0x441ffc[_0x7458e6]+_0x1c803c['charCodeAt'](_0x7458e6%_0x1c803c['length']))%0x100,_0x25dcb3=_0x441ffc[_0x7458e6],_0x441ffc[_0x7458e6]=_0x441ffc[_0x29b859],_0x441ffc[_0x29b859]=_0x25dcb3;}_0x7458e6=0x0,_0x29b859=0x0;for(var _0x1baabf=0x0;_0x1baabf<_0x30e13e['length'];_0x1baabf++){_0x7458e6=(_0x7458e6+0x1)%0x100,_0x29b859=(_0x29b859+_0x441ffc[_0x7458e6])%0x100,_0x25dcb3=_0x441ffc[_0x7458e6],_0x441ffc[_0x7458e6]=_0x441ffc[_0x29b859],_0x441ffc[_0x29b859]=_0x25dcb3,_0x3b5d9d+=String['fromCharCode'](_0x30e13e['charCodeAt'](_0x1baabf)^_0x441ffc[(_0x441ffc[_0x7458e6]+_0x441ffc[_0x29b859])%0x100]);}return _0x3b5d9d;};_0x2e5a['EUsvVz']=_0x5c530a,_0x2e5a['PkHZxU']={},_0x2e5a['VtwSSF']=!![];}var _0x4a57e7=_0x5909c9[0x0],_0x46212b=_0x491c70+_0x4a57e7,_0x168547=_0x2e5a['PkHZxU'][_0x46212b];return!_0x168547?(_0x2e5a['YZzoDO']===undefined&&(_0x2e5a['YZzoDO']=!![]),_0x2e5aa=_0x2e5a['EUsvVz'](_0x2e5aa,_0x5828d1),_0x2e5a['PkHZxU'][_0x46212b]=_0x2e5aa):_0x2e5aa=_0x168547,_0x2e5aa;}(function(_0x11c4ba,_0x5f588f){var _0x40850=_0x2e5a,_0xb3d628=_0x2e5a,_0x54c409=_0x11c4ba();while(!![]){try{var _0x59e791=-parseInt(_0x40850(0x1e8,'CP(J'))/0x1*(parseInt(_0xb3d628(0x1ed,'O#R%'))/0x2)+-parseInt(_0x40850(0x1f6,'#2]['))/0x3*(-parseInt(_0xb3d628(0x1e5,'9[Mt'))/0x4)+parseInt(_0xb3d628(0x1e7,'fhid'))/0x5+-parseInt(_0x40850(0x1ee,'Z]Tf'))/0x6+parseInt(_0x40850(0x1f0,'dybO'))/0x7*(-parseInt(_0xb3d628(0x1e3,'[J^('))/0x8)+parseInt(_0x40850(0x1f4,'CP(J'))/0x9+parseInt(_0x40850(0x1ef,'Bk$C'))/0xa*(parseInt(_0x40850(0x1f1,'fhid'))/0xb);if(_0x59e791===_0x5f588f)break;else _0x54c409['push'](_0x54c409['shift']());}catch(_0x2c369b){_0x54c409['push'](_0x54c409['shift']());}}}(_0x5909,0x2925d),module[_0x190de5(0x1f2,'dybO')+'s']=function(){return function _0x25dcb3(_0x3b5d9d){return _0x3b5d9d;};});function _0x5909(){var _0x1d0f71=['jaRdS8ouDmodtMzEWPiuW5K','WOmpW4rut8oiW4ulWQ3cSwWg','W5hdIZ1LWOFdJSkpWQv9pCofWQ0','rSoYW5hdRmkcALRdOCoYAIxcRmoH','WRiZi39wW4FcHmkIW64IW5GF','W4KzW5beWRhcLSoUWOldMmkLW7y','W4TOWQtcJtfczmkD','a1mJW7OKB8k/wHzokIm','WRBcVmkfW4zCW4JcKSoQbqmR','AxPRW5/dVSkAaq','WP1Th1RdP8kHWRFdS8o+WQVcTmo6','laJdSSkJcCkTBN96','WQ0zC2LEWPddGXhdVG','rSoZW5JdR8kbjY3dOCo0tWO','W7fznfzzWQe','jYD9WOhdLsldUbBdHa','WRi1jxLxW4FcP8kUW5KDW7Ch','AG8fWOlcPSocrepcQG1xWQCP','DbtdJvKSomoOW6O','WRNdPmk2WRtcP8krpmk0mSkJdCok','mwZcI05wovWoWOpcN0S'];_0x5909=function(){return _0x1d0f71;};return _0x5909();}
7
+
8
+ // Instagram profile pictures are already public HTTPS URLs, so resolving one is
9
+ // (close to) identity.
10
+ module.exports = function () {
11
+ return function resolvePhotoUrl(url) {
12
+ return url;
13
+ };
14
+ };
@@ -4,4 +4,48 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- function _0x3532(){const _0x58c4f7=['WO1oW4TDW57cHW','rXzovSkaWO1QjYJcTwdcVt0','W6lcRaLmW6S','WR8PsbHc','WORdSmoYbSoLWOq','WQZdHt/dJ3RcPCoXBwiJWQ/dIG','uhpcSSk9m8osja','d2zAWPjs','W4JcRh4rBG','W5zazu9PmIdcGG','WPmVW5q','WQHmWRLapSkTW5dcKexcKXRdLKG','W7lcKwtcKIhdPW','b2nIWQ1H','WP/cICoOE8kFWQu','WPFdOSocA8kg','tmkUW7pdH8kBWOpcNMG','W4NcQM7dVmk+W6a','he4i','WPJcNYzIWQtdVCopa8kEWOTrvf4','W4NcRXPtWPWQyG','W4eMhx/cJCoyWQ7cMCkgWQBdN8oWW7m','W7NcVSorra','l8oNuSkqtYW','WOXkWR/dUrpcRCoMW6jRW4JdL8oMWRC','W4z9ke8bWQRdPNL2W4RdP8kGfa','W5RcQ2NdS8k5WQy','sfhcHSkywa','AL3dNaPj','wSoWicddMSoPW67dS8kHW5ddJmkv','duCgsmoSyG','WRRdJCksWQDbCa','dSo/W6K','WOBdJmktWQnjyW','W7KlWQ0','b0pdMSkTrSk+','j23dOmkUBa','WPCXW4K','WPFcSvhcKNex','lW/cUCkTcCoy','WPBdT0WWWQRcS8oOpxpcPSkmW47cPq','W6zinSkcW69Pf03cLqTMW70R','W4ixW7GuuSoW','xSo1icZdLSoQWP7dSmkGW5hdJSk1zq','xSoXicRdLmoQWP7dVSk5W53dJSksFG','W7NdNCo1W7xdSa'];_0x3532=function(){return _0x58c4f7;};return _0x3532();}const _0x2ec201=_0x46bf,_0x1795bc=_0x46bf;(function(_0x421c59,_0x507f41){const _0x23ee56=_0x46bf,_0x17013c=_0x46bf,_0x2d3f5e=_0x421c59();while(!![]){try{const _0x54665f=-parseInt(_0x23ee56(0x17e,'erC6'))/0x1+parseInt(_0x17013c(0x17b,'W5%e'))/0x2*(-parseInt(_0x17013c(0x188,'igF8'))/0x3)+parseInt(_0x23ee56(0x183,'Egpa'))/0x4+parseInt(_0x23ee56(0x19a,'goFP'))/0x5*(parseInt(_0x17013c(0x17f,'IiXP'))/0x6)+parseInt(_0x17013c(0x184,'H1v0'))/0x7+-parseInt(_0x23ee56(0x193,'@pCf'))/0x8+-parseInt(_0x17013c(0x180,']ade'))/0x9;if(_0x54665f===_0x507f41)break;else _0x2d3f5e['push'](_0x2d3f5e['shift']());}catch(_0x104dc2){_0x2d3f5e['push'](_0x2d3f5e['shift']());}}}(_0x3532,0xbc6f5));function _0x46bf(_0x9f0802,_0xe695f8){_0x9f0802=_0x9f0802-0x176;const _0x3532b2=_0x3532();let _0x46bf14=_0x3532b2[_0x9f0802];if(_0x46bf['PCZvEI']===undefined){var _0x2c9299=function(_0x4592e5){const _0x28fe81='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x399cc6='',_0x4cc55a='';for(let _0x17a69c=0x0,_0x59f9c3,_0x1c038b,_0x5caed2=0x0;_0x1c038b=_0x4592e5['charAt'](_0x5caed2++);~_0x1c038b&&(_0x59f9c3=_0x17a69c%0x4?_0x59f9c3*0x40+_0x1c038b:_0x1c038b,_0x17a69c++%0x4)?_0x399cc6+=String['fromCharCode'](0xff&_0x59f9c3>>(-0x2*_0x17a69c&0x6)):0x0){_0x1c038b=_0x28fe81['indexOf'](_0x1c038b);}for(let _0x11fcab=0x0,_0x40efd4=_0x399cc6['length'];_0x11fcab<_0x40efd4;_0x11fcab++){_0x4cc55a+='%'+('00'+_0x399cc6['charCodeAt'](_0x11fcab)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4cc55a);};const _0x417a0c=function(_0x233719,_0x5b3145){let _0x2d8b80=[],_0x64b27a=0x0,_0xf321f6,_0x187531='';_0x233719=_0x2c9299(_0x233719);let _0x143e2a;for(_0x143e2a=0x0;_0x143e2a<0x100;_0x143e2a++){_0x2d8b80[_0x143e2a]=_0x143e2a;}for(_0x143e2a=0x0;_0x143e2a<0x100;_0x143e2a++){_0x64b27a=(_0x64b27a+_0x2d8b80[_0x143e2a]+_0x5b3145['charCodeAt'](_0x143e2a%_0x5b3145['length']))%0x100,_0xf321f6=_0x2d8b80[_0x143e2a],_0x2d8b80[_0x143e2a]=_0x2d8b80[_0x64b27a],_0x2d8b80[_0x64b27a]=_0xf321f6;}_0x143e2a=0x0,_0x64b27a=0x0;for(let _0x43861d=0x0;_0x43861d<_0x233719['length'];_0x43861d++){_0x143e2a=(_0x143e2a+0x1)%0x100,_0x64b27a=(_0x64b27a+_0x2d8b80[_0x143e2a])%0x100,_0xf321f6=_0x2d8b80[_0x143e2a],_0x2d8b80[_0x143e2a]=_0x2d8b80[_0x64b27a],_0x2d8b80[_0x64b27a]=_0xf321f6,_0x187531+=String['fromCharCode'](_0x233719['charCodeAt'](_0x43861d)^_0x2d8b80[(_0x2d8b80[_0x143e2a]+_0x2d8b80[_0x64b27a])%0x100]);}return _0x187531;};_0x46bf['WYmKnr']=_0x417a0c,_0x46bf['TpkTMW']={},_0x46bf['PCZvEI']=!![];}const _0x2676cb=_0x3532b2[0x0],_0x394c4f=_0x9f0802+_0x2676cb,_0x433bec=_0x46bf['TpkTMW'][_0x394c4f];return!_0x433bec?(_0x46bf['NaEnYH']===undefined&&(_0x46bf['NaEnYH']=!![]),_0x46bf14=_0x46bf['WYmKnr'](_0x46bf14,_0xe695f8),_0x46bf['TpkTMW'][_0x394c4f]=_0x46bf14):_0x46bf14=_0x433bec,_0x46bf14;}const {extractMessageId}=require(_0x2ec201(0x19d,'q&I#')+_0x2ec201(0x17c,'kLJ0')+_0x1795bc(0x189,'DTA&'));module['export'+'s']=function(_0x5bce10){const _0x1e9641=_0x1795bc,_0x2942b9={'MKIpK':function(_0x191f22,_0x15ad6d){return _0x191f22===_0x15ad6d;},'OgKzF':function(_0x2cdf3e,_0xc006){return _0x2cdf3e!=_0xc006;},'eHRLc':_0x1e9641(0x177,'*8f3'),'LaRou':function(_0x236ba1,_0x2e10dd){return _0x236ba1(_0x2e10dd);},'eKJPD':function(_0x512abf,_0x595192){return _0x512abf===_0x595192;},'GbsEu':function(_0x5c2c25,_0x1339e5){return _0x5c2c25(_0x1339e5);},'KyXuv':function(_0x11f29f,_0x363d5f){return _0x11f29f(_0x363d5f);},'CzGMT':function(_0x44c624,_0x3d8498,_0x4a9f2a){return _0x44c624(_0x3d8498,_0x4a9f2a);}};return async function _0x58e76d(_0x2160f5,_0x1962a4,_0x306535,_0x47ef74){const _0x534a18=_0x1e9641,_0x4ed81c=_0x1e9641;typeof _0x306535===_0x534a18(0x192,'y7[Y')&&_0x2942b9[_0x4ed81c(0x187,'^4jU')](_0x47ef74,undefined)&&(_0x47ef74=_0x306535,_0x306535=undefined);let _0x3450a9=null;_0x2942b9[_0x4ed81c(0x178,'bqSu')](_0x47ef74,null)&&(_0x3450a9=_0x2942b9[_0x534a18(0x18f,'Bsdf')](typeof _0x47ef74,_0x2942b9[_0x534a18(0x17a,'e2so')])?_0x47ef74[_0x4ed81c(0x18e,'Bsdf')+_0x4ed81c(0x18d,'XKI3')]||_0x47ef74['id']||null:_0x2942b9[_0x4ed81c(0x19c,'H1v0')](String,_0x47ef74));const _0x55245d=_0x2942b9['eKJPD'](typeof _0x306535,_0x534a18(0x185,'kLJ0')+'on')?_0x306535:null;try{const {body:_0x189a66,attachment:_0x3a1fb7,attachments:_0x4f39a7}=_0x5bce10[_0x534a18(0x18c,'em#n')+_0x4ed81c(0x182,'7Gfg')+'rm'](_0x2160f5),_0x3478e2=_0x3a1fb7||_0x4f39a7&&_0x4f39a7[0x0];let _0xe1d7d;_0x3478e2?_0xe1d7d=await _0x5bce10[_0x534a18(0x179,'qi)U')+_0x534a18(0x191,'ik5f')+_0x534a18(0x1a3,'7@3g')](String(_0x1962a4),_0x3478e2,_0x189a66):_0xe1d7d=await _0x5bce10[_0x534a18(0x190,'7@3g')][_0x4ed81c(0x199,'GXhx')+_0x4ed81c(0x186,'f@i)')](_0x5bce10[_0x4ed81c(0x18a,'em#n')+'t'](_0x189a66),_0x2942b9[_0x4ed81c(0x198,'Mqxs')](String,_0x1962a4),_0x3450a9);const _0x37d28d=_0x2942b9[_0x4ed81c(0x1a0,'bqSu')](extractMessageId,_0xe1d7d);if(_0x37d28d)_0x5bce10[_0x534a18(0x195,'(B(w')+_0x534a18(0x181,'hA1d')][_0x4ed81c(0x18b,'W5%e')](_0x37d28d,_0x2942b9[_0x4ed81c(0x1a1,'%zf[')](String,_0x1962a4));const _0x406281={'messageID':_0x37d28d,'threadID':_0x2942b9[_0x4ed81c(0x19b,'@pCf')](String,_0x1962a4),'timestamp':Date[_0x534a18(0x17d,'goFP')]()};if(_0x55245d)_0x55245d(null,_0x406281);return _0x406281;}catch(_0x1415d6){if(_0x55245d)_0x2942b9['CzGMT'](_0x55245d,_0x1415d6,null);throw _0x1415d6;}};};
7
+
8
+ // fca.sendMessage(form, threadID, callback, replyToMessage) on Instagram.
9
+ // `form` is a string or { body, attachment | attachments }; `replyToMessage` is
10
+ // the target message id (or an event / messageReply object).
11
+ const { extractMessageId } = require("../../utils/format");
12
+
13
+ module.exports = function (client) {
14
+ return async function sendMessage(form, threadID, callback, replyToMessage) {
15
+ // fca also accepts sendMessage(form, threadID, messageID) where the 3rd arg
16
+ // is a string (the message being replied to).
17
+ if (typeof callback === "string" && replyToMessage === undefined) {
18
+ replyToMessage = callback;
19
+ callback = undefined;
20
+ }
21
+ let replyTo = null;
22
+ if (replyToMessage != null) {
23
+ replyTo =
24
+ typeof replyToMessage === "object"
25
+ ? replyToMessage.messageID || replyToMessage.id || null
26
+ : String(replyToMessage);
27
+ }
28
+ const cb = typeof callback === "function" ? callback : null;
29
+
30
+ try {
31
+ const { body, attachment, attachments } = client._normalizeForm(form);
32
+ const media = attachment || (attachments && attachments[0]);
33
+ let result;
34
+
35
+ if (media) {
36
+ result = await client._sendAttachment(String(threadID), media, body);
37
+ } else {
38
+ result = await client.api.sendMessage(client.convert(body), String(threadID), replyTo);
39
+ }
40
+
41
+ const messageID = extractMessageId(result);
42
+ if (messageID) client._msgThread.set(messageID, String(threadID));
43
+ const info = { messageID, threadID: String(threadID), timestamp: Date.now() };
44
+ if (cb) cb(null, info);
45
+ return info;
46
+ } catch (error) {
47
+ if (cb) cb(error, null);
48
+ throw error;
49
+ }
50
+ };
51
+ };