This commit is contained in:
Lukian LEIZOUR 2023-03-05 01:09:14 +01:00
parent 1308673174
commit df30871629
11 changed files with 14 additions and 12 deletions

5
app.js
View file

@ -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", {});

View file

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

View file

@ -1,2 +0,0 @@
--> error : Error: Request failed with status code 401
--> res : undefined

View file

View file

@ -1,6 +0,0 @@
This is the opanAI help message :
list of opanAI commands :
-`/g <query>` (generate an image with DALL-E with your query)
-`/q <query>` (generate an answer for your question)

View file

@ -0,0 +1,11 @@
This is the opanAI help message :
list of opanAI commands :
-`/g <query>` (generate an image with DALL-E with your query)
-`/q <query>` (generate an answer for your question)
-`/addconv <convName>` (add a new conversation to the database)
-`/delconv <convName>` (delete a conversation from the database)
-`/lc` (display all the conversations that are into the database)
-`/displayconv <convName>` (display a conversation)
-`/addmsg <convName> - <message>` (send a new message to a conversation)