From 9c7d2d1d37d3ade7559ea93d6a8a05e0f021fddf Mon Sep 17 00:00:00 2001 From: Fsoky Date: Sat, 24 Jul 2021 13:09:41 +0600 Subject: [PATCH] Example --- test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index ae478f1..315e017 100644 --- a/test.py +++ b/test.py @@ -1,8 +1,8 @@ from flask import Flask, redirect -from donationalerts_api import DonationAlertsApi, Scopes, Centrifugo +from donationalerts_api import DonationAlertsApi, Centrifugo, Scopes, Channels app = Flask(__name__) -api = DonationAlertsApi("client id", "client secret", "http://127.0.0.1:5000/login", Scopes.all_scopes) +api = DonationAlertsApi("client id", "client secret", "http://127.0.0.1:5000/login", Scopes.ALL_SCOPES) @app.route("/", methods=["get"]) @@ -23,7 +23,8 @@ def login(): fugo = Centrifugo(socket_token, access_token, user_id) fugo.connect() - return fugo.subscribe() + return fugo.subscribe([Channels.NEW_DONATION_ALERTS]) + if __name__ == "__main__": app.run(debug=True) \ No newline at end of file