Adaminfo commited on
Commit
188d3d9
·
verified ·
1 Parent(s): 961145d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import telebot
2
+
3
+ # تۆکنەکەت
4
+ API_TOKEN = '8348414728:AAEjH3r-OCM9DcyqmlD_K67MGfvG2u1Up_A'
5
+ bot = telebot.TeleBot(API_TOKEN)
6
+
7
+ # نەخشەی گۆڕینی پیتەکان
8
+ mapping = {
9
+ 'ڵ': 'll', 'ڕ': 'rr', 'چ': 'ch', 'ژ': 'zh', 'ۆ': 'o',
10
+ 'ێ': 'e', 'و': 'u', 'ی': 'y', 'گ': 'g', 'ڤ': 'v',
11
+ 'پ': 'p', 'ە': 'a', 'خ': 'kh', 'ح': 'h', 'ق': 'q',
12
+ 'ش': 'sh', 'ف': 'f', 'ک': 'k', 'ئ': ''
13
+ }
14
+
15
+ @bot.message_handler(commands=['start'])
16
+ def start(message):
17
+ bot.reply_to(message, "سڵاو لە BejerBot! دەقێکی کوردی بنێرە تا بۆت بکەم بە لاتینی.")
18
+
19
+ @bot.message_handler(func=lambda message: True)
20
+ def translate(message):
21
+ text = message.text
22
+ for k, v in mapping.items():
23
+ text = text.replace(k, v)
24
+ bot.reply_to(message, f"ئامادەیە بۆ AI:\n\n`{text}`", parse_mode='Markdown')
25
+
26
+ bot.infinity_polling()