]> kaliko git repositories - sid.git/blob - sid/ping.py
Switch to SPDX headers
[sid.git] / sid / ping.py
1 # -*- coding: utf-8 -*-
2 # SPDX-FileCopyrightText:  2014, 2020 kaliko <kaliko@azylum.org>
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from .plugin import Plugin, botcmd
6
7
8 class Ping(Plugin):
9     PongURL = 'http://upload.wikimedia.org/wikipedia/commons/f/f8/Pong.png'
10
11     def __init__(self, bot):
12         Plugin.__init__(self, bot)
13
14     @botcmd
15     def ping(self, rcv, args):
16         """Answers a pong showing the bot is alive.
17
18         !ping : You'll get back "pong"!
19         """
20         msg = {'mhtml': '!<a href="{0.PongURL}">pong</a>'.format(self),
21                'mbody': '!pong'}
22         self.reply(rcv, msg)
23
24 # VIM MODLINE
25 # vim: ai ts=4 sw=4 sts=4 expandtab