Appearance
Message controls
What it is for. Changing who can send you message requests and where they land: Settings → Privacy → Messages.
What you call. SettingsPrivacyMessagesGet() reads the options; SettingsPrivacyMessagesSet(config) writes them. Both are effects you call inside the main of an entry (Effects inside main).
What you get. Get answers the current configuration (ig_followers, fb_friends, fb_friends_of_friends, people_with_your_phone_number, others_on_fb, others_on_ig, group_message_setting). Set answers { status }, or a warning alert when the change needs a second one (below).
The settings screen these options are: SettingsPrivacyMessagesGet() returns one value for each row.
Instagram takes all the options in one call, so you should send all of them, even if you change only one. Read the configuration first, change the field, and send the whole configuration back:
ts
import {
AndroidIgpapi,
FeedTimelineScreen,
SettingsPrivacyMessagesGet,
SettingsPrivacyMessagesSet,
} from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';
// The checkpoint saved in "Your first program".
const saved = JSON.parse(await readFile('session.json', 'utf8'));
const result = await AndroidIgpapi.launch({
checkpoint: saved,
screen: FeedTimelineScreen,
main: _feed =>
Effect.gen(function* () {
const current = yield* SettingsPrivacyMessagesGet();
if (current.ig_followers !== 'do_not_receive') return current.ig_followers;
// Instagram takes every option at once: send the whole configuration back with the one change.
return yield* SettingsPrivacyMessagesSet({ ...current, ig_followers: 'message_requests' });
}),
});
console.log(result);The "Your followers on Instagram" option
If you change "Your followers on Instagram" to Don't receive requests (ig_followers: 'do_not_receive'), you should also set the same for "Others on Instagram" (others_on_ig). Otherwise the answer carries a proposed_config and a warning_alert, and the settings are not applied:
json
{
"proposed_config": {
"fb_friends": "primary",
"fb_friends_of_friends": "message_requests",
"group_message_setting": "everyone",
"ig_followers": "do_not_receive",
"ig_verified": "disabled",
"others_on_fb": "message_requests",
"others_on_ig": "do_not_receive",
"people_with_your_phone_number": "message_requests"
},
"status": "ok",
"warning_alert": {
"alert_cancel_button": "Don't Update Settings",
"alert_confirmation_button": "Update Settings",
"alert_message": "You won’t receive new message requests from anyone on Instagram. Do you want to update settings?",
"alert_title": "This will also turn off requests from others on Instagram"
}
}
The alert the app shows for this answer; a program that gets warning_alert sees the same question.
To change the setting, send both options together:
json
{
"ig_followers": "do_not_receive",
"others_on_ig": "do_not_receive"
}