Skip to content

Multifunctional Discord bot that wraps several APIs for weather forecasting, image manipulation, prompt generation, emoting, perma-threads, adblocking, etc.

Notifications You must be signed in to change notification settings

dysphie/discord-nbot-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Discord] NBot

This is my own personal bot, originally written in Python, designed to exist in a single small guild with friends.

Powered by:

Typescript discord.js MongoDB OpenCage TomorrowIO Craiyon OpenAI Uberduck

Requirements

  • A server to host the JavaScript code (I use Heroku)
  • (Optional) A MongoDB database (I use Atlas)
    • Required by: Emoter, Weather, Mimic, Yeller, Reminder, Starboard
  • (Optional) An OpenCage API key
    • Required by: Weather
  • (Optional) A TomorrowIO API key (used by the Weather module)
    • Required by: Weather
  • (Optional) A Uberduck username and password (used by the Uberduck module)
    • Required by: Vocalizer
  • (Optional) An OpenAI API key (used by the Autocomplete module)
    • Required by: Autocomplete

Environment variables

  • NBOT_DISCORD_TOKEN - Your bot account's token (found here)
  • NBOT_MONGODB_URI - Your MongoDB database URI
  • NBOT_MONGODB_AES_KEY - A random secure string used to encrypt saved messages
  • NBOT_OWNER_ID - The ID of the Discord account that should have full control over the bot
  • (Optional) NBOT_OPENCAGE_API_KEY - Your OpenCage API key
  • (Optional) NBOT_TOMORROW_API_KEY - Your TomorrowIO API key
  • (Optional) NBOT_UBERDUCK_KEY - Your Uberduck username
  • (Optional) NBOT_UBERDUCK_SECRET - Your Uberduck password

Config Keys

  • weather_guild_id - ID of a guild that houses all of the emotes used by the Weather module, expected names: Unknown Clear MostlyClear PartlyCloudy MostlyCloudy Cloudy Fog LightFog Drizzle Rain LightRain HeavyRain Snow Flurries LightSnow HeavySnow FreezingDrizzle FreezingRain LightFreezingRain HeavyFreezingRain IcePellets HeavyIcePellets LightIcePellets Thunderstorm
  • emote_guild_id - ID of a guild where the bot can freely upload and delete emotes, used by the Emoter module. At least 3 free emote slots recommended, the more slots the more emotes you can pack in a single message. Excess slots are used by the cache to store recently used emotes for faster lookup
  • patchbot_redirects - JSON array used by the PatchBot module to redirect games to specific channels, e.g. "League of Legends": "893193730692108298" would redirect all League of Legends patch notes to the channel with the given ID
  • permathreads - JSON array of thread IDs that should never expire, used by the Permathreads module

Module management

All modules are disabled by default, you can manage them via commands

  • /module list - Lists all available modules
  • /module enable <module name> - Enables the given module for the current guild
  • /module disable <module name> - Disables the given module for the current guild

Emoter

Upload emotes via URL and use them without a Nitro subscription via $keyword

image -> Xl0Gjcr

Slash commands:

  • /emoter add <keyword> <url> - Uploads an emote via URL and assigns it to the given keyword
  • /emoter find <keyword> - Returns a list of emotes that lazily match the current keyword
  • /emoter random - Picks a registered emote randomly and posts it to chat
  • /emoter test - Tests whether a given keyword resolves to a valid emote
  • /emoter edit <keyword> <url> - Edits an existing emote if you are the original uploader
  • /emoter remove <keyword> - Deletes an emote if you are the original uploader

Wordle

Play multiplayer games of Wordle, with words from 4 to 10 characters

Slash commands:

  • /wordle - Starts or continues a game of Wordle
    • <length> - Length of the board
    • <starter_words> - Space-separated list of words to pre-fill the board with

image

Mimic

Allows you to mimic other users via old messages and markov chains (requires the other user has opted in)

Slash commands:

  • /mimic <user> - Posts 3 randomly generated sentences based on this user
  • /mimic_optout - Deletes all stored data pertaining to your markov model (after opting in)

PatchBot adblocker

  • Reposts PatchBot patch notes without the annoying advertisements

Permathreads

  • Creates threads that never expire, by constantly bumping them. Must list the thread IDs in config.ts

Weather

  • Posts weather information for a given location

image

Slash commands:

  • /weather <address, city or country>

Name color picker

Allows users to freely set their name color to whatever value they want

image

Slash commands

  • /namecolor <hex string | auto | none>

InspiroBot

Reminder

Create reminders that show up at a given time

Slash commands

  • /reminder <message> <days> <hours> <minutes>

Animals

Posts random cute animals!

Slash commands

  • /animal <cat|dog|lizard>

Yellers

Replies to ALL CAPS messages with previously sent ALL CAPS messages, it's very funny I promise.

Uberduck

Wraps UberduckAI's Vocalize to narrate prompts with a given voice

image

Slash commands:

  • /vocalize <voice> <prompt>

Auto completion

Wraps OpenAI's GPT-3 API to autocomplete the given prompt

image

Slash commands:

  • /complete <prompt>

Imagine

Pictures any given prompt leveraging Craiyon (formelly DALL-E mini)

image

Slash commands

  • /imagine <prompt>

Starboard

Bookmarks messages in a dedicated channel by reacting to them with "⭐"

image

Slash commands

  • (admin only) /starboard <channel> - Sets the given channel as the dedicated starboard channel

About

Multifunctional Discord bot that wraps several APIs for weather forecasting, image manipulation, prompt generation, emoting, perma-threads, adblocking, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published