1.0.2 • Published 6 years ago
cekilistr v1.0.2
Yükeleme
$ npm install --save cekilistr
Örnekler
const Discord = require("discord.js"),
giveaways = require("discord-giveaways"),
client = new Discord.Client(),
settings = {
prefix: "!",
token: "botunun tokeni"
};
client.on("ready", () => {
console.log("I'm ready !");
giveaways.launch(client, {
updateCountdownEvery: 5000,
botsCanWin: false,
ignoreIfHasPermission: [
"MANAGE_MESSAGES",
"MANAGE_GUILD",
"ADMINISTRATOR"
],
embedColor: "#FF0000",
embedColorEnd: "#000000",
reaction: "🎉",
storage: __dirname+"/giveaways.json"
});
});
client.login(settings.token);
Çekilişi başlatma.
client.on("message", (message) => {
const ms = require("ms"); // npm install ms
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "çekiliş"){
giveaways.start(message.channel, {
time: ms(args[0]),
prize: args.slice(2).join(" "),
winnersCount: parseInt(args[1])
}).then((gData) => {
console.log(gData); // {...} (messageid, end date and more)
});
}
});