-
Notifications
You must be signed in to change notification settings - Fork 0
Time
Discord+PS has built in unix and embed times that you can use in messages to show things like relative times as well as others
For more info on message timestamps you can look here
There are two types of times those being:
- Now
- Set
Now is a class called with PSClient.time.now and it represents the current time
This is the code if you want to look through it:
now = new class {
get embed() { return new Date().toISOString(); }
get default() { return `<t:${Math.round(new Date().getTime() / 1000)}>` }
get shortTime() { return `<t:${Math.round(new Date().getTime() / 1000)}:t>` }
get longTime() { return `<t:${Math.round(new Date().getTime() / 1000)}:T>` }
get shortDate() { return `<t:${Math.round(new Date().getTime() / 1000)}:d>` }
get longDate() { return `<t:${Math.round(new Date().getTime() / 1000)}:D>` }
get shortDT() { return `<t:${Math.round(new Date().getTime() / 1000)}:f>` }
get longDT() { return `<t:${Math.round(new Date().getTime() / 1000)}:F>` }
get relative() { return `<t:${Math.round(new Date().getTime() / 1000)}:R>` }
}
Set is a class called with PSClient.time.set and it represents a set (given) time
This is the code if you want to look through it:
set = new class {
embed(date) { return new Date(date).toISOString(); }
default(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}>` }
shortTime(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:t>` }
longTime(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:T>` }
shortDate(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:d>` }
longDate(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:D>` }
shortDT(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:f>` }
longDT(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:F>` }
relative(date) { return `<t:${Math.round(new Date(date).getTime() / 1000)}:R>` }
}
Let's say we want to make a message say the relative time from when the message was sent to now, we can do that with this:
{
timestamp: PSClient.time.now.relative
}
Alternatively let's say we want to make a message that says the relative time from from a set date like 11/28/2018 to now, we can do that with this:
{
timestamp: PSClient.time.set.relative("11/28/2018")
}
Let's say we want to make an embed's timestamp the current time, we can do that with this:
{
timestamp: PSClient.time.now.embed
}
Alternatively let's say we want to make an embed's timestamp a set date like 11/28/2018, we can also do that with this:
{
timestamp: PSClient.time.set.embed("11/28/2018")
}
For a look at some examples check out the examples folder
If anything with the mod is updated you can look to the releases for info on it
For a look into the development check out the index.js file
This mod is not associated with the creators of Discord, Discord.JS, or Discord.PY this was created out of love for Discord bot development because I wanted to make things easier for people. I do not condone harassment of the original developers and or anyone else involved in the creation of them.
I am not responsible for anything made with this mod and be sure to follow Discord's terms of service and their community guildlines while developing.
Basics
wc.command()
wc.slashCommand()
wc.commandList
wc.slashCommandList
Basics
wc.event()
wc.eventList
wc.commandAction()
wc.buttonAction()
wc.selectionAction()
wc.rowAction()
wc.fetchMessage()
wc.fetchReply()
wc.fetchUser()
wc.fetchGuildUser()
wc.fetchChannel()
wc.fetchGuildChannel()
wc.fetchRole()
wc.fetchGuildRole()
wc.fetchGuild()
wc.parseEmoji()
wc.parseSticker()