reorg to make better use of volumes
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
__pycache__
|
||||
.env
|
||||
src/.env
|
||||
.idea
|
||||
.ipynb_checkpoints
|
||||
discord.py
|
||||
|
||||
@@ -11,7 +11,6 @@ RUN pip install nextcord
|
||||
|
||||
RUN pip install beautifulsoup4 requests lxml
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./ ./
|
||||
WORKDIR /usr/app/src
|
||||
|
||||
CMD [ "python", "main.py" ]
|
||||
|
||||
@@ -4,8 +4,13 @@ services:
|
||||
container_name: kwaylon
|
||||
image: kwaylon:latest
|
||||
build: ./
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
restart: unless-stopped
|
||||
- /mnt/dietpi_userdata/kwaylon/src:/usr/app/src
|
||||
- /mnt/dietpi_userdata/kwaylon/data:/usr/app/data
|
||||
# - type: bind
|
||||
# source: /mnt/dietpi_userdata/kwaylon/messages.db
|
||||
# target: /usr/src/app/messages.db
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from .jokes import Joke, GifJoke
|
||||
from .kwaylon import Kwaylon
|
||||
from .reactions import ReactionData
|
||||
from .jokes import Joke, GifJoke
|
||||
@@ -7,8 +7,7 @@ from typing import List
|
||||
|
||||
import pandas as pd
|
||||
from nextcord import Client, Message, TextChannel
|
||||
from nextcord import Emoji
|
||||
from nextcord import RawReactionActionEvent
|
||||
from nextcord import RawReactionActionEvent, Emoji
|
||||
from nextcord import utils
|
||||
|
||||
from . import jokes
|
||||
@@ -20,10 +19,12 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Kwaylon(Client):
|
||||
db_path: Path = Path('./messages.db')
|
||||
# db_path: Path = Path(r'../data/messages.db')
|
||||
|
||||
def __init__(self, limit: int = 5000, days: int = 30, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.db_path = Path.cwd().parents[0] / 'data' / 'messages.db'
|
||||
|
||||
self.limit, self.days = limit, days
|
||||
self.jokes = list(jokes.collect_jokes())
|
||||
self.lock = asyncio.Lock()
|
||||
Reference in New Issue
Block a user