Log in
Log into community
Share feedback, ideas and get community help
View all posts
Related posts
Did this answer your question?
😞
😐
😃
Powered by
Hall
Inactive
Updated 10 months ago
0
Follow
How can i split the bot depending the real hour time ?
How can i split the bot depending the real hour time ?
Inactive
0
Follow
a
altomarketing
10 months ago
·
I use the bot to give support, and i would like to do this:
Its working hour ? > goes to Chatwoot
Its night ? > goes to create a ticket
How can i do that ? javascript maybe ?
V
a
5 comments
Share
Open in Discord
V
Vilela™
10 months ago
You can use the set variable to now, and do whatever you want with the time variable.
Attachment
V
Vilela™
10 months ago
But to easy manipulate just the time, I would do something like this:
Plain Text
Copy
const now = new Date(); return now.getHours() + now.getMinutes() / 60;
`
V
Vilela™
10 months ago
This way, time will be translated to a number:
9:30 would be 9.5
17:45 would be 17.75
V
Vilela™
10 months ago
Attachment
a
altomarketing
10 months ago
It works like charm !! thanks !!!
Add a reply
Sign up and join the conversation on Discord
Join on Discord