File: zulip.py

package info (click to toggle)
mathlibtools 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 272 kB
  • sloc: python: 1,388; sh: 90; makefile: 3
file content (23 lines) | stat: -rwxr-xr-x 535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/.zuliprc")

# Send a stream message
request = {
    "type": "stream",
    "to": "Denmark",
    "subject": "Castle",
    "content": "I come not, friends, to steal away your hearts."
}
result = client.send_message(request)
print(result)

# Send a private message
request = {
    "type": "private",
    "to": "scott@tqft.net",
    "content": "With mirth and laughter let old wrinkles come."
}
result = client.send_message(request)
print(result)