bugfixes; touching a 5 month old projects code was n ot a good idea
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,5 +27,6 @@ wheels/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*.db
|
||||
|
||||
*.log
|
||||
|
||||
@@ -83,6 +83,9 @@ class FunchosaParser(commands.Cog):
|
||||
async def cog_load(self):
|
||||
await self.db.init_db()
|
||||
logger.info("FunchosaParser initialized")
|
||||
asyncio.ensure_future(self._startup())
|
||||
|
||||
async def _startup(self):
|
||||
await self.bot.wait_until_ready()
|
||||
await self.auto_parse_on_startup()
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ load_dotenv()
|
||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||
|
||||
CHANNEL_ID = 1454107749028855971 # roles channel
|
||||
roles_message_id = 1454128857102680187
|
||||
FUNCHOSA_CHANNEL_ID = 1379127661095551048
|
||||
|
||||
REACTION_ROLES = {
|
||||
|
||||
BIN
data/funchosa.db
BIN
data/funchosa.db
Binary file not shown.
1
data/role_message_id.json
Normal file
1
data/role_message_id.json
Normal file
@@ -0,0 +1 @@
|
||||
{"message_id": 1454128857102680187}
|
||||
@@ -1,15 +1,16 @@
|
||||
import json
|
||||
import os
|
||||
from config import roles_message_id
|
||||
|
||||
DATA_FILE = 'data/role_message_id.json'
|
||||
|
||||
def save_message_id(message_id):
|
||||
os.makedirs('data', exist_ok=True)
|
||||
with open(roles_message_id, 'w') as f:
|
||||
with open(DATA_FILE, 'w') as f:
|
||||
json.dump({'message_id': message_id}, f)
|
||||
|
||||
def load_message_id():
|
||||
try:
|
||||
with open(roles_message_id, 'r') as f:
|
||||
with open(DATA_FILE, 'r') as f:
|
||||
data = json.load(f)
|
||||
return data.get('message_id')
|
||||
except FileNotFoundError:
|
||||
|
||||
Reference in New Issue
Block a user