From e518fc7f4c42f6e911d85ce8f662b3d21b6da757 Mon Sep 17 00:00:00 2001 From: kaliko Date: Sat, 15 Nov 2014 14:34:43 +0100 Subject: [PATCH] Add ping comand --- sid/ping.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sid/ping.py diff --git a/sid/ping.py b/sid/ping.py new file mode 100644 index 0000000..827ddb6 --- /dev/null +++ b/sid/ping.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + +# Copyright (C) 2014 kaliko + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 only. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from .plugin import Plugin, botcmd + +class Ping(Plugin): + PongURL = 'http://upload.wikimedia.org/wikipedia/commons/f/f8/Pong.png' + + def __init__(self, bot): + Plugin.__init__(self, bot) + + @botcmd + def ping(self, message, args): + """ping's answering a pong showing the bot is alive. + !ping : You'll get back "pong"! + """ + msg = { + 'mhtml':'!pong'.format(self), + 'mbody':'!pong', + } + self.send(msg) + +# VIM MODLINE +# vim: ai ts=4 sw=4 sts=4 expandtab -- 2.39.2