Cosmo - A Multipurpose Discord Bot
A multipurpose Discord bot packed with commands for fun activities, games, memes, anime, images, and more. Built with TypeScript and Discord.js.
Cosmo is a versatile, open-source Discord bot that transforms server engagement through entertainment, information, and interactivity - all accessible via intuitive slash commands. Written entirely in TypeScript on top of Discord.js, it's modular, Dockerized, and continuously updated based on community feedback.
Try it now
Cosmo is live and ready to invite. Click Add to Server below or explore the source on GitHub.
Add to Server
Invite Cosmo to your Discord server in one click.
View on GitHub
Browse the source code, open issues, or submit a pull request.
Commands
Cosmo's commands are split into three focused categories. Type /help in your server to see the full list.
Fun
| Command | Description |
|---|---|
/meme | Fetches a randomized post from r/memes |
/roast | Roasts a mentioned user with a randomly selected line |
/advice | Returns a random piece of advice (often chaotic) |
/8ball | Answers a yes/no question with a randomized response |
/hack | Fake-hacks a user with a dramatic terminal readout |
/kill | Sends a mock action against a mentioned user |
/animal | Pulls a random animal picture |
Games
| Command | Description |
|---|---|
/trivia | Asks a randomized trivia question - first correct answer wins |
Information
| Command | Description |
|---|---|
/anime | Searches for an anime by name and returns key details |
/manga | Looks up a manga series |
/pokemon | Returns stats and info for a given Pokémon |
/define | Fetches the dictionary definition of a word |
Tech Stack
| Tool | Role |
|---|---|
| TypeScript | Primary language |
| Node.js | JavaScript runtime (V8) |
| Discord.js | Discord API client and slash-command handler |
| Axios | HTTP client for external API calls |
| dotenv | Environment variable management |
| Prettier | Code formatter |
| nodemon | Auto-restart during development |
| ts-node | Run TypeScript directly without a compile step |
| Docker | Containerised deployment |
Local Setup
Clone the repository
git clone https://github.com/cosmo-app-labs/discord-app.git
cd discord-appInstall dependencies
npm installConfigure environment variables
Copy the example file and fill in your Discord bot token and any external API keys.
cp .env.example .envStart the development server
nodemon watches for changes; ts-node compiles on the fly.
npm run devExplore commands
Type /help in your Discord server to see the full command list.
Prerequisites
You'll need Node.js installed locally, a Discord Bot Token from the Developer Portal, and a test server with the appropriate bot permissions configured.