commit
This commit is contained in:
parent
1308673174
commit
df30871629
11 changed files with 14 additions and 12 deletions
5
app.js
5
app.js
|
@ -6,8 +6,7 @@ const fs = require('fs');
|
||||||
//Importing other files
|
//Importing other files
|
||||||
const { getJoke } = require('./libs/dadJokes');
|
const { getJoke } = require('./libs/dadJokes');
|
||||||
const { rtag, r34 } = require('./libs/rule34');
|
const { rtag, r34 } = require('./libs/rule34');
|
||||||
const { addToLogs, isTrue, image_search, getHelp } = require('./libs/botTools');
|
const { addToLogs, isTrue, getHelp } = require('./libs/botTools');
|
||||||
const { rockPaperScissorsAgainstBot } = require('./libs/games');
|
|
||||||
const { generateImage, answerQuestion, sendConv } = require('./libs/openAi');
|
const { generateImage, answerQuestion, sendConv } = require('./libs/openAi');
|
||||||
const { addUserToDb, incrementQuota, usersInDb, getQuota, addConv, delConv, getConvs, addMessage, getMessages } = require('./libs/mysql');
|
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) != '') {
|
if (ctx.message.text.slice(+6) != '') {
|
||||||
getHelp(ctx.message.text.slice(+6), ctx, bot);
|
getHelp(ctx.message.text.slice(+6), ctx, bot);
|
||||||
} else {
|
} else {
|
||||||
fs.readFile('./src/helps/default.txt', 'utf8', (err, data) => {
|
fs.readFile('./src/telegram_helps/default.txt', 'utf8', (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
bot.telegram.sendMessage(ctx.chat.id, "Something went wrong", {});
|
bot.telegram.sendMessage(ctx.chat.id, "Something went wrong", {});
|
||||||
|
|
|
@ -55,7 +55,7 @@ function addToLogs(message) {
|
||||||
|
|
||||||
function getHelp(commandName, ctx, bot) {
|
function getHelp(commandName, ctx, bot) {
|
||||||
const commands = [ 'images', 'games', 'r34', 'openai', 'tools' ];
|
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)) {
|
if (commands.includes(commandName)) {
|
||||||
fs.readFile(commandsPaths[commandName], 'utf8', (err, data) => {
|
fs.readFile(commandsPaths[commandName], 'utf8', (err, data) => {
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
--> error : Error: Request failed with status code 401
|
|
||||||
--> res : undefined
|
|
0
src/discord_helps/openAi.txt
Normal file
0
src/discord_helps/openAi.txt
Normal 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)
|
|
11
src/telegram_helps/openAI.txt
Normal file
11
src/telegram_helps/openAI.txt
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue