melka-devs.js
Version:
Normal şekilde bot yapmak istiyorsanız bu modülü kullanabilirsiniz.
24 lines (21 loc) • 788 B
JavaScript
const { Client } = require('discord.js');
const client = new Client();
const mongoose = require('mongoose');
const ghost = require('ghost-dev-console');
class Bot {
static async mongo(url) {
if (!url) return ghost.hata('HATA: Mongo bağlantısı yapmak için bir URL girmen gerek.')
mongoose.connect(url, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
mongoose.connection.on('open', () => {
ghost.yesil('BAŞARI: Mongo bağlandı, URL doğru.');
});
}
static async bağlan(token) {
if (!token) return ghost.hata('HATA: Eğer boşluğa bir bot jetonu girmez isen bot bağlanmaz!')
client.login(token).then(() => { ghost.yesil('BAŞARI: Boşluğa girmiş olduğun bot jetonu doğru, bot bağlandı.') })
}
}
module.exports = Bot;