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