Kod Ne işe yarıyor: Oyun içerisinde kaç player ping map adı tarzı şeyleri gösterir.
Gerekli Modüller: gamedig
Kod:
Komutlar klasörüne atmanız yeterlidir.
Kod:
const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed, MessageActionRow, MessageButton, } = require('discord.js');
const Gamedig = require('gamedig');
module.exports = {
name: "sunucu",
command : new SlashCommandBuilder().setName("sunucu").setDescription("Sunucu bilgilerini atar."),
async run(client, int) {
Gamedig.query({
type: 'mtasa', // oyun adı
host: '54.36.0.84' // ip adresi
}).then((state) => {
const embed = new MessageEmbed()
.setColor(00000)
.setTitle(state.name)
.setColor(`RANDOM`)
.addField(`Map :`,` - ${state.map}`,true)
.addField(`Oyun Türü :`,` - ${state.raw.gametype}`,true)
.addField(`Geliştirici:`,` - Jenesse & LordArsen`,true)
.addField(`Oyuncu :`,` - ${state.raw.numplayers}/${state.maxplayers}`,true)
.addField(`Ping:`,` - ${state.ping}ms`,true)
.addField(`IP:`,` - ${state.connect}`,true)
.setThumbnail(''); // resim linki
const linkRow = new MessageActionRow()
.addComponents(
new MessageButton()
.setURL('https://webailesi.com') // url
.setLabel('İstediğiniz şey')
.setStyle('LINK')
)
int.reply({ embeds: [embed], components: [linkRow] });
})
}
};
/// jenesse tarafından kodlanmıştır.)

