Skip to content

Commit

Permalink
feat: discordTimestamp (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leref committed Jul 6, 2024
2 parents 4f0ef3d + bdb8fe4 commit 6238036
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/functions/discordTimestamp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = async (d) => {
const data = d.util.aoiFunc(d);

const [timestamp = Date.now(), flag = "F"] = data.inside.splits;

if (!["f", "d", "F", "D", "R"].includes(flag)) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Invalid flag Provided In");

data.result = `<t:${Math.floor(timestamp / 1000)}:${flag}>`;

return {
code: d.util.setCode(data)
};
};

0 comments on commit 6238036

Please sign in to comment.