From ff8e66638a56f437ed31032d799498483d185543 Mon Sep 17 00:00:00 2001 From: Isaac Date: Sun, 25 Jun 2023 13:41:29 +0100 Subject: [PATCH] feat: new `suid-time` stdin command --- src/stdin/suid-time.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/stdin/suid-time.js diff --git a/src/stdin/suid-time.js b/src/stdin/suid-time.js new file mode 100644 index 0000000..973aed1 --- /dev/null +++ b/src/stdin/suid-time.js @@ -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); + } + } +}; + +