Log in
Log into community
Share feedback, ideas and get community help
View all posts
Related posts
Was this helpful?
😞
😐
😃
Powered by
Hall
Inactive
Updated last year
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
At a glance
a
altomarketing
last year
·
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™
last year
You can use the set variable to now, and do whatever you want with the time variable.
Attachment
V
Vilela™
last year
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™
last year
This way, time will be translated to a number:
9:30 would be 9.5
17:45 would be 17.75
V
Vilela™
last year
Attachment
a
altomarketing
last year
It works like charm !! thanks !!!
Add a reply
Sign up and join the conversation on Discord
Join on Discord