mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-27 06:28:00 +02:00
add many commands
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { Message, Client, MessageResolvable } from 'discord.js';
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
module.exports = {
|
||||
aliases: [],
|
||||
description: 'Affiche les informations relative à une IP.',
|
||||
emote: '⏱️',
|
||||
utilisation: '<ip>',
|
||||
|
||||
async execute(message: Message, args: string[], client: Client) {
|
||||
message.delete();
|
||||
const ip = args[0];
|
||||
if (!ip) {
|
||||
message.channel.send('Veuillez spécifier une adresse IP.');
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch(`http://ip-api.com/json/${ip}`);
|
||||
const data = await response.json();
|
||||
|
||||
if (data.status === 'fail') {
|
||||
message.channel.send('Adresse IP invalide.');
|
||||
return;
|
||||
}
|
||||
|
||||
const info = `# Informations sur l'adresse IP ${ip}:\n\n` +
|
||||
`Pays: ${data.country}\n` +
|
||||
`Ville: ${data.city}\n` +
|
||||
`Région: ${data.regionName}\n` +
|
||||
`Code postal: ${data.zip}\n` +
|
||||
`Latitude: ${data.lat}\n` +
|
||||
`Longitude: ${data.lon}\n` +
|
||||
`Fournisseur de services Internet: ${data.isp}\n` +
|
||||
`Organisation: ${data.org}\n`
|
||||
|
||||
message.channel.send(info);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user