-
Notifications
You must be signed in to change notification settings - Fork 1
/
memevoice.py
69 lines (62 loc) · 2.26 KB
/
memevoice.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
import re
from . import *
# Credits goes to developer of D3vilBot.
# This is first plugin that he made when he released first D3vilBot.
# Modified to work in groups with inline mode disabled.
# Added error msg if no voice is found.
# So please dont remove credit.
# You can use it in your repo. But dont remove these lines...
#Now this plugin on D3VIL BOT
@bot.on(d3vil_cmd(pattern="mev(?: |$)(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="mev(?: |$)(.*)", allow_sudo=True))
async def nope(d3vilkrish):
d3vil = d3vilkrish.pattern_match.group(1)
if not d3vil:
if d3vilkrish.is_reply:
(await d3vilkrish.get_reply_message()).message
else:
await edit_or_reply(d3vilkrish, "`Sir please give some query to search and download it for you..!`"
)
return
troll = await bot.inline_query("TrollVoiceBot", f"{(deEmojify(d3vil))}")
if troll:
await d3vilkrish.delete()
d3vl_ = await troll[0].click(Config.LOGGER_ID)
if d3vl_:
await bot.send_file(
d3vilkrish.chat_id,
d3vl_,
caption="",
)
await d3vl_.delete()
else:
await eod(d3vilkrish, "**Error 404:** Not Found")
@bot.on(d3vil_cmd(pattern="meev(?: |$)(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="meev(?: |$)(.*)", allow_sudo=True))
async def nope(d3vilkrish):
d3vil = d3vilkrish.pattern_match.group(1)
if not d3vil:
if d3vilkrish.is_reply:
(await d3vilkrish.get_reply_message()).message
else:
await edit_or_reply(d3vilkrish, "`Sir please give some query to search and download it for you..!`"
)
return
troll = await bot.inline_query("Myinstantsbot", f"{(deEmojify(d3vil))}")
if troll:
await d3vilkrish.delete()
d3vl_ = await troll[0].click(Config.LOGGER_ID)
if d3vl_:
await bot.send_file(
d3vilkrish.chat_id,
d3vl_,
caption="",
)
await d3vl_.delete()
else:
await eod(d3vilkrish, "**Error 404:** Not Found")
CmdHelp("memevoice").add_command(
"mev", "<query>", "Searches the given meme and sends audio if found."
).add_command(
"meev", "<query>", "Same as {hl}mev"
).add()