Documentation Index
Fetch the complete documentation index at: https://mintlify.com/noskap/kojima-bot/llms.txt
Use this file to discover all available pages before exploring further.
Discord’s native embeds for X/Twitter and Instagram links are often broken or empty. Kojima Bot can silently intercept those links, delete the original message, and repost it under the sender’s name using mirror domains that provide proper oEmbed data. The result is a richer inline preview with no manual effort from your users.
What it does
When link fixup is enabled, the bot watches every message in every channel it can read. If a message contains X/Twitter or Instagram URLs and has no attachments or stickers, the bot:
- Rewrites the matching URLs to their mirror equivalents.
- Deletes the original message.
- Reposts the content as
**Name** shared:\n<fixed URLs>, preserving any surrounding text.
The reposted message suppresses all mentions so no one is pinged unexpectedly. Because fixupx.com and vxinstagram.com implement oEmbed endpoints that Discord’s embed service can read, Discord generates a proper rich embed for the reposted link.
Link fixup deletes the original message. Users may be surprised if they don’t know this feature is active — consider announcing it in your server.
Enabling link fixup
Set one or both environment variables in your .env file and restart the bot:
# Rewrite x.com / twitter.com links to fixupx.com
LINK_FIXUP_X=true
# Rewrite instagram.com links to vxinstagram.com
LINK_FIXUP_INSTAGRAM=true
Accepted truthy values are true, 1, yes, and on (case-insensitive). Both flags are independent — you can enable one without the other. The bot logs confirmation at startup when either flag is active:
[link-fixup] Enabled — LINK_FIXUP_X=true LINK_FIXUP_INSTAGRAM=false
Required permissions
The bot needs two permissions in every channel where link fixup should operate:
| Permission | Reason |
|---|
| Manage Messages | To delete the original message before reposting. |
| Send Messages | To post the rewritten version. |
If the bot is missing either permission in a channel it logs a one-time warning and skips that channel silently:
[link-fixup] skipping 123456789: bot needs Manage Messages + Send Messages
The warning is only logged once per channel to avoid log spam. It resets when the bot restarts.
URL rewriting rules
| Platform | Matched Hostnames | Rewritten To | Query String |
|---|
| X / Twitter | x.com, twitter.com, mobile.twitter.com | fixupx.com | Preserved |
| Instagram | instagram.com, m.instagram.com | vxinstagram.com | Stripped (removes tracking params) |
The URL path is always preserved for both platforms. For Instagram, the entire query string is removed (u.search = "") so tracking parameters from share links do not appear in the repost.
When it does NOT trigger
The fixup is intentionally conservative. A message is skipped entirely if any of the following are true:
- The message has attachments (files, images, videos).
- The message has stickers.
- The message has no text content after trimming.
- None of the URLs in the message match the configured platforms.
- The rewritten URL would be identical to the original (no actual change).
- The message was sent by a bot or webhook.
Only plain text messages whose URLs are rewritable will be intercepted.
Word reactions
Separately from link fixup, the bot reacts to messages containing certain keywords with application emojis. This feature is always on as long as the bot has the Add Reactions permission.
| Keyword (case-insensitive substring) | Reaction Emoji Name |
|---|
invisible | invisible |
haha | happyboss |
dud | dud |
Reactions use Discord application emojis — they must be uploaded to your Discord app’s emoji list in the Developer Portal under Your App → Emoji. If a named emoji is not found in the application’s cache, the reaction is silently skipped.
The bot enforces a rate limit of 100 reactions per guild per 5 minutes to prevent spam. Once the limit is reached within a window, all further reactions for that guild are suppressed until the 5-minute counter resets.