Adaminfo commited on
Commit
a3d5beb
·
verified ·
1 Parent(s): f21bb1e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -0
app.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import telebot
2
+
3
+ # تۆکنی نوێی بۆتەکەت
4
+ API_TOKEN = '8154665211:AAHezNZju3Mh7arPzmJjZuapRQb4n3tq2IU'
5
+ bot = telebot.TeleBot(API_TOKEN)
6
+
7
+ # فەرهەنگی گۆڕینی پیتەکان (بۆ ئەوەی AI بە دروستی بیخوێنێتەوە)
8
+ mapping = {
9
+ 'ڵ': 'll', 'ڕ': 'rr', 'چ': 'ch', 'ژ': 'zh', 'ۆ': 'o',
10
+ 'ێ': 'e', 'و': 'u', 'ی': 'y', 'گ': 'g', 'ڤ': 'v',
11
+ 'پ': 'p', 'ە': 'a', 'خ': 'kh', 'ح': 'h', 'ق': 'q',
12
+ 'ش': 'sh', 'ف': 'f', 'ک': 'k', 'ئ': '', 'ت': 't',
13
+ 'ب': 'b', 'ج': 'j', 'د': 'd', 'ر': 'r', 'ز': 'z',
14
+ 'س': 's', 'ل': 'l', 'م': 'm', 'ن': 'n', 'ه': 'h'
15
+ }
16
+
17
+ @bot.message_handler(commands=['start'])
18
+ def send_welcome(message):
19
+ welcome_msg = (
20
+ "سڵاو، من بۆتی (بێژەر - Bejer)م! 🎙️\n\n"
21
+ "دەقێکی کوردیم بۆ بنێرە، منیش بۆت دەکەم بە لاتینی تا لە بەرنامەکانی دەنگی زیرەکی دەستکرد (AI Voice) بەکاری بهێنیت."
22
+ )
23
+ bot.reply_to(message, welcome_msg)
24
+
25
+ @bot.message_handler(func=lambda message: True)
26
+ def translate_text(message):
27
+ text = message.text
28
+ latin_text = text
29
+
30
+ # پرۆسەی گۆڕینی پیتەکان
31
+ for kurdish, latin in mapping.items():
32
+ latin_text = latin_text.replace(kurdish, latin)
33
+
34
+ response = (
35
+ "✅ دەقی ئامادەکراو بۆ AI:\n\n"
36
+ f"`{latin_text}`"
37
+ )
38
+ bot.reply_to(message, response, parse_mode='Markdown')
39
+
40
+ print("بۆتی بێژەر دەستی بەکار کرد...")
41
+ bot.infinity_polling()