forked from TeamUltroid/UltroidAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
howto.py
52 lines (42 loc) · 1.4 KB
/
howto.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
40
41
42
43
44
45
46
47
48
49
50
51
52
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}htg <text>`
How To Google.
Some peoples don't know how to google so help them 🙃🙂.
• `{i}htd <text>`
How to duck duck go...
"""
import requests
from . import *
@ultroid_cmd(pattern="htg ?(.*)")
async def _(e):
text = e.pattern_match.group(1)
if not text:
return await eod(e, "`Give some text`")
url = "https://da.gd/s?url=https://lmgtfy.com/?q={}%26iie=1".format(
text.replace(" ", "+")
)
response = requests.get(url).text
if response:
await eor(e, "[{}]({})\n`Thank me Later 🙃` ".format(text, response.rstrip()))
else:
await eod(e, "`something is wrong. please try again later.`")
@ultroid_cmd(pattern="htd ?(.*)")
async def _(e):
text = e.pattern_match.group(1)
if not text:
return await eod(e, "`Give some text`")
url = "https://da.gd/s?url=https://lmddgtfy.net/?q={}".format(
text.replace(" ", "+")
)
response = requests.get(url).text
if response:
await eor(e, "[{}]({})\n`Thank me Later 🙃` ".format(text, response.rstrip()))
else:
await eod(e, "`something is wrong. please try again later.`")