diff --git a/README b/README new file mode 100644 index 0000000..9e96217 --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +Ari +> a discord music bot + +Ari is a simple music bot that communicates through reactions. You can +click the :play: reaction it adds to messages with youtube videos or +audio attachments to play its contents. + +When Ari fails to play a song, it adds a :download_error: reaction to the +message. You can click the reaction to get details on which songs Ari wasn't +able to play. + +It supports these commands: +`/skip ` - skips the number of songs. The number is optional + and defaults to 1. +`/stop` - tells Ari to disconnect. + + +To run your own Ari instance clone this repository (link in the header), +make sure you have docker and docker-compose installed, then fill in +`BOT_TOKEN` in docker-compose.yml, and run the compose file. diff --git a/ari/bot.py b/ari/bot.py index 18e4504..8ce0d27 100644 --- a/ari/bot.py +++ b/ari/bot.py @@ -6,7 +6,7 @@ from discord import app_commands from .player import Player -from .constants import BAINS_POSIT_NOTE, MUSIC_CACHE, Emoji +from .constants import CACHE_SIZE, MUSIC_CACHE, Emoji from .messages import MessageHandler from .cache import Cache @@ -25,7 +25,7 @@ class Bot(discord.Client): super().__init__(intents=intents) self.tree = app_commands.CommandTree(self) self.message_handler = MessageHandler(self) - self.music_cache = Cache(self.http, MUSIC_CACHE, max_size=300000000) + self.music_cache = Cache(self.http, MUSIC_CACHE, max_size=CACHE_SIZE) self.players: Dict[int, Player] = {} async def setup_hook(self) -> None: diff --git a/ari/constants.py b/ari/constants.py index 14f558d..21b0e98 100644 --- a/ari/constants.py +++ b/ari/constants.py @@ -1,8 +1,5 @@ import os from typing import NamedTuple -import discord - -BAINS_POSIT_NOTE = discord.Object(id=630144683359862814) class Emoji(NamedTuple): @@ -15,3 +12,4 @@ class Emoji(NamedTuple): PRELOAD = bool(int(os.getenv("PRELOAD", "1"))) MUSIC_CACHE = os.getenv("MUSIC_CACHE", "cache") BOT_TOKEN = os.getenv("BOT_TOKEN", "invalid") +CACHE_SIZE = int(os.getenv("CACHE_SIZE", "300000000")) diff --git a/docker-compose.yml b/docker-compose.yml index 6f0bb2f..135bc39 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,4 +5,11 @@ services: build: . environment: BOT_TOKEN: "" + # specify a cache dir + # MUSIC_CACHE: "cache" + # preload music in queue (disable if you have slow internet) + # PRELOAD: "1" + # max cache size in bytes + # CACHE_SIZE: 300000000 + tty: true