-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + ".") |