-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
inlinefun.py
136 lines (113 loc) · 3.61 KB
/
inlinefun.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# Ultroid - UserBot
#
# 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/>.
# .tweet made for ultroid
# .uta ported from Dark-Cobra
"""
✘ Commands Available -
• `{i}uta <search query>`
Inline song search and downloader.
• `{i}gglax <query>`
Create google search sticker with text.
• `{i}stic <emoji>`
Get random stickers from emoji.
• `{i}frog <text>`
make text stickers.
• `{i}tweet <text>`
make twitter posts.
• `{i}quot <text>`
write quote on animated sticker.
"""
from random import choice
from addons.waifu import deEmojify
from . import ultroid_cmd, get_string
@ultroid_cmd(pattern="tweet ?(.*)")
async def tweet(e):
wai = await e.eor()
text = e.pattern_match.group(1)
if not text:
return await wai.edit("`Give me Some Text !`")
try:
results = await e.client.inline_query("twitterstatusbot", text)
await e.reply("New Tweet", file=results[0].document)
await wai.delete()
except Exception as m:
await e.eor(str(m))
@ultroid_cmd(pattern="stic ?(.*)")
async def tweet(e):
if len(e.text) > 5 and e.text[5] != " ":
return
wai = await e.eor(get_string("com_1"))
text = e.pattern_match.group(1)
if not text:
return await wai.edit("`Give me Some Emoji !`")
results = await e.client.inline_query("sticker", text)
num = choice(results)
await e.reply("@sticker", file=num.document)
await wai.delete()
@ultroid_cmd(pattern="gglax ?(.*)")
async def gglax_sticker(e):
wai = await e.eor(get_string("com_1"))
text = e.pattern_match.group(1)
if not text:
return await wai.edit("`Give me Some Text !`")
try:
results = await e.client.inline_query("googlaxbot", text)
await e.reply("Googlax", file=results[0].document)
await wai.delete()
except Exception as m:
await e.eor(str(m))
@ultroid_cmd(pattern="frog ?(.*)")
async def honkasays(e):
wai = await e.eor(get_string("com_1"))
text = e.pattern_match.group(1)
if not text:
return await wai.edit("`Give Me Some Text !`")
text = deEmojify(text)
if not text.endswith("."):
text += "."
if len(text) <= 9:
q = 2
elif len(text) >= 14:
q = 0
else:
q = 1
try:
res = await e.client.inline_query("honka_says_bot", text)
await e.reply("Honka", file=res[q].document)
await wai.delete()
except Exception as er:
await wai.edit(str(er))
@ultroid_cmd(pattern="uta ?(.*)")
async def nope(doit):
ok = doit.pattern_match.group(1)
replied = await doit.get_reply_message()
a = await doit.eor(get_string("com_1"))
if ok:
pass
elif replied and replied.message:
ok = replied.message
else:
return await doit.eor(
"`Sir please give some query to search and download it for you..!`",
)
sticcers = await doit.client.inline_query("Lybot", f"{(deEmojify(ok))}")
await doit.reply(file=sticcers[0].document)
await a.delete()
@ultroid_cmd(pattern="quot ?(.*)")
async def quote_(event):
IFUZI = event.pattern_match.group(1)
if "quotly" in event.text:
return
if not IFUZI:
return await event.eor("`Give some text to make Quote..`")
EI_IR = await event.eor(get_string("com_1"))
try:
RE_ZK = await event.client.inline_query("@QuotAfBot", IFUZI)
await event.reply(file=choice(RE_ZK).document)
except Exception as U_TG:
return await EI_IR.edit(str(U_TG))
await EI_IR.delete()