Skip to content

Commit

Permalink
Added BotActivator
Browse files Browse the repository at this point in the history
  • Loading branch information
Mydayyy committed Sep 23, 2017
1 parent 5567c1b commit 3245c78
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Bot/Plugins/BotActivation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from Bot.Plugins.Base import PluginBase


class BotActivationPlugin(PluginBase):
"""
This plugin will write the user when he renames himself to have 'bot' in his name.
The plugin provides no commands.
This plugin provides no configuration ( yet ).
"""

def __init__(self, bot_instance):
super().__init__(bot_instance)
self.bot_instance.register_value_changed_callback("client_nickname", self.on_nick_changed)

def on_nick_changed(self, clid, key, old_value, value):
if "bot" in str(value).lower():
self.bot_instance.send_text_to_client(clid, "Hello " + value + ".")

0 comments on commit 3245c78

Please sign in to comment.