Skip to content

A sticker ​

A store sticker sent from the composer's sticker tray: the conversation's openStickerTray() opens the tray (DirectStickerTabTrayScreen), its openStickerTab() the sticker grid (DirectStickerPickerGridScreen), and the sticker's own row in the grid's list (stickers) sends itself with send(), an IGDirectStoreStickerSendMutation.

The sticker tabThe tray's sticker tab with the store's packs: openStickerTab() lists the first-party batch's stickers as stickers, every pack's in the answer's order.

The emoji tabThe tray's emoji tab, the other tab beside the stickers.

A store sticker in the conversationA store sticker shown in the conversation after the sticker row's send().

ts
import { AndroidIgpapi, FeedTimelineScreen } from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';

// A checkpoint read back from your storage (see "Keep a session").
const saved = JSON.parse(await readFile('session.json', 'utf8'));

// Send a store sticker: the tray, its sticker grid, and the sticker the person taps.
const sent = await AndroidIgpapi.launch({
  checkpoint: saved,
  screen: FeedTimelineScreen,
  main: feed =>
    Effect.gen(function* () {
      const tab = yield* feed.openDirectTab();
      const item = tab.threads[0];
      if (item === undefined) return undefined;
      const thread = yield* item.open();
      const tray = yield* thread.openStickerTray();
      const grid = yield* tray.openStickerTab();
      // The sticker the person taps is one row of the grid: the row sends itself.
      const sticker = grid.stickers[0];
      if (sticker === undefined) return undefined;
      return yield* sticker.send();
    }),
});
console.log(sent);

The pages of this site are the README files of the repository. The API reference is generated from the source.