Skip to content

Commit

Permalink
feat(chat-message): chat.py equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
faust64 committed May 26, 2021
1 parent 29cd9c6 commit 94e4540
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ def bbb_browser():

element = EC.invisibility_of_element((By.CSS_SELECTOR, '.ReactModal__Overlay'))
WebDriverWait(browser, selenium_timeout).until(element)
browser.find_element_by_id('message-input').send_keys("Viewers of the live stream can now send messages to this meeting")
browser.find_elements_by_css_selector('[aria-label="Send message"]')[0].click()

element = browser.find_element_by_id('message-input')
chat_send = browser.find_elements_by_css_selector('[aria-label="Send message"]')[0]
# ensure chat is enabled (might be locked by moderator)
if element.is_enabled() and chat_send.is_enabled():
tmp_chatMsg = os.environ.get('BBB_CHAT_MESSAGE', "Viewers of the live stream can now send messages to this meeting")
if not tmp_chatMsg in [ 'false', 'False', 'FALSE' ]:
element.send_keys(tmp_chatMsg)
chat_send.click()

redis_r = redis.Redis(host=args.redis,charset="utf-8", decode_responses=True)
redis_s = redis_r.pubsub()
Expand Down
2 changes: 1 addition & 1 deletion examples/.env.chat_example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ BBB_REDIS_CHANNEL=chat
# Username for the chat (default: 'Chat')
BBB_CHAT_NAME=Chat
# Message to post in BBB Chat when joining a conference
BBB_CHAT_MESSAGE=This meeting is streamed to
BBB_CHAT_MESSAGE=Viewers of the live stream can now send messages to this meeting
2 changes: 1 addition & 1 deletion examples/docker-compose.yml.chat_example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
# show chat in live stream
- BBB_SHOW_CHAT=false
# Message to post in BBB Chat when joining a conference
- BBB_CHAT_MESSAGE=This meeting is streamed to
- BBB_CHAT_MESSAGE=Viewers of the live stream can now send messages to this meeting
# Set REDIS host (default: 'redis')
- BBB_REDIS_HOST=redis
# Set REDIS channel to subscribe (default: 'chat')
Expand Down

0 comments on commit 94e4540

Please sign in to comment.