The official Teamwork python bot-framework SDK.
Install the packages using pip:
pip install teamwork-pythonBefore you start, you need to create a bot on your Teamwork app console platform and get the API token.
You can use the SDK to interact with the Teamwork Bot-framework API.
from teamwork import AsyncClient
client = AsyncClient("ENDPOINT_URL", "API_TOKEN")
# by id
user = await client.user.by_id(1001)
# by username
user = await client.user.by_username("john.doe@example.com")This is to let your bot account send a message to other end-user or group chats.
from teamwork import ReceiverType
# to a user
res = await client.message.send("Hello world!", 1001, ReceiverType.USER)
# to a group chat
res = await client.message.send("Hello everyone!", 59239, ReceiverType.GROUP)Optionally, you can send a "typing" signal to the target, indicating that the bot is typing before you actually send the message
# first, send the signal
res = await client.message.sending_typing_signal(1001, ReceiverType.USER)
# Sometime later, send the actual message
res = await client.message.send("Hello world!", 1001, ReceiverType.USER)This project is licensed under the MIT License.