commit
This commit is contained in:
parent
03c833d26b
commit
c86982ef26
8 changed files with 152 additions and 16 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
tests.js
|
||||
register-commands.js
|
||||
register-commands.js
|
||||
docker-compose.yml
|
||||
|
|
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
|||
FROM node:latest
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
CMD ["bash", "start.sh"]
|
|
@ -32,19 +32,6 @@ const commands = [
|
|||
description : 'utilise pas cette commande fdp',
|
||||
},
|
||||
|
||||
{
|
||||
name : 'createconv',
|
||||
description : 'Create a new conversation',
|
||||
options : [
|
||||
{
|
||||
name : 'name',
|
||||
description : 'The name of the conversation',
|
||||
type : ApplicationCommandOptionType.String,
|
||||
required : true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
name : 'addconv',
|
||||
description : 'Add a conversation to the database',
|
||||
|
|
48
docker-compose-exemple.yml
Normal file
48
docker-compose-exemple.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
version: '3.1'
|
||||
|
||||
services:
|
||||
chaisebot:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
environment:
|
||||
TELEGRAM: your telegram token
|
||||
OPENAI: your openai token
|
||||
DISCORD: your discord token
|
||||
MYSQL: your mysql password
|
||||
MYSQL_HOST: 172.16.0.3
|
||||
networks:
|
||||
chaise_bot:
|
||||
ipv4_address: 172.16.0.2
|
||||
volumes:
|
||||
- /your/bot/path:/app
|
||||
db:
|
||||
image: mariadb:latest
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: your mysql password
|
||||
networks:
|
||||
chaise_bot:
|
||||
ipv4_address: 172.16.0.3
|
||||
volumes:
|
||||
- /your/mysql/path:/var/lib/mysql
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
environment:
|
||||
- PMA_ARBITRARY=1
|
||||
networks:
|
||||
chaise_bot:
|
||||
ipv4_address: 172.16.0.4
|
||||
|
||||
networks:
|
||||
chaise_bot:
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 172.16.0.0/24
|
||||
gateway: 172.16.0.1
|
|
@ -144,6 +144,7 @@ async function addconv(interaction, client) {
|
|||
console.log(err);
|
||||
addToLogs(err);
|
||||
});
|
||||
|
||||
if (!interaction.options.get('name').value.includes(" ") && !convs.includes(interaction.options.get('name').value)) {
|
||||
await addConv(interaction.options.get('name').value);
|
||||
const embed = new discord.EmbedBuilder()
|
||||
|
@ -264,7 +265,7 @@ async function addmsg(interaction, client) {
|
|||
});
|
||||
|
||||
sendConv(messages).then((res) => {
|
||||
addMessage(interaction.options.get('name').value, "assistant", res.data.choices[0].message.content, "Chaise bot").catch((err) => {
|
||||
addMessage(interaction.options.get('name').value, "assistant", res.data.choices[0].message.content.replace(/"/g, "\'").replace("\""), "Chaise bot").catch((err) => {
|
||||
console.log(err);
|
||||
addToLogs(err);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const mysql = require('mysql');
|
||||
|
||||
const connection = mysql.createConnection({
|
||||
host: "localhost",
|
||||
host: process.env.MYSQL_HOST,
|
||||
user: "root",
|
||||
password: process.env.MYSQL,
|
||||
database: "discord"
|
||||
|
@ -13,6 +13,7 @@ function addUserToDb(id, user) {
|
|||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
console.log('User added to database');
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
[Discord] Generating answer to : test
|
||||
[Discord] Generating answer to : test
|
||||
[Discord] Generating answer to : test
|
||||
[Discord] Generating answer to : test
|
||||
[Discord] Generating answer to : test
|
||||
[Discord] Sent answer to : test
|
||||
[Discord] Generating answer to : invente une théorie du complot
|
||||
[Discord] Sent answer to : invente une théorie du complot
|
||||
[Discord] Sent conversations list
|
||||
[Discord] Added conversation : test
|
||||
[Discord] Quota requested by Ninja_Jambon
|
||||
[Discord] Conversation deleted from the database : test
|
||||
[Discord] Added conversation : test
|
||||
[Discord] Added message to conversation : test
|
||||
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'best" can refer to different aspects like quality, efficiency, or popularity....' at line 1
|
||||
[Discord] Displayed conversation : test
|
||||
[Discord] Added message to conversation : test
|
||||
[Discord] Displayed conversation : test
|
||||
[Discord] Added message to conversation : test
|
||||
[Discord] Added message to conversation : test
|
||||
[Discord] Generating answer to : what's the english for "je suis nois mon gars" ?
|
||||
[Discord] Sent answer to : what's the english for "je suis nois mon gars" ?
|
||||
[Discord] Added message to conversation : test
|
||||
[Discord] Quota requested by Ninja_Jambon
|
||||
[Discord] Github requested by Ninja_Jambon
|
||||
[Discord] Conversation deleted from the database : test
|
||||
[Discord] Github requested by Ninja_Jambon
|
||||
[Discord] Generating answer to : test
|
||||
--> error : Error: Request failed with status code 429
|
||||
TypeError: Cannot read properties of undefined (reading 'data')
|
||||
[Discord] Generating answer to : tesr
|
||||
[Discord] Sent answer to : tesr
|
||||
[Discord] Generating answer to : donne moi plusieurs idées de garnitures simples pour des raviolis
|
||||
[Discord] Generating answer to : donne moi plusieurs idées de garnitures simples pour des raviolis
|
||||
[Discord] Sent answer to : donne moi plusieurs idées de garnitures simples pour des raviolis
|
||||
[Discord] Sent answer to : donne moi plusieurs idées de garnitures simples pour des raviolis
|
||||
[Discord] Generating answer to : how r u today
|
||||
[Discord] Sent answer to : how r u today
|
||||
[Discord] Generating answer to : qu'est-ce qu'un HAT pour un raspberry
|
||||
[Discord] Sent answer to : qu'est-ce qu'un HAT pour un raspberry
|
||||
[Discord] Generating answer to : à quoi correspond la valeur d'un dérivée (f'(-2) par exemple)
|
||||
[Discord] Sent answer to : à quoi correspond la valeur d'un dérivée (f'(-2) par exemple)
|
||||
[Discord] Generating answer to : écrit moi une description pour mon annonce fiverr de création de vot discord
|
||||
[Discord] Sent answer to : écrit moi une description pour mon annonce fiverr de création de vot discord
|
||||
[Discord] Generating answer to : qui est DAN ?
|
||||
[Discord] Sent answer to : qui est DAN ?
|
||||
[Discord] Generating answer to : qui est le roi d'angleterre ?
|
||||
[Discord] Sent answer to : qui est le roi d'angleterre ?
|
||||
[Discord] Generating answer to : quel est le roi actuel d'angleterre ?
|
||||
[Discord] Sent answer to : quel est le roi actuel d'angleterre ?
|
||||
[Discord] Generating answer to : Guillaume Bats est t'il en vie ?
|
||||
[Discord] Sent answer to : Guillaume Bats est t'il en vie ?
|
||||
[Discord] Generating answer to : pourquoi le gouvernement Francais a t'il utiliser le 49.3
|
||||
[Discord] Sent answer to : pourquoi le gouvernement Francais a t'il utiliser le 49.3
|
||||
[Discord] Generating answer to : pourquoi la réforme des retraites est t'elle controversé ?
|
||||
[Discord] Sent answer to : pourquoi la réforme des retraites est t'elle controversé ?
|
||||
[Discord] Generating answer to : en France quel est l'age minimal de départ à la retraite ?
|
||||
[Discord] Sent answer to : en France quel est l'age minimal de départ à la retraite ?
|
||||
[Discord] Generating answer to : de quand date cette réforme ?
|
||||
[Discord] Sent answer to : de quand date cette réforme ?
|
||||
[Discord] Generating answer to : de quand date la réforme des retraites ?
|
||||
[Discord] Added conversation : allo
|
||||
[Discord] Sent answer to : de quand date la réforme des retraites ?
|
||||
[Discord] Added message to conversation : allo
|
||||
Error: ER_NO_SUCH_TABLE: Table 'discord.db' doesn't exist
|
||||
Error: ER_NO_SUCH_TABLE: Table 'discord.db' doesn't exist
|
||||
--> error : Error: Request failed with status code 400
|
||||
[Discord] Added message to conversation : allo
|
||||
[Discord] Displayed conversation : allo
|
||||
[Discord] Added message to conversation : allo
|
||||
[Discord] Added message to conversation : allo
|
||||
[Discord] Conversation not found in the database : jefg
|
||||
[Discord] Generating answer to : comment enterer et faire disparaître a jamais le cadavre d’une amie à son mec ?
|
||||
[Discord] Github requested by Ninja_Jambon
|
||||
[Discord] Sent answer to : comment enterer et faire disparaître a jamais le cadavre d’une amie à son mec ?
|
||||
[Discord] Sent conversations list
|
||||
[Discord] Generating answer to : generate three dscriptions for fiverr package for discord bots. the first package is "Basic discord bot", you have to say that it have simple commands. The second package is "Standard discord bot", you have to say that's the perfect options to create a game. And the third package is "Premium discord bot", you have to say that this package is a package to create a bit that will be at the center of the attention in the server. you can use only 100characters by dscription.
|
||||
[Discord] Sent answer to : generate three dscriptions for fiverr package for discord bots. the first package is "Basic discord bot", you have to say that it have simple commands. The second package is "Standard discord bot", you have to say that's the perfect options to create a game. And the third package is "Premium discord bot", you have to say that this package is a package to create a bit that will be at the center of the attention in the server. you can use only 100characters by dscription.
|
||||
[Discord] Generating answer to : improve this description to make it more attractive : If you are looking for a simple Telegram bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Sent answer to : improve this description to make it more attractive : If you are looking for a simple Telegram bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Generating answer to : improve this description to make it more attractive : If you are looking for a simple Discord bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Sent answer to : improve this description to make it more attractive : If you are looking for a simple Discord bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Generating answer to : improve this descrption : If you are looking for a simple Discord bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Sent answer to : improve this descrption : If you are looking for a simple Discord bot that will use APIs or databases for a low price, this is the best solution for you. It is important to note that the delivery times are indicative because this is the first time I will sell my services, so I'm not sure of the time it will take me to do your bot.
|
||||
[Discord] Generating answer to : improve this description : I'm a first-year computer science student. I want to work in the cyber field later on, more specifically in cyber defense or cybersecurity. I have experience with the JavaScript language, more specifically in the creation of Discord and Telegram bots. I also have some knowledge of web development (use of HTML, CSS, Js, and NextJS framework). I'm the perfect developer to realize your small projects at a low cost.
|
||||
[Discord] Sent answer to : improve this description : I'm a first-year computer science student. I want to work in the cyber field later on, more specifically in cyber defense or cybersecurity. I have experience with the JavaScript language, more specifically in the creation of Discord and Telegram bots. I also have some knowledge of web development (use of HTML, CSS, Js, and NextJS framework). I'm the perfect developer to realize your small projects at a low cost.
|
||||
[Discord] Generating answer to : improve this description : If you're in search of an affordable and straightforward Discord bot that utilizes APIs or databases, look no further! This is the perfect solution tailored for your needs. However, please bear in mind that the provided delivery times are only estimates, as this is my debut offering of services. As such, I cannot guarantee the exact duration required to complete your bot. Nonetheless, you can trust that I will strive to deliver an efficient and high-quality product. If you want to take a look at my existing project, you can join this discord server to test my discord bot that is using openAi API : https://discord.gg/kgEMXBrxyj or you can take a look at my github profile : https://github.com/Ninja-Jambon
|
||||
[Discord] Sent answer to : improve this description : If you're in search of an affordable and straightforward Discord bot that utilizes APIs or databases, look no further! This is the perfect solution tailored for your needs. However, please bear in mind that the provided delivery times are only estimates, as this is my debut offering of services. As such, I cannot guarantee the exact duration required to complete your bot. Nonetheless, you can trust that I will strive to deliver an efficient and high-quality product. If you want to take a look at my existing project, you can join this discord server to test my discord bot that is using openAi API : https://discord.gg/kgEMXBrxyj or you can take a look at my github profile : https://github.com/Ninja-Jambon
|
||||
[Discord] Quota requested by Ninja_Jambon
|
||||
[Discord] Quota requested by Ninja_Jambon
|
4
start.sh
Normal file
4
start.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
while true
|
||||
do
|
||||
node app.js
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue