A cozy plant-care Discord bot built with discord.js v14. Grow plants, care for them, earn coins, buy seeds, and build your greenhouse - all inside Discord.
npm install
.env fileDISCORD_TOKEN=your_bot_token_here
npm start
npm run dev
npm test
The tests use temporary data files and do not modify the live data/plants.json file.
Invite the bot with these OAuth2 scopes:
botapplications.commandsGrant only these bot permissions:
The bot uses the Guilds Gateway Intent and does not require Message Content Intent or other privileged intents. Weather changes and freezing alerts are sent to the server system channel when available, or another text channel where the bot can send messages.
Create a Railway service from this repository. Railway will use the existing npm start script (node index.js); this bot is a worker and does not need an HTTP port.
Add this Railway variable:
DISCORD_TOKEN=your_bot_token_here
Slash commands do not require the privileged Message Content Intent. Global slash commands can take time to appear in Discord. For instant updates in a test server, also add its server ID as DISCORD_GUILD_ID:
DISCORD_GUILD_ID=your_discord_server_id
The current test server ID is 1538194623179259914.
The bot stores game data in data/plants.json locally and keeps a recovery copy in data/plants.json.bak after successful saves. These live data files are intentionally ignored by Git so player accounts are not committed or exposed. Railway’s local filesystem is temporary, so add a Railway Volume mounted at /data and set PLANT_DATA_PATH=/data/plants.json if plant and account progress must survive redeploys or restarts. Without a volume, the bot still runs but local game data can be lost when the service is recreated.
Sproutly-Bot follows Discord’s requirements for verified applications.
All commands are Discord slash commands and must be used inside a server.
/commands - Lists all available commands/info - Shows items, weather effects, and seasonal information/inventory - Shows coins, seeds, fertilizer, and items/daily - Claims daily coins and builds a streak/stats - Shows your plant and player stats/stats user:<member> - Shows another member’s stats/badges - Shows your achievements and badges/badges user:<member> - Shows another member’s achievements/leaderboard - Shows the server leaderboard/leaderboard sort:<level|coins|rareblooms|achievements> - Selects a leaderboard category/reset - Explains account reset/reset confirm:Confirm - Resets plant, coins, seeds, and streak/plant - Lists your owned seeds/plant species:<species> - Creates your plant in the server greenhouse/name plant_name:<new name> - Gives your plant a custom name/garden - Shows all users’ plants in the shared greenhouse/water - Waters your plant; watering has a one-hour cooldown/sunlight - Gives your plant its daily sunlight/fertilize type:<basic|premium> - Uses basic or premium fertilizer/use item:<item> - Uses an item from your inventory/nutrient - Uses a Nutrient Pack to improve plant health by up to 20 points/heatlamp - Uses a Heatlamp to protect your plant from Snowy weather for 24 hours/weather - Checks and refreshes live weather in Tampere, FinlandHydration decreases by 20 points every 24 hours without watering. Health is calculated from hydration, care, item effects, and species or weather bonuses, capped between 0 and 100.
Tampere weather is refreshed automatically every hour for each server. /weather can still be used to refresh it immediately.
Weather maps to: Sunny, Rainy, Cloudy, Windy, Thunderstorm, Foggy, Snowy, Rainbow Weather, Aurora Weather, Meteor Shower, Solar Flare, Frost Night
Snowy weather causes ❄️ Freezing and -8 health per hour unless protected by /heatlamp.
/shop - View seed, fertilizer, Nutrient Pack, and Heatlamp catalog/shop action:buy_item item:<item> - Buy a fertilizer or shop item/shop action:buy_seed seed:<seed> - Buy a seed/sell - Sell your plant for coins based on quality, rarity, and careShop items are seasonal where indicated. Use /info to view the current catalog and effects.
Plants advance one stage every 30 minutes:
fern, cactus, orchid, rose, tulip, lavender, pine, sunflower, bamboo, bonsai, moonflower
Commands live in the commands folder.
Each command module exports:
module.exports = {
name: "hello",
description: "Replies with hello.",
async execute(message, args) {
await message.reply("Hello!");
}
};
Sproutly-Bot is a plant-care game designed for Discord communities. Users grow plants, earn coins, buy seeds, and interact with live Tampere weather.