esefandClaude Opus 5 eac6dbda3a tgbridge: rework both directions — avatars, stickers, replies, edits
fixes that were dropping messages:
- d->tg sent parse_mode=Markdown with an unescaped body, so any message
  with a stray * _ ` or [ got a 400 from telegram and vanished. now html
  with proper escaping + a plain-text retry
- no allowed_mentions on webhook posts, so telegram could @everyone
- forwarder.start() ran from on_ready, which fires again on every gateway
  reconnect -> second poller on the same token -> 409s and dupes
- document.mime_type is nullable and was called directly
- sticker finally block hit UnboundLocalError when mkstemp raised
- ffmpeg timeouts leaked temp files and orphaned the process

stickers, per format instead of one blanket gif convert:
- static .webp now passes through (the gif convert crushed 228 alpha
  levels to 2 and made the file 4x bigger)
- video .webm -> animated webp, keeps 8-bit alpha, ~7x smaller than gif.
  needs -c:v libvpx-vp9 before -i or ffmpeg silently drops the alpha
- .tgs is gzipped lottie, ffmpeg exits 183 on it and we were uploading
  the raw file. renders via optional lottie lib, else thumbnail + emoji

added: telegram profile photos as webhook avatars (re-hosted in a private
channel, AVATAR_CACHE_CHANNEL_ID), reply threading both ways, edit sync
both ways, delete sync d->tg, album batching, voice/poll/location/contact/
dice/forward attribution, utf-16-safe entity conversion, mention and custom
emoji resolution, message splitting instead of truncation, shared aiohttp
session with 429 backoff, route discovery from env, !bridge status

main.py just loads the extension now; routes come from credentials.env

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RXrxDFpyq3VjvxWGuW3CZe
2026-09-07 12:19:18 +03:00
2026-08-16 01:47:06 +03:00
2026-08-16 01:19:11 +03:00
2026-08-03 20:29:42 +03:00
2026-07-09 17:40:23 +03:00

yuuka

personal discord bot running on my arch linux laptop. named after hayase yuuka. it started as a simple music bot and became a massive mess of features i actually use.

features

  • ai — uses deepseek v4 (flash/pro). full vision support (well... vision is a little broken rn), continuous memory summarization (so it doesn't forget context), per-channel personas (yuuka/rem), and native deepseek-reasoner thinking toggles. doesn't break character.
  • bridges — two-way telegram <-> discord message forwarding. also pulls twitter/x leaks via rss and dumps them into a channel.d
  • media & music — yt-dlp + ffmpeg based music playback. also has commands for random ffmpeg media conversions.
  • sysinfo — live monitoring of my laptop's cpu, ram, temps (lm-sensors), top processes, and fastfetch.
  • utilities — live currency conversion, steam stat tracking (strinova player counts).
  • calendar — firestore-backed event booking via modal. autoconverts local times to UTC using a country list, feeds a web calendar frontend.
  • timestamp — /timestamp modal that generates Discord <t:unix:FORMAT> tags. accepts day numbers or day names ("Sunday"), handles month rollover, outputs all 7 Discord time formats.
  • timestamp (friends) — passive message listener: when a whitelisted user says "my time" in chat, the bot parses the surrounding text for time expressions, auto-converts to their timezone, and replies with timestamp tags. no commands needed.
  • junk — dice, coinflip, aura meter, rank, gifs, copypastas.

stack

  • python + discord.py
  • deepseek api for the ai stuff
  • yt-dlp + ffmpeg for audio
  • psutil + lm-sensors for hardware stats
  • hosted on an acer nitro AN515-51 running arch linux
  • runs as a systemd service, updated via git pull over ssh

commands

run these to see the sub-commands:

  • !ai — lists all ai-related commands (setting personas, activechat, toggling thinking/temperature)
  • !music — music playback controls
  • !sysinfo — hardware monitoring
  • !gifs — the gif list
  • !fun — the junk commands
  • !gacha help — blue archive recruitment simulator (pick banners, pull with live rates)
  • !book / !unbook — calendar event booking (whitelisted users only)
  • !time — Discord timestamp generator modal
S
Description
Yuuka — my Discord bot: music & radio, Blue Archive gacha, Telegram/Twitter bridges, AI chat and more.
Readme
9.9 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%