From df308716290b9ee87b6a9414f911f16825e6c451 Mon Sep 17 00:00:00 2001 From: Lukian LEIZOUR Date: Sun, 5 Mar 2023 01:09:14 +0100 Subject: [PATCH] commit --- app.js | 5 ++--- libs/botTools.js | 2 +- logs/logs.txt | 2 -- src/discord_helps/openAi.txt | 0 src/helps/openAI.txt | 6 ------ src/{helps => telegram_helps}/default.txt | 0 src/{helps => telegram_helps}/games.txt | 0 src/{helps => telegram_helps}/images.txt | 0 src/telegram_helps/openAI.txt | 11 +++++++++++ src/{helps => telegram_helps}/r34.txt | 0 src/{helps => telegram_helps}/tools.txt | 0 11 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 src/discord_helps/openAi.txt delete mode 100644 src/helps/openAI.txt rename src/{helps => telegram_helps}/default.txt (100%) rename src/{helps => telegram_helps}/games.txt (100%) rename src/{helps => telegram_helps}/images.txt (100%) create mode 100644 src/telegram_helps/openAI.txt rename src/{helps => telegram_helps}/r34.txt (100%) rename src/{helps => telegram_helps}/tools.txt (100%) diff --git a/app.js b/app.js index 63bc5f4..10db0db 100644 --- a/app.js +++ b/app.js @@ -6,8 +6,7 @@ const fs = require('fs'); //Importing other files const { getJoke } = require('./libs/dadJokes'); const { rtag, r34 } = require('./libs/rule34'); -const { addToLogs, isTrue, image_search, getHelp } = require('./libs/botTools'); -const { rockPaperScissorsAgainstBot } = require('./libs/games'); +const { addToLogs, isTrue, getHelp } = require('./libs/botTools'); const { generateImage, answerQuestion, sendConv } = require('./libs/openAi'); const { addUserToDb, incrementQuota, usersInDb, getQuota, addConv, delConv, getConvs, addMessage, getMessages } = require('./libs/mysql'); @@ -26,7 +25,7 @@ bot.command('help', ctx => { if (ctx.message.text.slice(+6) != '') { getHelp(ctx.message.text.slice(+6), ctx, bot); } else { - fs.readFile('./src/helps/default.txt', 'utf8', (err, data) => { + fs.readFile('./src/telegram_helps/default.txt', 'utf8', (err, data) => { if (err) { console.log(err); bot.telegram.sendMessage(ctx.chat.id, "Something went wrong", {}); diff --git a/libs/botTools.js b/libs/botTools.js index 0f801b9..35ecb92 100644 --- a/libs/botTools.js +++ b/libs/botTools.js @@ -55,7 +55,7 @@ function addToLogs(message) { function getHelp(commandName, ctx, bot) { const commands = [ 'images', 'games', 'r34', 'openai', 'tools' ]; - const commandsPaths = { 'images': './src/helps/images.txt', 'games': './src/helps/games.txt', 'r34': './src/helps/r34.txt', 'openai': './src/helps/openAI.txt', 'tools': './src/helps/tools.txt' }; + const commandsPaths = { 'images': './src/telegram_helps/images.txt', 'games': './src/telegram_helps/games.txt', 'r34': './src/telegram_helps/r34.txt', 'openai': './src/telegram_helps/openAI.txt', 'tools': './src/telegram_helps/tools.txt' }; if (commands.includes(commandName)) { fs.readFile(commandsPaths[commandName], 'utf8', (err, data) => { diff --git a/logs/logs.txt b/logs/logs.txt index 82e4aab..e69de29 100644 --- a/logs/logs.txt +++ b/logs/logs.txt @@ -1,2 +0,0 @@ ---> error : Error: Request failed with status code 401 ---> res : undefined diff --git a/src/discord_helps/openAi.txt b/src/discord_helps/openAi.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/helps/openAI.txt b/src/helps/openAI.txt deleted file mode 100644 index ef29674..0000000 --- a/src/helps/openAI.txt +++ /dev/null @@ -1,6 +0,0 @@ -This is the opanAI help message : - -list of opanAI commands : - - -`/g ` (generate an image with DALL-E with your query) - -`/q ` (generate an answer for your question) \ No newline at end of file diff --git a/src/helps/default.txt b/src/telegram_helps/default.txt similarity index 100% rename from src/helps/default.txt rename to src/telegram_helps/default.txt diff --git a/src/helps/games.txt b/src/telegram_helps/games.txt similarity index 100% rename from src/helps/games.txt rename to src/telegram_helps/games.txt diff --git a/src/helps/images.txt b/src/telegram_helps/images.txt similarity index 100% rename from src/helps/images.txt rename to src/telegram_helps/images.txt diff --git a/src/telegram_helps/openAI.txt b/src/telegram_helps/openAI.txt new file mode 100644 index 0000000..a0c040c --- /dev/null +++ b/src/telegram_helps/openAI.txt @@ -0,0 +1,11 @@ +This is the opanAI help message : + +list of opanAI commands : + + -`/g ` (generate an image with DALL-E with your query) + -`/q ` (generate an answer for your question) + -`/addconv ` (add a new conversation to the database) + -`/delconv ` (delete a conversation from the database) + -`/lc` (display all the conversations that are into the database) + -`/displayconv ` (display a conversation) + -`/addmsg - ` (send a new message to a conversation) \ No newline at end of file diff --git a/src/helps/r34.txt b/src/telegram_helps/r34.txt similarity index 100% rename from src/helps/r34.txt rename to src/telegram_helps/r34.txt diff --git a/src/helps/tools.txt b/src/telegram_helps/tools.txt similarity index 100% rename from src/helps/tools.txt rename to src/telegram_helps/tools.txt