mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-03 23:36:23 +02:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
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);
|
|
}
|
|
}; |