Skip to content
analeisPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

bear-bot

A bear-themed Discord and Fluxer bot written in TypeScript on Bun. Hunt for fish, forage in the woods, and trade what you find. Facts, jokes, fortunes, and GIFs are available too.

Getting started

bun install --frozen-lockfile
cp .env.example .env
# Set DISCORD_TOKEN, FLUXER_TOKEN, or both in .env.
bun run start

Discord registers slash commands on startup. Set DISCORD_GUILD_ID to register them in a test server. Fluxer uses prefix commands such as !bear hunt or !hunt; FLUXER_PREFIX replaces the !. The bot can serve both platforms in one process.

SQLite stores an independent economy for each platform and server. Direct messages use a separate economy on each platform. The default database is data/bear-bot.db; see .env.example for other settings.

Commands

Discord What it does
/hunt Catch fish and other game; costs 25 stamina with a five-minute cooldown
/forage Find berries, acorns, mushrooms, or honey; costs 10 stamina with a ten-minute cooldown
/daily Collect berries and honey every 24 hours
/den Check stamina, currencies, cooldowns, encounters, and furnishings
/inventory List resources and collectibles
/eat item:honey Eat an item to restore stamina
/give item:trout user:@friend amount:2 Give resources or collectibles to another bear
/shop List woodland barter and human market offers
/trade offer:honey amount:1 Swap two trout for one honey; amount is the number of exchanges
/encounter View the current human encounter and how to accept or leave
/purchase offer:jerky Spend Gold or Amber on a human market offer
/leaderboard Rank bears by completed hunts
/fact, /joke, /fortune, /gif, /help Fun commands and help

On Fluxer, arguments go after the command: !bear trade honey 2, !bear give trout @friend 2, or !bear encounter accept 42. Run !bear help to see the command list.

Gold and Amber

Woodland barter uses the same resources you gather, eat, and gift. Hunts and foraging can also uncover an optional encounter with a human character, but gathering and daily supplies never award currency directly.

  • Gold comes from encounters such as trading fish with the village beekeeper or helping a ranger. Spend it on smoked jerky, charms, and den goods.
  • Amber is the rarer currency. Help with a village encounter to earn it, then spend it on collectibles such as the Amber Lantern. There are no real-money purchases.

When you have no active offer, each successful hunt or forage has a 20% chance of opening a Gold encounter and a 2% chance of opening an Amber encounter. You can have one encounter open at a time. Each offer expires after 30 minutes. Use the number shown by /encounter when accepting or leaving. If you can't afford its cost, the offer stays open until it expires or you leave.

/gif uses any configured provider keys, with a keyless Giphy fallback.

Deployment

Docker

docker compose up -d --build

compose.yml reads .env and mounts a named volume for SQLite.

Nix

nix develop
bun install --frozen-lockfile
bun run start

Use nix build .#bear-bot to package the bot, or nix run . to run it with the configuration and database relative to your working directory. The flake supports Linux on x86-64 and ARM64, and macOS on Apple Silicon. If a change to bun.lock alters the production dependency tree, update the fixed-output hash in flake.nix to the value reported by nix build.

Development

bun run dev
bun run typecheck
bun run lint:check
bun test

Commands and economy rules live under src/core; the Discord and Fluxer adapters translate platform events and replies in src/platforms. CI checks the lockfile, types, lint, and tests, and builds the Docker image.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages