-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathascii.py
88 lines (82 loc) · 3.14 KB
/
ascii.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
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from . import *
@bot.on(d3vil_cmd(pattern="ascii (.*)"))
@bot.on(sudo_cmd(pattern="ascii (.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await edit_or_reply(event, "Reply to any user message.😒🤐")
return
reply_message = await event.get_reply_message()
if not reply_message.media:
await edit_or_reply(event, "Reply to media message😒🤐")
return
bot = "@asciiart_bot"
d3vilkrish = await eor(event, "Wait making ASCII...🤓🔥🔥")
async with event.client.conversation(bot) as conv:
try:
first = await conv.send_message("/start")
response = await conv.get_response()
second = await conv.send_message(reply_message)
output_op = await conv.get_response()
last = await conv.get_response()
await event.client.send_read_acknowledge(conv.chat_id)
except YouBlockedUserError:
await d3vilkrish.edit("User Blocked!! Please Unblock @asciiart_bot and try again...")
return
await d3vilkrish.delete()
final = await event.client.send_file(
event.chat_id,
output_op,
)
await final.edit(
f"ASCII art By :- {d3vil_mention}")
await event.client.delete_messages(
conv.chat_id, [first.id, response.id, second.id, output_op.id, last.id]
)
@bot.on(d3vil_cmd(pattern="line (.*)"))
@bot.on(sudo_cmd(pattern="line (.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await edit_or_reply(event, "Reply to any user message.😒🤐")
return
reply_message = await event.get_reply_message()
if not reply_message.media:
await edit_or_reply(event, "Reply to media message😒🤐")
return
bot = "@lines50bot"
d3vilkrish = await eor(event, "`Processing...`")
async with event.client.conversation(bot) as conv:
try:
first = await conv.send_message("/start")
response = await conv.get_response()
second = await conv.send_message(reply_message)
output_op = await conv.get_response()
last = await conv.get_response()
await event.client.send_read_acknowledge(conv.chat_id)
except YouBlockedUserError:
await d3vilkrish.edit("User Blocked!! Please Unblock @Lines50Bot and try again...")
return
await d3vilkrish.delete()
final = await event.client.send_file(
event.chat_id,
output_op,
)
await final.edit(
f"Lines By :- {d3vil_mention}")
await event.client.delete_messages(
conv.chat_id, [first.id, response.id, second.id, output_op.id, last.id]
)
CmdHelp("ascii").add_command(
'ascii', 'reply to any image file', 'Makes an image ascii style, try out your own'
).add_command(
'line', 'reply to any image file', 'Makes an image in line style'
).add_info(
'Lines And Ascii'
).add_warning(
'✅ Harmless Module.'
).add()