- Katılım
- 4 Haz 2019
- Mesajlar
- 500
- Beğeni
- 174
- Puanları
- 700
Merhaba Minecraft-Türkiye Forum Üyeleri
Bugün bot projemizin şimdilik son aşamasındayız Minecraft başarımları şeklinde bir komut ekleyeceğiz botumuzu github'a push'layıp son vereceğiz indirip alt yapısını kullanabilirsiniz sadece token eklemeniz gerekmekte veya herhangi bir kodu alabilirsiniz.
ek modül snekfetch | npm i snekfetch
JavaScript:
const Discord = require('discord.js');
const snekfetch = require('snekfetch');
exports.run = (client, msg, args) => {
let [title, contents] = args.join(" ").split("|");
if(!contents) {
[title, contents] = ["Yeni ödül kazandin !", title];
}
let rnd = Math.floor((Math.random() * 39) + 1);
if(args.join(" ").toLowerCase().includes("burn")) rnd = 38;
if(args.join(" ").toLowerCase().includes("cookie")) rnd = 21;
if(args.join(" ").toLowerCase().includes("cake")) rnd = 10;
if(title.length > 22 || contents.length > 22) return msg.edit("Max Length: 22 Characters. Soz.").then(msg.delete.bind(msg), 2000);
const url = `https://www.minecraftskinstealer.com/achievement/a.php?i=${rnd}&h=${encodeURIComponent(title)}&t=${encodeURIComponent(contents)}`;
snekfetch.get(url)
.then(r=>msg.channel.send("", {files:[{attachment: r.body}]}));
msg.delete();
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: []
};
exports.help = {
name: 'mcödül',
description: 'Send a Minecraft Achievement image to the channel',
usage: 'mcödül Title|Text '
};
Bu şekilde.
Projenin tamamına Buraya tıklayarak ulaşabilirsiniz!