mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +01:00
time thing
This commit is contained in:
parent
2d2d00ccbf
commit
affb89662f
@ -43,11 +43,12 @@ var commands = function(dbot){
|
|||||||
},
|
},
|
||||||
|
|
||||||
'~time': function(event) {
|
'~time': function(event) {
|
||||||
dbot.api.profile.getProfile(event.server, event.params[1], function(err, user, profile) {
|
var target = event.params[1] || event.user;
|
||||||
|
dbot.api.profile.getProfile(event.server, target, function(err, user, profile) {
|
||||||
if(!err) {
|
if(!err) {
|
||||||
var tz = profile.profile.timezone;
|
var tz = profile.profile.timezone;
|
||||||
if(tz) {
|
if(tz) {
|
||||||
event.reply('The time for ' + event.params[1] + ' in ' + tz + ' is ' + moment().tz(tz).format('HH:mm:ss on DD/MM/YYYY'));
|
event.reply('The time for ' + target + ' in ' + tz + ' is ' + moment().tz(tz).format('HH:mm:ss on DD/MM/YYYY'));
|
||||||
} else {
|
} else {
|
||||||
event.reply(user.currentNick + ' needs to set a timezone with "~set timezone x"');
|
event.reply(user.currentNick + ' needs to set a timezone with "~set timezone x"');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user