🌏 بأمكانك نشر سيرفرك الأن من خلال البوت
لضافة البوت :
https://special-share.org/invite
موقع البوت :
https://special-share.org
لضافة البوت :
https://special-share.org/invite
موقع البوت :
https://special-share.org
# AmtiXDev Timestamp Generator
A simple npm package to generate Discord timestamps based on user-specified durations.
## Installation
Install the package using npm:
## Usage
Replace the duration string in the
## API
###
Generates a Discord timestamp based on the specified duration.
-
Returns a string containing the Discord timestamp.
## Discord Bot Integration
You can also use this package in your Discord bot. Here's an example using discord.js:
## Preview
!Preview Image
A simple npm package to generate Discord timestamps based on user-specified durations.
## Installation
Install the package using npm:
npm install amtixdev-timestamp-generator## Usage
const generateTimestamp = require('amtixdev-timestamp-generator');
const timestamp = generateTimestamp('1d');
console.log(`Generated timestamp: ${timestamp}`);Replace the duration string in the
generateTimestamp function with your desired time value (e.g., '1d' for 1 day, '2h' for 2 hours).## API
###
generateTimestamp(duration: string): stringGenerates a Discord timestamp based on the specified duration.
-
duration: A string representing the duration in the format 'XdXhXmXs' where X is a number and d/h/m/s denote days/hours/minutes/seconds.Returns a string containing the Discord timestamp.
## Discord Bot Integration
You can also use this package in your Discord bot. Here's an example using discord.js:
const { Client, Intents } = require('discord.js');
const generateTimestamp = require('amtixdev-timestamp-generator');
const token = 'YOUR_BOT_TOKEN';
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
if (message.content.startsWith('!create_time')) {
const args = message.content.split(' ').slice(1);
if (args.length !== 1) {
message.reply('Please provide a valid time value. Example: `!create_time 1d`');
return;
}
const duration = args[0];
const timestamp = generateTimestamp(duration);
message.reply(`Time: ${timestamp}`);
}
});
client.login(token);## Preview
!Preview Image

