diff --git a/.gitignore b/.gitignore index 3935eb0..7fd1777 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,19 @@ honeybot/log/* # visual studio code settings .vscode/ /.vs +/test_plugin_script.py +/test.py +/settings/PLUGINS.conf +/settings/OWNERS.conf +/settings/FRIENDS.conf +/settings/email_config.conf +/settings/CONNECT.conf +/settings/AUTOJOIN_CHANNELS.conf +/settings +/plugins_info.md +/plugins +/pluginInfo.py +/memory +/main.py +/lab.py +/.google-cookie diff --git a/honeybot/main.py b/honeybot/main.py index f606035..b6b3cd8 100644 --- a/honeybot/main.py +++ b/honeybot/main.py @@ -122,7 +122,8 @@ def present_command(self): str: String for the present command. Examples: - TODO + bot_core = Bot_core() + bot_core.present_command() """ return 'USER ' + self.name + ' ' + self.name + ' ' + \ self.name + ' : ' + self.name + ' IRC\r\n' @@ -135,7 +136,8 @@ def identify_command(self): str: Command for the identify command. Examples: - TODO + bot_core = Bot_core() + bot_core.identify_command() """ return 'msg NickServ identify ' + self.password + ' \r\n' @@ -150,8 +152,11 @@ def join_channel_command(self, channel): str: Command to join Channel. Examples: - TODO + channel_name_command = '' + bot_core = Bot_core() + bot_core.join_channel_command(channel_name_command) """ + return 'JOIN ' + channel + ' \r\n' def specific_send_command(self, target, msg): @@ -166,7 +171,10 @@ def specific_send_command(self, target, msg): str: Command for messaging specific user. Examples: - TODO + target_name = '' + str msg = 'I am a test message' + bot_core = Bot_core() + bot_core.specific_send_command(target_name, msg) """ return "PRIVMSG " + target + " :" + msg + "\r\n" @@ -181,7 +189,9 @@ def pong_return(self, domain): str: Command for Pong. Examples: - TODO + domain_name = '' + bot_core = Bot_core() + bot_core.pong_return(domain_name) """ return 'PONG :{}\r\n'.format(domain) @@ -194,26 +204,36 @@ def message_info(self, s): Get info of a message. Args: - s(str): TODO + s(str): Incoming message information Returns: - dict of {str: str}: TODO + dict of {str: str}: interprets the incoming message and splits the message to get the following information out of the message viz 'prefix', 'command', 'args', 'address', 'user'. Then returns the information as a dictionary containing following information: + { + 'prefix': + 'command': + 'args': + 'address': + 'user': + } Examples: - TODO + message = '' + bot_core = Bot_core() + bot_core.message_info(message) """ def prevent_none(x): """ - TODO + Processes the arguments for None values. Args: - x(any or None): TODO + x(any or None): can be any type of variable Returns: Union of [x,''](any or str): returns x if x is not None else ''. Examples: - TODO + x = ['a', 'b'] + prevent_none(message) """ if x is None: return '' @@ -259,7 +279,8 @@ def bot_info(self): dict of {str: str}: TODO. Examples: - TODO + bot_core = Bot_core() + bot_core.bot_info(message) """ return { 'name': self.name,