mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
parent
418dc41126
commit
7e5c4031c0
8 changed files with 67 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from discord.ext import commands, ipc
|
||||
from settings import HOST_IPC
|
||||
from startup.init_files import check_all
|
||||
import os
|
||||
|
||||
|
||||
|
|
@ -22,8 +23,12 @@ class Didier(commands.Bot):
|
|||
# Remove default help command
|
||||
self.remove_command("help")
|
||||
|
||||
# Load all extensions
|
||||
self.init_extensions()
|
||||
|
||||
# Check missing files
|
||||
check_all()
|
||||
|
||||
def init_extensions(self):
|
||||
# Load initial extensions
|
||||
for ext in self._preload:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
import json
|
||||
from os import path
|
||||
|
||||
|
||||
def check_all():
|
||||
pass
|
||||
files = ["hangman", "lastTasks", "locked", "lost", "stats", "ufora_notifications"]
|
||||
|
||||
for f in files:
|
||||
if not path.isfile(path.join(f"files/{f}.json")):
|
||||
with open(f"files/{f}.json", "w+") as new_file, open(f"files/default/{f}.json", "r") as default:
|
||||
content = json.load(default)
|
||||
json.dump(content, new_file)
|
||||
print(f"Created missing file: files/{f}.json")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue