This commit is contained in:
Lukian LEIZOUR 2023-01-31 13:51:06 +01:00
parent c96c7142d3
commit 285650befe

16
app.js
View file

@ -122,7 +122,13 @@ client.on('ready', () => {
}); });
client.on('messageCreate', async msg => { client.on('messageCreate', async msg => {
if (msg.content.startsWith('/q')) { if (msg.content.startsWith('/github')) {
console.log('[Discord] Sent github link')
addToLogs('[Discord] Sent github link')
msg.reply('Link of the Gihhub repository :\n -https://github.com/Ninja-Jambon/chaise_bot')
}
else if (msg.content.startsWith('/q')) {
answerQuestion(msg.content.slice(+3)).then((res) => { answerQuestion(msg.content.slice(+3)).then((res) => {
console.log('[Discord] Sent answer to : ' + msg.content.slice(+3)); console.log('[Discord] Sent answer to : ' + msg.content.slice(+3));
addToLogs('[Discord] Sent answer to : ' + msg.content.slice(+3)); addToLogs('[Discord] Sent answer to : ' + msg.content.slice(+3));
@ -138,7 +144,7 @@ client.on('messageCreate', async msg => {
msg.reply('Generating the answer...'); msg.reply('Generating the answer...');
} }
if (msg.content.startsWith('/g')) { else if (msg.content.startsWith('/g')) {
generateImage(msg.content.slice(+3)).then((res) => { generateImage(msg.content.slice(+3)).then((res) => {
console.log('[Discord] Sent image to : ' + msg.content.slice(+3)); console.log('[Discord] Sent image to : ' + msg.content.slice(+3));
addToLogs('[Discord] Sent image to : ' + msg.content.slice(+3)); addToLogs('[Discord] Sent image to : ' + msg.content.slice(+3));
@ -153,12 +159,6 @@ client.on('messageCreate', async msg => {
addToLogs('[Discord] Generating image to : ' + msg.content.slice(+3)); addToLogs('[Discord] Generating image to : ' + msg.content.slice(+3));
msg.reply('Generating the image...'); msg.reply('Generating the image...');
} }
else if (msg.content.startsWith('/github')) {
console.log('[Discord] Sent github link')
addToLogs('[Discord] Sent github link')
msg.reply('Link of the Gihhub repository :\n -https://github.com/Ninja-Jambon/chaise_bot')
}
}); });
//bot launch //bot launch