Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch one #42

Merged
merged 5 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
45 changes: 33 additions & 12 deletions honeybot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

Expand All @@ -150,8 +152,11 @@ def join_channel_command(self, channel):
str: Command to join Channel.

Examples:
TODO
channel_name_command = '<command_name>'
bot_core = Bot_core()
bot_core.join_channel_command(channel_name_command)
"""

return 'JOIN ' + channel + ' \r\n'

def specific_send_command(self, target, msg):
Expand All @@ -166,7 +171,10 @@ def specific_send_command(self, target, msg):
str: Command for messaging specific user.

Examples:
TODO
target_name = '<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"

Expand All @@ -181,7 +189,9 @@ def pong_return(self, domain):
str: Command for Pong.

Examples:
TODO
domain_name = '<current user domain>'
bot_core = Bot_core()
bot_core.pong_return(domain_name)
"""
return 'PONG :{}\r\n'.format(domain)

Expand All @@ -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': <prefix_string_value>
'command': <command_string_value>
'args': <array_of_argument_strings>
'address': <target address to which the message was sent>
'user':<user name who sent the message>
}

Examples:
TODO
message = '<incoming 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 ''
Expand Down Expand Up @@ -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,
Expand Down