mkdir if dir "config" does not exist
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
parent
53f11a4739
commit
55702b872f
|
@ -1,6 +1,5 @@
|
|||
import sqlite3
|
||||
import redis
|
||||
from pathlib import Path
|
||||
|
||||
from src import log, env
|
||||
|
||||
|
@ -62,7 +61,6 @@ else:
|
|||
|
||||
def _init(self):
|
||||
try:
|
||||
Path("config").mkdir(parents=True, exist_ok=True)
|
||||
self._conn = sqlite3.connect('config/rss.db', check_same_thread=False)
|
||||
c = self._conn.cursor()
|
||||
c.execute('''CREATE TABLE rss (name text, link text, last text)''')
|
||||
|
|
|
@ -13,6 +13,7 @@ from typing import Optional, Union
|
|||
from datetime import datetime
|
||||
from functools import wraps, partial
|
||||
from random import sample
|
||||
from pathlib import Path
|
||||
|
||||
from src import env, log
|
||||
from src.parsing import tgraph
|
||||
|
@ -33,6 +34,7 @@ ANONYMOUS_ADMIN = 1087968824
|
|||
commandParser = re_compile(r'\s')
|
||||
|
||||
# initializing bot
|
||||
Path("config").mkdir(parents=True, exist_ok=True)
|
||||
bot = None
|
||||
if not env.API_ID or not env.API_HASH:
|
||||
_use_sample_api = True
|
||||
|
|
Loading…
Reference in New Issue