commit
This commit is contained in:
parent
1e6c425444
commit
aab02829cf
2 changed files with 11 additions and 13 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
tests.js
|
20
app.js
20
app.js
|
@ -13,16 +13,7 @@ const { generateImage, answerQuestion } = require('./libs/openAi');
|
||||||
//bot initialization
|
//bot initialization
|
||||||
const bot = new Telegraf(process.env.TELEGRAM);
|
const bot = new Telegraf(process.env.TELEGRAM);
|
||||||
|
|
||||||
const client = new discord.Client({
|
const client = new discord.Client({intents: 3276799});
|
||||||
intents: [
|
|
||||||
discord.GatewayIntentBits.Guilds,
|
|
||||||
discord.GatewayIntentBits.GuildMessages,
|
|
||||||
discord.GatewayIntentBits.MessageContent,
|
|
||||||
discord.GatewayIntentBits.GuildMembers,
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
client.login(process.env.DISCORD);
|
|
||||||
|
|
||||||
//Telegram commands
|
//Telegram commands
|
||||||
bot.command('start', ctx => {
|
bot.command('start', ctx => {
|
||||||
|
@ -108,9 +99,14 @@ client.on('ready', () => {
|
||||||
console.log(`Logged in as ${client.user.tag}!`);
|
console.log(`Logged in as ${client.user.tag}!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('message', msg => {
|
client.on('messageCreate', msg => {
|
||||||
console.log(msg);
|
console.log(msg.content);
|
||||||
|
if (msg.content === 'ping') {
|
||||||
|
msg.reply('Pong!');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//bot launch
|
//bot launch
|
||||||
bot.launch()
|
bot.launch()
|
||||||
|
|
||||||
|
client.login(process.env.DISCORD);
|
Loading…
Add table
Add a link
Reference in a new issue