Skip to content

Attach SFW anime GIFs to action commands via Fluxpoint API - #2

Merged
CommunityPoke merged 2 commits into
mainfrom
devin/1791239690-fluxpoint-gifs
Oct 5, 2026
Merged

CommunityPoke merged 2 commits into
mainfrom
devin/1791239690-fluxpoint-gifs

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Action commands now embed a random SFW anime GIF, like the official MarriageBot. GIFs come from the Fluxpoint SFW anime GIF API (GET https://api.fluxpoint.dev/sfw/gif/<type>, token in Authorization).

  • New matrimony/gifs.py: FluxpointClient.fetch_url(image_type) returns a GIF URL or None — missing/empty key, non-200, timeout, bad JSON, and missing file all degrade to a GIF-less reply, so the action never fails on GIF problems. One lazily-created aiohttp session is reused and closed in MatrimonyBot.close().
  • Config.fluxpoint_api_key reads FLUXPOINT_API_KEY, defaulting to Fluxpoint's shared public-tier key (FP-Public-..., committed per request); empty value disables fetching.
  • _say/_respond gained an image param rendered via embed.set_image.

Command → endpoint mapping:

Command Endpoint
marry (completion) kiss
divorce cry
hug / kiss / slap / punch / bite / pat / poke / wave / lick / tickle / highfive / handhold same name
cuddle hug (no cuddle endpoint exists)
nom feed (no nom endpoint exists)
stab punch (no stab endpoint exists)
ship handhold

Parser fix: discord.py's built-in process_commands silently drops every message where author.bot is True — so !matr ... from other bots never reached the parser, despite should_process() explicitly allowing them. MatrimonyBot now overrides process_commands to use the same should_process guard (own messages still skipped), tolerates leading/trailing whitespace in message.content, and sets strip_after_prefix=True so ! matr help works. Mention prefix (@Matrimony matr ...) and extra trailing text were already handled and are now covered by tests.

Tests: tests/test_gifs.py covers client failure modes via an injected fake session and command-level embedding for every action command via a stubbed fetch_url; tests/test_dispatch.py gained end-to-end dispatch tests through the real parser (bot-authored messages, whitespace variants, mention prefix, extra text, case-insensitivity, custom guild prefix). All 70 tests pass; ruff clean. New endpoints verified live against the real API (200 + .gif URL).

Link to Devin session: https://app.devin.ai/sessions/13367e65998b4af58b5e4ba4879bc7d5
Open in Devin Desktop: https://app.devin.ai/desktop/session/13367e65998b4af58b5e4ba4879bc7d5?variant=devin
Requested by: @CommunityPoke

- New matrimony/gifs.py: FluxpointClient wrapping /sfw/gif/<type> with
  graceful fallback (missing key, HTTP errors, timeouts, malformed
  payloads all yield a GIF-less reply)
- Config: FLUXPOINT_API_KEY env var, defaulting to Fluxpoint's shared
  public-tier key; empty disables fetching
- GIFs embedded on hug/kiss/slap/punch/bite/stab/ship replies, marriage
  completion (kiss) and divorce (cry); stab maps to punch (no stab
  endpoint exists), ship to handhold
- aiohttp session reused lazily and closed on bot shutdown
- tests/test_gifs.py covers client failure modes and command embedding
- README + .env.example document the mapping and env var

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

…handhold) + lenient parsing for bot-authored commands

- New action commands backed by Fluxpoint SFW anime GIF endpoints; cuddle
  maps to hug, nom maps to feed (no dedicated endpoints exist)
- Fix bot dispatch: override process_commands - discord.py drops every
  bot-authored message by default, so '!matr ...' from other bots never
  reached the parser despite should_process() allowing them
- strip_after_prefix + message.content.strip(): tolerate whitespace after
  the prefix and around the command text
- Tests: end-to-end dispatch through the real parser (bot authors,
  whitespace variants, mention prefix, extra text, case, guild prefix)
  plus coverage that every action command maps to a documented endpoint
  and embeds its GIF
- GIF_TYPES now lists all 28 documented /sfw/gif endpoints

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@CommunityPoke
CommunityPoke merged commit 8c998df into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant