This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/core_ctcp.py
Luke Rogers d6683b32f4 PEP-8
2014-02-14 17:03:08 +13:00

19 lines
435 B
Python

import time
from util import hook
# CTCP responses
@hook.regex(r'^\x01VERSION\x01$')
def ctcp_version(inp, notice=None):
notice('\x01VERSION: CloudBot - http://git.io/cloudbotirc')
@hook.regex(r'^\x01PING\x01$')
def ctcp_ping(inp, notice=None):
notice('\x01PING: PONG')
@hook.regex(r'^\x01TIME\x01$')
def ctcp_time(inp, notice=None):
notice('\x01TIME: The time is: {}'.format(time.strftime("%r", time.localtime())))