An easy way to listen for Trakteer donation in Python
Project description
⚠️ NOTE: THIS PROJECT IS ONLY FOR EDUCATIONAL PURPOSE!! ⚠️
I WONT RESPONSIBLE FOR SOMETHING HAPPEN WHEN USING THIS PROGRAM!!
Trakteer Donate
An easy way to listen for Trakteer donation in Python
Installation
To install this package, you can easily use pip!
pip install trakteerdonate
Or,
pip install git+https://github.com/then77/trakteerdonate
Package Usage
- First open your Trakteer and go to Stream Overlay (here)
- On the Widget URL, copy the key, and the hash
- Create a code and import the
Clientfunction.
from trakteerdonate import Client
client = Client("hash", "streamKey")
# Replace "hash" and "streamKey" with the key you copied before
- Add listener for donation
@client.event
async def on_donation(ws, data):
print("Received donation:")
print(f" - Name: {data.name}")
print(f" - Amount: {data.amount}")
print(f" - Message: {data.message}")
- Last, add this code To the bottom of the code and run!
client.start()
The reason it should be placed on the bottom because its a blocking function.
Example Code
from trakteerdonate import Client
client = Client("hash", "streamKey")
@client.event
async def on_connect(ws):
print("Connected to Trakteer!")
@client.event
async def on_donation(ws, data):
print("Received donation:")
print(f" - Name: {data.name}")
print(f" - Amount: {data.amount}")
print(f" - Message: {data.message}")
client.start()
Repository License
This repository and its code is under the MIT License. Read more here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trakteerdonate-1.0a2.tar.gz
(6.0 kB
view details)
File details
Details for the file trakteerdonate-1.0a2.tar.gz.
File metadata
- Download URL: trakteerdonate-1.0a2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8e13e0a269e085722976d5b42e13e0644324ef7381f7063bff089973ed5b451
|
|
| MD5 |
35fa413bb9a70529e4c431413c3566b8
|
|
| BLAKE2b-256 |
d9c8bc117232d4de022aaee1448866f2fabd3b30dc7cac73a368f41817cd3eaa
|