Create commands.py
Browse files- stylish/module/commands.py +201 -0
stylish/module/commands.py
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from config import Config
|
3 |
+
from stylish.modules.fonts import Fonts
|
4 |
+
from pyrogram import Client, filters
|
5 |
+
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
6 |
+
|
7 |
+
|
8 |
+
@Client.on_message(filters.command('start'))
|
9 |
+
async def start(c, m):
|
10 |
+
# start text
|
11 |
+
text = f"""Hey! {m.from_user.mention(style='md')},
|
12 |
+
|
13 |
+
๐ก ** I am Stylish Font Bot**
|
14 |
+
|
15 |
+
โข `Saya dapat membantu Anda untuk mendapatkan font bergaya. Kirimkan saja saya beberapa teks dan lihat keajaiban.`
|
16 |
+
|
17 |
+
โข `ketik Hello World.`
|
18 |
+
"""
|
19 |
+
|
20 |
+
# Buttons
|
21 |
+
buttons = [
|
22 |
+
[
|
23 |
+
InlineKeyboardButton('Developer', url=f"https://t.me/xtsea"),
|
24 |
+
InlineKeyboardButton('Channel', url='https://t.me/RendyProjects'),
|
25 |
+
],
|
26 |
+
[
|
27 |
+
InlineKeyboardButton('Fonts Via Web', url='https://fsymbols.com/generators/smallcaps/')
|
28 |
+
]
|
29 |
+
]
|
30 |
+
await m.reply_text(
|
31 |
+
text=text,
|
32 |
+
disable_web_page_preview=True,
|
33 |
+
reply_markup=InlineKeyboardMarkup(buttons)
|
34 |
+
)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
@Client.on_message(filters.private & filters.incoming & filters.text)
|
39 |
+
async def style_buttons(c, m, cb=False):
|
40 |
+
buttons = [[
|
41 |
+
InlineKeyboardButton('๐๐ข๐๐๐ ๐๐๐๐๐', callback_data='style+typewriter'),
|
42 |
+
InlineKeyboardButton('๐๐ฆ๐ฅ๐๐๐๐', callback_data='style+outline'),
|
43 |
+
InlineKeyboardButton('๐๐๐ซ๐ข๐', callback_data='style+serif'),
|
44 |
+
],[
|
45 |
+
InlineKeyboardButton('๐บ๐๐๐๐', callback_data='style+bold_cool'),
|
46 |
+
InlineKeyboardButton('๐๐๐๐๐', callback_data='style+cool'),
|
47 |
+
InlineKeyboardButton('Sแดแดสส Cแดแดs', callback_data='style+small_cap'),
|
48 |
+
],[
|
49 |
+
InlineKeyboardButton('๐๐ธ๐๐พ๐
๐', callback_data='style+script'),
|
50 |
+
InlineKeyboardButton('๐ผ๐ฌ๐ป๐ฒ๐น๐ฝ', callback_data='style+script_bolt'),
|
51 |
+
InlineKeyboardButton('แตโฑโฟสธ', callback_data='style+tiny'),
|
52 |
+
],[
|
53 |
+
InlineKeyboardButton('แOแฐIแ', callback_data='style+comic'),
|
54 |
+
InlineKeyboardButton('๐ฆ๐ฎ๐ป๐', callback_data='style+sans'),
|
55 |
+
InlineKeyboardButton('๐๐๐ฃ๐จ', callback_data='style+slant_sans'),
|
56 |
+
],[
|
57 |
+
InlineKeyboardButton('๐๐ข๐ฏ๐ด', callback_data='style+slant'),
|
58 |
+
InlineKeyboardButton('๐ฒ๐บ๐๐', callback_data='style+sim'),
|
59 |
+
InlineKeyboardButton('โธ๏ธโพ๏ธโ๏ธโธ๏ธโ๏ธโบ๏ธโ๏ธ', callback_data='style+circles'),
|
60 |
+
],[
|
61 |
+
InlineKeyboardButton('๐
๏ธ๐
๏ธ๐
ก๏ธ๐
๏ธ๐
๏ธ๐
๏ธ๐
ข๏ธ', callback_data='style+circle_dark'),
|
62 |
+
InlineKeyboardButton('๐๐ฌ๐ฑ๐ฅ๐ฆ๐ ', callback_data='style+gothic'),
|
63 |
+
InlineKeyboardButton('๐ฒ๐๐๐๐๐', callback_data='style+gothic_bolt'),
|
64 |
+
],[
|
65 |
+
InlineKeyboardButton('Cอกอlอกอoอกอuอกอdอกอsอกอ', callback_data='style+cloud'),
|
66 |
+
InlineKeyboardButton('Hฬฬaฬฬpฬฬpฬฬyฬฬ', callback_data='style+happy'),
|
67 |
+
InlineKeyboardButton('Sฬฬaฬฬdฬฬ', callback_data='style+sad'),
|
68 |
+
],[
|
69 |
+
InlineKeyboardButton('Next โก๏ธ', callback_data="nxt")
|
70 |
+
]]
|
71 |
+
if not cb:
|
72 |
+
await m.reply_text(m.text, reply_markup=InlineKeyboardMarkup(buttons), quote=True)
|
73 |
+
else:
|
74 |
+
await m.answer()
|
75 |
+
await m.message.edit_reply_markup(InlineKeyboardMarkup(buttons))
|
76 |
+
|
77 |
+
|
78 |
+
@Client.on_callback_query(filters.regex('^nxt'))
|
79 |
+
async def nxt(c, m):
|
80 |
+
if m.data == "nxt":
|
81 |
+
buttons = [[
|
82 |
+
InlineKeyboardButton('๐ธโ๐ตโ๐ชโ๐จโ๐ฎโ๐ฆโ๐ฑโ', callback_data='style+special'),
|
83 |
+
InlineKeyboardButton('๐
๐
๐
๐ฐ๐
๐ด๐
', callback_data='style+squares'),
|
84 |
+
InlineKeyboardButton('๐๏ธ๐๏ธ๐๏ธ๐
ฐ๏ธ๐๏ธ๐
ด๏ธ๐๏ธ', callback_data='style+squares_bold'),
|
85 |
+
],[
|
86 |
+
InlineKeyboardButton('๊ช๊ชแฆ๊ช๊ชถ๊ชแฅด๐ฒ๊ช', callback_data='style+andalucia'),
|
87 |
+
InlineKeyboardButton('็ชๅๅ แๅ', callback_data='style+manga'),
|
88 |
+
InlineKeyboardButton('Sฬพtฬพiฬพnฬพkฬพyฬพ', callback_data='style+stinky'),
|
89 |
+
],[
|
90 |
+
InlineKeyboardButton('Bอฆฬฅuอฆฬฅbอฆฬฅbอฆฬฅlอฆฬฅeอฆฬฅsอฆฬฅ', callback_data='style+bubbles'),
|
91 |
+
InlineKeyboardButton('Uอnอdอeอrอlอiอnอeอ', callback_data='style+underline'),
|
92 |
+
InlineKeyboardButton('๊๊๊ท๊ฉ๊๊๊
', callback_data='style+ladybug'),
|
93 |
+
],[
|
94 |
+
InlineKeyboardButton('Rาaาyาsา', callback_data='style+rays'),
|
95 |
+
InlineKeyboardButton('Bาiาrาdาsา', callback_data='style+birds'),
|
96 |
+
InlineKeyboardButton('Sฬธlฬธaฬธsฬธhฬธ', callback_data='style+slash'),
|
97 |
+
],[
|
98 |
+
InlineKeyboardButton('sโ tโ oโ pโ ', callback_data='style+stop'),
|
99 |
+
InlineKeyboardButton('Sอฬบkอฬบyอฬบlอฬบiอฬบnอฬบeอฬบ', callback_data='style+skyline'),
|
100 |
+
InlineKeyboardButton('Aอrอrอoอwอsอ', callback_data='style+arrows'),
|
101 |
+
],[
|
102 |
+
InlineKeyboardButton('แชแแญแฟแ', callback_data='style+qvnes'),
|
103 |
+
InlineKeyboardButton('Sฬถtฬถrฬถiฬถkฬถeฬถ', callback_data='style+strike'),
|
104 |
+
InlineKeyboardButton('Fเผrเผoเผzเผeเผnเผ', callback_data='style+frozen')
|
105 |
+
],[
|
106 |
+
InlineKeyboardButton('โฌ
๏ธ Back', callback_data='nxt+0')
|
107 |
+
]]
|
108 |
+
await m.answer()
|
109 |
+
await m.message.edit_reply_markup(InlineKeyboardMarkup(buttons))
|
110 |
+
else:
|
111 |
+
await style_buttons(c, m, cb=True)
|
112 |
+
|
113 |
+
|
114 |
+
@Client.on_callback_query(filters.regex('^style'))
|
115 |
+
async def style(c, m):
|
116 |
+
await m.answer()
|
117 |
+
cmd, style = m.data.split('+')
|
118 |
+
|
119 |
+
if style == 'typewriter':
|
120 |
+
cls = Fonts.typewriter
|
121 |
+
if style == 'outline':
|
122 |
+
cls = Fonts.outline
|
123 |
+
if style == 'serif':
|
124 |
+
cls = Fonts.serief
|
125 |
+
if style == 'bold_cool':
|
126 |
+
cls = Fonts.bold_cool
|
127 |
+
if style == 'cool':
|
128 |
+
cls = Fonts.cool
|
129 |
+
if style == 'small_cap':
|
130 |
+
cls = Fonts.smallcap
|
131 |
+
if style == 'script':
|
132 |
+
cls = Fonts.script
|
133 |
+
if style == 'script_bolt':
|
134 |
+
cls = Fonts.bold_script
|
135 |
+
if style == 'tiny':
|
136 |
+
cls = Fonts.tiny
|
137 |
+
if style == 'comic':
|
138 |
+
cls = Fonts.comic
|
139 |
+
if style == 'sans':
|
140 |
+
cls = Fonts.san
|
141 |
+
if style == 'slant_sans':
|
142 |
+
cls = Fonts.slant_san
|
143 |
+
if style == 'slant':
|
144 |
+
cls = Fonts.slant
|
145 |
+
if style == 'sim':
|
146 |
+
cls = Fonts.sim
|
147 |
+
if style == 'circles':
|
148 |
+
cls = Fonts.circles
|
149 |
+
if style == 'circle_dark':
|
150 |
+
cls = Fonts.dark_circle
|
151 |
+
if style == 'gothic':
|
152 |
+
cls = Fonts.gothic
|
153 |
+
if style == 'gothic_bolt':
|
154 |
+
cls = Fonts.bold_gothic
|
155 |
+
if style == 'cloud':
|
156 |
+
cls = Fonts.cloud
|
157 |
+
if style == 'happy':
|
158 |
+
cls = Fonts.happy
|
159 |
+
if style == 'sad':
|
160 |
+
cls = Fonts.sad
|
161 |
+
if style == 'special':
|
162 |
+
cls = Fonts.special
|
163 |
+
if style == 'squares':
|
164 |
+
cls = Fonts.square
|
165 |
+
if style == 'squares_bold':
|
166 |
+
cls = Fonts.dark_square
|
167 |
+
if style == 'andalucia':
|
168 |
+
cls = Fonts.andalucia
|
169 |
+
if style == 'manga':
|
170 |
+
cls = Fonts.manga
|
171 |
+
if style == 'stinky':
|
172 |
+
cls = Fonts.stinky
|
173 |
+
if style == 'bubbles':
|
174 |
+
cls = Fonts.bubbles
|
175 |
+
if style == 'underline':
|
176 |
+
cls = Fonts.underline
|
177 |
+
if style == 'ladybug':
|
178 |
+
cls = Fonts.ladybug
|
179 |
+
if style == 'rays':
|
180 |
+
cls = Fonts.rays
|
181 |
+
if style == 'birds':
|
182 |
+
cls = Fonts.birds
|
183 |
+
if style == 'slash':
|
184 |
+
cls = Fonts.slash
|
185 |
+
if style == 'stop':
|
186 |
+
cls = Fonts.stop
|
187 |
+
if style == 'skyline':
|
188 |
+
cls = Fonts.skyline
|
189 |
+
if style == 'arrows':
|
190 |
+
cls = Fonts.arrows
|
191 |
+
if style == 'qvnes':
|
192 |
+
cls = Fonts.rvnes
|
193 |
+
if style == 'strike':
|
194 |
+
cls = Fonts.strike
|
195 |
+
if style == 'frozen':
|
196 |
+
cls = Fonts.frozen
|
197 |
+
new_text = cls(m.message.reply_to_message.text)
|
198 |
+
try:
|
199 |
+
await m.message.edit_text(new_text, reply_markup=m.message.reply_markup)
|
200 |
+
except:
|
201 |
+
pass
|