bbbctl 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: bbbctl
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: BigBlueButton API command-line client
5
5
  Home-page: https://github.com/defnull/bbbctl
6
6
  Author: Marcel Hellkamp
@@ -12,6 +12,7 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Dynamic: license-file
15
16
 
16
17
  # BigBlueButton REST API command-line client
17
18
 
@@ -52,6 +53,7 @@ You can get detailed help and a list of all parameters with `bbbctl -h` or `bbbc
52
53
  - `create <meetingID> <title>` Create a new meeting
53
54
  - `join <meetingID> <displayName>` Generate join links
54
55
  - `end <meetingID>` Forcefully end a meeting
56
+ - `chat <meetingID> <message>` Send a chat message to a running meeting (BBB 3.0)
55
57
  - `nuke` Forcefully end ALL meetings (be careful)
56
58
  - `record` Work with recordings
57
59
  - `list` List all recordings
@@ -37,6 +37,7 @@ You can get detailed help and a list of all parameters with `bbbctl -h` or `bbbc
37
37
  - `create <meetingID> <title>` Create a new meeting
38
38
  - `join <meetingID> <displayName>` Generate join links
39
39
  - `end <meetingID>` Forcefully end a meeting
40
+ - `chat <meetingID> <message>` Send a chat message to a running meeting (BBB 3.0)
40
41
  - `nuke` Forcefully end ALL meetings (be careful)
41
42
  - `record` Work with recordings
42
43
  - `list` List all recordings
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bbbctl
3
- version = 0.3.0
3
+ version = 0.3.2
4
4
  author = Marcel Hellkamp
5
5
  author_email = marc@gsites.de
6
6
  description = BigBlueButton API command-line client
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: bbbctl
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: BigBlueButton API command-line client
5
5
  Home-page: https://github.com/defnull/bbbctl
6
6
  Author: Marcel Hellkamp
@@ -12,6 +12,7 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Dynamic: license-file
15
16
 
16
17
  # BigBlueButton REST API command-line client
17
18
 
@@ -52,6 +53,7 @@ You can get detailed help and a list of all parameters with `bbbctl -h` or `bbbc
52
53
  - `create <meetingID> <title>` Create a new meeting
53
54
  - `join <meetingID> <displayName>` Generate join links
54
55
  - `end <meetingID>` Forcefully end a meeting
56
+ - `chat <meetingID> <message>` Send a chat message to a running meeting (BBB 3.0)
55
57
  - `nuke` Forcefully end ALL meetings (be careful)
56
58
  - `record` Work with recordings
57
59
  - `list` List all recordings
@@ -28,7 +28,7 @@ class BBBApiClient:
28
28
  self.ssl = ssl_context or ssl.create_default_context()
29
29
 
30
30
  def makeurl(self, command, **query):
31
- query = urllib.parse.urlencode(query)
31
+ query = urllib.parse.urlencode({k:v for k,v in query.items() if v is not None})
32
32
  checksum = hashlib.sha1(
33
33
  (command + query + self.secret).encode("utf8")
34
34
  ).hexdigest()
@@ -70,6 +70,9 @@ class BBBApiClient:
70
70
  def deleteRecordings(self, recordID):
71
71
  return self.call("deleteRecordings", recordID=recordID)
72
72
 
73
+ def sendChatMessage(self, meetingID, message, userName=None):
74
+ return self.call("sendChatMessage", meetingID=meetingID, message=message, userName=userName)
75
+
73
76
 
74
77
  def build_parser():
75
78
 
@@ -164,6 +167,12 @@ def build_parser():
164
167
  cmd.add_argument("id", help="Meeting ID")
165
168
  cmd.set_defaults(cmd=cmd_meet_end)
166
169
 
170
+ cmd = meet_sub.add_parser("chat", help="Send a chat message into a running meeting (BBB 3.0)")
171
+ cmd.add_argument("id", help="Meeting ID. Can be 'BROADCAST' do broadcase a message to all running meetings")
172
+ cmd.add_argument("message", help="The message to send to chat")
173
+ cmd.add_argument("--name", help="The name that will be shown as the sender of the chat message", default="SYSTEM")
174
+ cmd.set_defaults(cmd=cmd_meet_chat)
175
+
167
176
  cmd = meet_sub.add_parser("nuke", help="End ALL meeting")
168
177
  cmd.add_argument("--doit", help="Disable dry-run mode and actually end meetings?", action="store_true")
169
178
  cmd.add_argument("--ask", help="Ask for every meeting?", action="store_true")
@@ -377,7 +386,7 @@ def cmd_meet_create(api, args):
377
386
  createTime=created.find("createTime").text,
378
387
  role="MODERATOR",
379
388
  )
380
- print(name + ":", link)
389
+ print(f"{name}: {link}")
381
390
 
382
391
 
383
392
  def cmd_meet_join(api, args):
@@ -400,6 +409,16 @@ def cmd_meet_end(api, args):
400
409
  api.end(meetingID=args.id, password=pwd)
401
410
 
402
411
 
412
+ def cmd_meet_chat(api, args):
413
+ if args.id == "BROADCAST":
414
+ meetings = [m.find("meetingID").text for m in api.getMeetings()]
415
+ else:
416
+ meetings = [args.id]
417
+
418
+ for meeting in meetings:
419
+ api.sendChatMessage(meeting, args.message, userName=args.name)
420
+
421
+
403
422
  def cmd_meet_nuke(api, args):
404
423
  meetings = list(api.getMeetings())
405
424
  for meeting in meetings:
File without changes
File without changes