maple/storage/bot/plugins/datetime_plugin.py
2023-03-26 15:46:52 -05:00

75 lines
3.0 KiB
Python

# -*- coding: utf-8 -*- ############################################################### SOF
###########################################################################################
from irc3.plugins.command import command
import irc3
from datetime import datetime as dt
from tool_colors_plugin import colorform as print
###########################################################################################
###########################################################################################
@irc3.plugin
class Plugin:
#######################################################################################
#######################################################################################
def __init__(self, bot):
print('[ loaded ]')
self.bot = bot
#######################################################################################
#######################################################################################
@classmethod
def reload(cls, old):
return cls(old.bot)
#######################################################################################
#######################################################################################
def before_reload(self):
pass
#######################################################################################
#######################################################################################
def after_reload(self):
pass
#######################################################################################
#######################################################################################
@classmethod
def reload(cls, old):
return cls(old.bot)
#######################################################################################
#######################################################################################
def before_reload(self):
pass
#######################################################################################
#######################################################################################
def after_reload(self):
pass
#######################################################################################
#######################################################################################
@command(permission='view')
def time(self, mask, target, args):
"""Show local server datetime info
%%time
"""
msg = "LOCAL SERVER TIME: {HOUR}:{MINUTE} {MONTH}/{DAY}/{YEAR}"
TIME = dt.now()
msg = msg.format(HOUR=TIME.hour,MINUTE=TIME.minute,MONTH=TIME.month,DAY=TIME.day,YEAR=TIME.year)
self.bot.privmsg(target,self.bot.emo(msg))
###########################################################################################
####################################################################################### EOF