Skip to content

MMadmer/MemesisBot

Repository files navigation

MemesisBot

image

MemeBot is a self-hosted Discord bot that posts memes from a public source on a schedule.

It is built for simple setup:

  • configure everything from Discord slash commands
  • no local media storage
  • duplicate protection before download
  • supports public folders and direct media links

Before You Start

You need:

  • a Discord server where you can manage bots and channels
  • a Discord application with a bot token
  • the bot invited with bot and applications.commands scopes
  • channel permissions to Send Messages, Attach Files, and Use Application Commands

For the easiest setup, use Docker:

  • Docker
  • Docker Compose

For a local run instead of Docker:

  • Go 1.26+

Quick Start

1. Create your Discord bot

If you do not already have one:

  1. Open the Discord Developer Portal
  2. Create a new application
  3. Open the Bot tab and create a bot user
  4. Copy the bot token
  5. Open OAuth2 -> URL Generator
  6. Select the bot and applications.commands scopes
  7. Invite the bot to your server

2. Create your .env file

Copy .env.example to .env and set your token:

BOT_TOKEN=your-bot-token

That is the only required environment variable.

3. Build and start the bot

On Windows:

scripts\build-docker.bat
docker compose up -d

On Linux:

./scripts/build-docker.sh
docker compose up -d

For a local run without Docker:

go run ./cmd/memebot

First Setup In Discord

After the bot comes online, configure it from your server with these slash commands:

  • /set-channel - choose where memes will be posted
  • /set-timeout - set how often the bot posts a meme
  • /set-source - set the source URL for memes
  • /stop - stop posting without deleting saved settings
  • /status - show the current bot state

/set-timeout format

The command accepts up to 3 numbers separated by spaces:

  • SS
  • MM SS
  • HH MM SS

Examples:

  • 30
  • 5 30
  • 1 0 0

Supported Sources

/set-source currently supports:

  • direct media URLs
  • public Google Drive folders
  • public Yandex Disk folders
  • generic HTML, XML, JSON, or TXT listings with file links

For Google Drive and Yandex Disk, nested folders are supported.

Supported media formats include common Discord-previewable files such as:

  • mp4
  • gif
  • png
  • jpg
  • jpeg
  • webp
  • webm
  • mov

Archive links are rejected on purpose.

Data Folder

By default the bot stores its state in:

data on Windows
/data on Linux

Set MEMBOT_DATA_DIR to override that path.

The folder is created automatically if it does not exist.

What is stored there:

  • saved bot settings
  • sent history for duplicate prevention
  • source catalog cache

The media files themselves are not stored on disk.

With Docker Compose, ./data from the repository is mounted into ${MEMBOT_DATA_DIR:-/data} inside the container.

Notes

  • The bot works only inside Discord servers, not in direct messages
  • Configuration commands are admin-only
  • Docker Compose is the recommended production setup
  • Extra optional settings are described in .env.example

License

See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages