Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 91e1d69

Browse files
committed
updated container to use a docker volume for data
1 parent 1fc0983 commit 91e1d69

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__pycache__
2+
.github
3+
data/data.csv
4+
.env

cogs/leaderboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import csv
55

66
# get path name for csv file
7-
file_path = os.path.join(os.getcwd(), "")
7+
file_path = os.path.join(os.getcwd(), "data")
8+
file_path = os.path.join(file_path, "")
89

910
class Leaderboard(commands.Cog):
1011
def __init__(self,bot):
File renamed without changes.

docker-compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ services:
55
image: soulsender/frong-bot:latest
66
environment:
77
- TOKEN=your_token_here
8+
volumes:
9+
- /frong-data:/app/data
810
restart: unless-stopped
11+

main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
load_dotenv()
1010

11+
file_path = os.path.join(os.getcwd(), "data")
12+
csv_file = "data.csv"
13+
file_path = os.path.join(file_path, csv_file)
14+
1115
def update_csv(name, filename):
1216
updated = False
1317
with open(filename, 'r') as file:
@@ -45,7 +49,6 @@ def main():
4549
owner_id="null",
4650
)
4751

48-
csv_file = "data.csv"
4952

5053
# responses for the arch user replies
5154
responses = ["",
@@ -101,7 +104,7 @@ async def on_message(message):
101104
for word in frong_words:
102105
if word.lower() in content_lower:
103106
# increment message author frong count
104-
update_csv(str(message.author), 'data.csv')
107+
update_csv(str(message.author), file_path)
105108

106109
# send frong response
107110
await message.channel.send('frong', files=[nextcord.File('frong.png')])

0 commit comments

Comments
 (0)