Back to projects

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.

Commands

Cosmo's commands are split into three focused categories. Type /help in your server to see the full list.

Fun

CommandDescription
/memeFetches a randomized post from r/memes
/roastRoasts a mentioned user with a randomly selected line
/adviceReturns a random piece of advice (often chaotic)
/8ballAnswers a yes/no question with a randomized response
/hackFake-hacks a user with a dramatic terminal readout
/killSends a mock action against a mentioned user
/animalPulls a random animal picture

Games

CommandDescription
/triviaAsks a randomized trivia question - first correct answer wins

Information

CommandDescription
/animeSearches for an anime by name and returns key details
/mangaLooks up a manga series
/pokemonReturns stats and info for a given Pokémon
/defineFetches the dictionary definition of a word

Tech Stack

ToolRole
TypeScriptPrimary language
Node.jsJavaScript runtime (V8)
Discord.jsDiscord API client and slash-command handler
AxiosHTTP client for external API calls
dotenvEnvironment variable management
PrettierCode formatter
nodemonAuto-restart during development
ts-nodeRun TypeScript directly without a compile step
DockerContainerised deployment

Local Setup

Clone the repository

git clone https://github.com/cosmo-app-labs/discord-app.git
cd discord-app

Install dependencies

npm install

Configure environment variables

Copy the example file and fill in your Discord bot token and any external API keys.

cp .env.example .env

Start the development server

nodemon watches for changes; ts-node compiles on the fly.

npm run dev

Explore 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.