feat: new suid-time stdin command

This commit is contained in:
Isaac 2023-06-25 13:41:29 +01:00
parent e8b95a2f31
commit ff8e66638a
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

23
src/stdin/suid-time.js Normal file
View File

@ -0,0 +1,23 @@
const { StdinCommand } = require('@eartharoid/dbf');
const ShortUniqueId = require('short-unique-id');
const uid = new ShortUniqueId();
module.exports = class extends StdinCommand {
constructor(client, options) {
super(client, {
...options,
id: 'suid-time',
});
}
async run(input) {
try {
input = input.filter(str => str.length > 0);
this.client.log.info('Timestamp:', uid.parseStamp(input[0]));
} catch (error) {
this.client.log.error(error);
}
}
};