-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathuser-agent-info.py
39 lines (36 loc) · 1.23 KB
/
user-agent-info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright (C) 2020-2021 by DevsExpo@Github, < https://github.com/DevsExpo >.
#
# This file is part of < https://github.com/DevsExpo/FridayUserBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/DevsExpo/blob/master/LICENSE >
#
# All rights reserved.
from main_startup.core.decorators import friday_on_cmd
from main_startup.helper_func.basic_helpers import edit_or_reply, get_text
import requests
@friday_on_cmd(
["ua", "user_agent"],
cmd_help={
"help": "Get Info From user agent",
"example": "{ch}ua (user agent)",
},
)
async def useragenti(client, message):
engine = message.Engine
pablo = await edit_or_reply(message, engine.get_string("PROCESSING"))
tex_t = get_text(message)
if not tex_t:
await pablo.edit(engine.get_string("INPUT_REQ").format("User Agent"))
return
ue = tex_t
data = {"ua" : ue}
r = requests.post("https://api.apicagent.com", data = data)
Lol = r.json()
await pablo.edit(f"""
Browser: {Lol["client"]["name"]}
Browser Version: {Lol["client"]["version"]}
Device Brand: {Lol["device"]["brand"]}
Device Model: {Lol["device"]["model"]}
OS: {Lol["os"]["name"]}
OS version: {Lol["os"]["version"]}
""")