Skip to content

Commit

Permalink
Ad-hoc Fixes (#191)
Browse files Browse the repository at this point in the history
- Added handling of "announce_invitation" instead of "skip_announcement"
- Introduced "FACILITATOR" bot type
  • Loading branch information
NeonKirill authored Jan 5, 2025
1 parent 5c9d5da commit 6d3b9af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions chatbot_core/utils/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class BotTypes:
PROCTOR = 'proctor'
SUBMIND = 'submind'
OBSERVER = 'observer'
FACILITATOR = 'facilitator'


CONVERSATION_STATE_ANNOUNCEMENTS = {
Expand Down
4 changes: 2 additions & 2 deletions chatbot_core/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def handle_kick_out(self, body: dict):
def handle_invite(self, body: dict):
"""Handles incoming request to chatbot"""
new_cid = body.pop('cid', None)
skip_announcement = body.pop('skip_announcement', False)
announce_invitation = body.pop('announce_invitation', True)
self.log.info(f'Received invitation to cid: {new_cid}')
if new_cid and not self.current_conversations.get(new_cid, None):
self.current_conversations[new_cid] = body
self.set_conversation_state(new_cid, ConversationState.IDLE)
if not skip_announcement:
if announce_invitation:
self.send_announcement(f'{self.nick.split("-")[0]} joined', new_cid)

def get_conversation_state(self, cid) -> ConversationState:
Expand Down

0 comments on commit 6d3b9af

Please sign in to comment.