Compare commits
No commits in common. "f5299b78cd3b5925d59ba2bd94f082c9dc06f71a" and "b4a60b59e88bee27bb9711b5939246bbc2b3de9c" have entirely different histories.
f5299b78cd
...
b4a60b59e8
4 changed files with 6 additions and 18 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import argparse
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
@ -13,12 +12,7 @@ from . import tasks
|
||||||
|
|
||||||
|
|
||||||
async def main() -> None:
|
async def main() -> None:
|
||||||
parser = argparse.ArgumentParser(description='Telegram chat bot')
|
with open('tg.json', 'r') as file:
|
||||||
parser.add_argument('-c', '--config', type=str, required=True,
|
|
||||||
help='Path to the JSON configuration file')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
with open(args.config, 'r') as file:
|
|
||||||
config = json.load(file)
|
config = json.load(file)
|
||||||
print('Конфигурация загружена.')
|
print('Конфигурация загружена.')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class TgDatabase(database.BasicDatabase):
|
||||||
id BIGINT NOT NULL,
|
id BIGINT NOT NULL,
|
||||||
owner_id BIGINT NOT NULL,
|
owner_id BIGINT NOT NULL,
|
||||||
api_token VARCHAR(64) NOT NULL,
|
api_token VARCHAR(64) NOT NULL,
|
||||||
ai_prompt VARCHAR(2000) DEFAULT NULL,
|
ai_prompt VARCHAR(4000) DEFAULT NULL,
|
||||||
group_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
group_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
||||||
private_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
private_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
||||||
PRIMARY KEY (id))
|
PRIMARY KEY (id))
|
||||||
|
|
@ -23,7 +23,7 @@ class TgDatabase(database.BasicDatabase):
|
||||||
active TINYINT NOT NULL DEFAULT 0,
|
active TINYINT NOT NULL DEFAULT 0,
|
||||||
rules VARCHAR(4000),
|
rules VARCHAR(4000),
|
||||||
greeting_join VARCHAR(2000),
|
greeting_join VARCHAR(2000),
|
||||||
ai_prompt VARCHAR(2000),
|
ai_prompt VARCHAR(4000),
|
||||||
PRIMARY KEY (bot_id, chat_id),
|
PRIMARY KEY (bot_id, chat_id),
|
||||||
CONSTRAINT fk_chats_bots FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE ON UPDATE CASCADE)
|
CONSTRAINT fk_chats_bots FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE ON UPDATE CASCADE)
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import argparse
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from vkbottle.bot import Bot, run_multibot
|
from vkbottle.bot import Bot, run_multibot
|
||||||
|
|
@ -13,12 +12,7 @@ from .utils import MyAPI
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Telegram chat bot')
|
with open('vk.json', 'r') as file:
|
||||||
parser.add_argument('-c', '--config', type=str, required=True,
|
|
||||||
help='Path to the JSON configuration file')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
with open(args.config, 'r') as file:
|
|
||||||
config = json.load(file)
|
config = json.load(file)
|
||||||
print('Конфигурация загружена.')
|
print('Конфигурация загружена.')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class VkDatabase(database.BasicDatabase):
|
||||||
id BIGINT NOT NULL,
|
id BIGINT NOT NULL,
|
||||||
owner_id BIGINT NOT NULL,
|
owner_id BIGINT NOT NULL,
|
||||||
api_token VARCHAR(256) NOT NULL,
|
api_token VARCHAR(256) NOT NULL,
|
||||||
ai_prompt VARCHAR(2000) DEFAULT NULL,
|
ai_prompt VARCHAR(4000) DEFAULT NULL,
|
||||||
group_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
group_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
||||||
private_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
private_chats_allowed TINYINT NOT NULL DEFAULT 1,
|
||||||
PRIMARY KEY (id))
|
PRIMARY KEY (id))
|
||||||
|
|
@ -25,7 +25,7 @@ class VkDatabase(database.BasicDatabase):
|
||||||
greeting_join VARCHAR(2000),
|
greeting_join VARCHAR(2000),
|
||||||
greeting_rejoin VARCHAR(2000),
|
greeting_rejoin VARCHAR(2000),
|
||||||
birthday_message VARCHAR(2000),
|
birthday_message VARCHAR(2000),
|
||||||
ai_prompt VARCHAR(2000),
|
ai_prompt VARCHAR(4000),
|
||||||
PRIMARY KEY (bot_id, chat_id),
|
PRIMARY KEY (bot_id, chat_id),
|
||||||
CONSTRAINT fk_chats_bots FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE ON UPDATE CASCADE)
|
CONSTRAINT fk_chats_bots FOREIGN KEY (bot_id) REFERENCES bots (id) ON DELETE CASCADE ON UPDATE CASCADE)
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue