mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-03 20:27:31 +00:00
docs: add examples and update README.md
This commit is contained in:
19
examples/merge_data.py
Normal file
19
examples/merge_data.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
from mihomo import Language, MihomoAPI, tools
|
||||
|
||||
|
||||
async def main():
|
||||
client = MihomoAPI(language=Language.EN)
|
||||
old_data = await client.fetch_user(800333171)
|
||||
|
||||
# Change characters in game and wait for the API to refresh
|
||||
# ...
|
||||
|
||||
new_data = await client.fetch_user(800333171)
|
||||
data = tools.merge_character_data(new_data, old_data)
|
||||
|
||||
print(data)
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user