add README; add CACHE_SIZE env var
This commit is contained in:
parent
dac5b43ba2
commit
7c8c5da5b2
4 changed files with 30 additions and 5 deletions
20
README
Normal file
20
README
Normal file
|
@ -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 <number>` - 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.
|
|
@ -6,7 +6,7 @@ from discord import app_commands
|
||||||
|
|
||||||
from .player import Player
|
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 .messages import MessageHandler
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class Bot(discord.Client):
|
||||||
super().__init__(intents=intents)
|
super().__init__(intents=intents)
|
||||||
self.tree = app_commands.CommandTree(self)
|
self.tree = app_commands.CommandTree(self)
|
||||||
self.message_handler = MessageHandler(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] = {}
|
self.players: Dict[int, Player] = {}
|
||||||
|
|
||||||
async def setup_hook(self) -> None:
|
async def setup_hook(self) -> None:
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import os
|
import os
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
import discord
|
|
||||||
|
|
||||||
BAINS_POSIT_NOTE = discord.Object(id=630144683359862814)
|
|
||||||
|
|
||||||
|
|
||||||
class Emoji(NamedTuple):
|
class Emoji(NamedTuple):
|
||||||
|
@ -15,3 +12,4 @@ class Emoji(NamedTuple):
|
||||||
PRELOAD = bool(int(os.getenv("PRELOAD", "1")))
|
PRELOAD = bool(int(os.getenv("PRELOAD", "1")))
|
||||||
MUSIC_CACHE = os.getenv("MUSIC_CACHE", "cache")
|
MUSIC_CACHE = os.getenv("MUSIC_CACHE", "cache")
|
||||||
BOT_TOKEN = os.getenv("BOT_TOKEN", "invalid")
|
BOT_TOKEN = os.getenv("BOT_TOKEN", "invalid")
|
||||||
|
CACHE_SIZE = int(os.getenv("CACHE_SIZE", "300000000"))
|
||||||
|
|
|
@ -5,4 +5,11 @@ services:
|
||||||
build: .
|
build: .
|
||||||
environment:
|
environment:
|
||||||
BOT_TOKEN: ""
|
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
|
tty: true
|
||||||
|
|
Loading…
Reference in a new issue