Browse Source

Get rid of data folder on git, add it to gitignore, gen files needed at

boot
main
Ave Ozkal 2 years ago
parent
commit
03cdf7cf3b
No known key found for this signature in database GPG Key ID: 9356ABAA42C842B
4 changed files with 13 additions and 4 deletions
  1. +2
    -2
      .gitignore
  2. +11
    -0
      Robocop.py
  3. +0
    -1
      data/restrictions.json
  4. +0
    -1
      data/warnsv2.json

+ 2
- 2
.gitignore View File

@ -100,5 +100,5 @@ files/*
priv-*
config.py
# Prevent new versions of this from being committed
data/warnsv2.json
# Prevent data files from being committed
data/

+ 11
- 0
Robocop.py View File

@ -167,4 +167,15 @@ async def on_message(message):
ctx = await bot.get_context(message)
await bot.invoke(ctx)
if not os.path.exists("data"):
os.makedirs("data")
wanted_jsons = ["data/restrictions.json",
"data/warnsv2.json"]
for wanted_json in wanted_jsons:
if not os.path.exists(wanted_json):
with open(wanted_json, "w") as f:
f.write("{}")
bot.run(config.token, bot=True, reconnect=True)

+ 0
- 1
data/restrictions.json View File

@ -1 +0,0 @@
{}

+ 0
- 1
data/warnsv2.json View File

@ -1 +0,0 @@
{}

Loading…
Cancel
Save