randydev commited on
Commit
efb1176
ยท
verified ยท
1 Parent(s): 9bb1551

Create commands.py

Browse files
Files changed (1) hide show
  1. 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