Skip to content

piewhat/piebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PieBot

A simple Discord bot written in Rust using Twilight. It provides music playback via Lavalink, image searching, quotes and wisdom commands.

Features

  • Music Playback: Play audio from URLs, file uploads, or searches. Supports queuing, skipping, pausing, and volume control.
  • Wisdom & Quotes: Save and retrieve text-based wisdom or audio-based quotes.
  • Image Search: Integrated Google Image Search.
  • Starboard: Posts star reacted messages in the starboard text channel.

Prerequisites

  • Rust
  • PostgreSQL
  • Lavalink server
  • Discord Bot Token and Application ID
  • Google Custom Search API Key and CX (for image search)

Environment Variables

Create a .env file in the root directory with the following variables:

  • DISCORD_TOKEN: Your Discord bot token.
  • DISCORD_APPLICATION_ID: Your Discord application ID.
  • LAVALINK_ADDR: The address of your Lavalink node (e.g., 127.0.0.1:2333).
  • LAVALINK_AUTH: The password for your Lavalink node.
  • DATABASE_URL: PostgreSQL connection string (e.g., postgres://user:pass@localhost/db).
  • GOOGLE_API_KEY: Google Cloud API key for Custom Search.
  • GOOGLE_SEARCH_CX: Google Programmable Search Engine ID.

Use

Setup Database

You must have a PostgreSQL database running and set DATABASE_URL=postgres://user:pass@localhost/db in the .env file or sqlx can't see the database types and it won't compile.

Running the Bot

cargo run --release

Docker

docker build -t piebot .

Commands

  • /play [query|file]: Adds a track to the queue.
  • /skip: Skips the current track.
  • /pause: Toggles pause/resume.
  • /stop: Clears the queue and stops playback.
  • /volume [level]: Gets or sets the volume.
  • /wisdom [query|user]: Retrieves a piece of wisdom.
  • /quote [name]: Plays a saved audio quote.
  • /add [wisdom|quote]: Adds a new entry to the database.
  • /remove [wisdom|quote]: Removes an entry (requires ownership or admin).
  • /image [query]: Searches for an image.
  • /ping: Checks bot responsiveness.

About

Simple Discord bot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors