Browse Source

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

boot
main
Ave Ozkal 3 years ago
parent
commit
03cdf7cf3b
No known key found for this signature in database GPG Key ID: 9356ABAA42C842B
  1. 4
      .gitignore
  2. 11
      Robocop.py
  3. 1
      data/restrictions.json
  4. 1
      data/warnsv2.json

4
.gitignore

@ -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
Robocop.py

@ -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)

1
data/restrictions.json

@ -1 +0,0 @@
{}

1
data/warnsv2.json

@ -1 +0,0 @@
{}
Loading…
Cancel
Save