mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-22 18:19:40 +02:00
add many commands
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { Message, Client } from 'discord.js';
|
||||
|
||||
module.exports = {
|
||||
aliases: ['date', 'heure', 'temps', 'moment', 'maintenant', 'actuel', 'actuellement', 'instant', 'présent'],
|
||||
description: 'Affiche l\'heure.',
|
||||
emote: '⏱️',
|
||||
utilisation: '[heure/jour/mois/année]',
|
||||
|
||||
async execute(message: Message, args: string[], client: Client) {
|
||||
message.delete();
|
||||
const date = new Date();
|
||||
const day = date.getDate();
|
||||
const month = date.getMonth() + 1;
|
||||
const year = date.getFullYear();
|
||||
const hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
const seconds = date.getSeconds();
|
||||
const milliseconds = date.getMilliseconds();
|
||||
|
||||
const daysInLetters = ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'];
|
||||
const dayInLetters = daysInLetters[date.getDay()];
|
||||
const monthsInLetters = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
|
||||
const monthInLetters = monthsInLetters[month - 1];
|
||||
|
||||
if (args[0] === 'heure' || args[0] === 'time' || args[0] === 'temps') {
|
||||
message.channel.send(`Il est ${hours}:${minutes}:${seconds}:${milliseconds}.`);
|
||||
} else if (args[0] === 'jour' || args[0] === 'day' || args[0] === 'date') {
|
||||
message.channel.send(`Nous sommes ${dayInLetters} ${day} ${monthInLetters}(${month}) ${year}.`);
|
||||
} else if (args[0] === 'mois' || args[0] === 'month') {
|
||||
message.channel.send(`Nous sommes en ${monthInLetters}(${month}).`);
|
||||
} else if (args[0] === 'année' || args[0] === 'year' || args[0] === 'an' || args[0] === 'annee') {
|
||||
message.channel.send(`Nous sommes en ${year}.`);
|
||||
} else {
|
||||
message.channel.send(`Nous sommes ${dayInLetters} ${day} ${monthInLetters}(${month}) ${year} et il est ${hours}:${minutes}:${seconds}:${milliseconds}.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user