This repository was archived by the owner on Aug 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ # Inside an async function
2+
3+ import crasync
4+ import asyncio
5+
6+ async def main ():
7+ client = crasync .Client ()
8+ profile = await client .get_profile ('2CYUUCC8' )
9+
10+ print (profile )
11+ print (profile .current_trophies )
12+
13+ await asyncio .sleep (5 )
14+ await profile .update () # updating the info
15+
16+ clan = await profile .get_clan () # get the players full clan info
17+
18+ print (clan )
19+ print (len (clan .members ))
20+
21+ await asyncio .sleep (5 )
22+ await clan .update () # updating the info
23+
24+ highest = await clan .members [0 ].get_profile ()
25+
26+ print (highest ) # top player
27+
28+
29+ loop = asyncio .get_event_loop ()
30+ loop .run_until_complete (main ())
31+
Original file line number Diff line number Diff line change 1+ [metadata]
2+ description-file = README.md
Original file line number Diff line number Diff line change 1+ from distutils .core import setup
2+
3+ setup (
4+ name = 'crasync' ,
5+ packages = ['crasync' ], # this must be the same as the name above
6+ version = 'v1.0.0a' ,
7+ description = 'An async wrapper for cr-api.com' ,
8+ author = 'verixx' ,
9+ 10+ url = 'https://github.com/grokkers/cr-async' , # use the URL to the github repo
11+ download_url = 'https://github.com/grokkers/cr-async/archive/v1.0.0-alpha.tar.gz' , # I'll explain this in a second
12+ keywords = ['clashroyale' ], # arbitrary keywords
13+ classifiers = [],
14+ )
You can’t perform that action at this time.
0 commit comments