Skip to content
Open
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
3 changes: 2 additions & 1 deletion brutal/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class Bot(object):
def __init__(self, nick, connections, *args, **kwargs):
def __init__(self, nick, connections, command_token='!', *args, **kwargs):
"""
acts as a connection manager, middle man for incoming events, and processor of outgoing actions.
"""
Expand All @@ -22,6 +22,7 @@ def __init__(self, nick, connections, *args, **kwargs):
# bot id
self.nick = nick
self.id = str(uuid.uuid1())
self.command_token = command_token
self.log = logging.getLogger('{0}.{1}.{2}'.format(self.__class__.__module__, self.__class__.__name__,
self.nick))
self.log.info('starting bot')
Expand Down
4 changes: 2 additions & 2 deletions brutal/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def parse_details(self):
self.from_bot = False

if self.event_type == 'message' and isinstance(self.meta, dict) and 'body' in self.meta:
res = self.parse_event_cmd(self.meta['body'])
res = self.parse_event_cmd(self.meta['body'], self.source_bot.command_token)
# if res is False:
# self.log.debug('event not parsed as a command')

Expand Down Expand Up @@ -290,4 +290,4 @@ def part(self, channel, msg=None):
self.type = 'part'
if msg is not None:
self._add_to_meta('msg', msg)
return self
return self
5 changes: 3 additions & 2 deletions brutal/spawn/spawn_template/spawn_name/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
# 'channels': ['room', ('private_room', 'pass')]
# }
# ],
# 'plugin_settings': {}
# 'plugin_settings': {},
# 'command_token': '.'
# }
]
]