Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from aiogram import Bot, Dispatcher, executor, types
|
| 2 |
+
from aiogram.types import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton
|
| 3 |
+
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
| 4 |
+
from random import randint
|
| 5 |
+
|
| 6 |
+
bot = Bot(token='5829401310:AAHHf2lK9fQ_orNGi70AyXxNDnb0ex9jABo')
|
| 7 |
+
dp = Dispatcher(bot)
|
| 8 |
+
button1 = InlineKeyboardButton(text="👑 ارتباط با ما", callback_data="randomvalue_of100",url="https://t.me/Nima41217")
|
| 9 |
+
button3 = InlineKeyboardButton(text="💋 چنل", callback_data="randomvalue_of100",url="https://t.me/CLUB_BCC")
|
| 10 |
+
button2 = InlineKeyboardButton(text="💬 گروه", callback_data="randomvalue_of100",url="https://t.me/+uNzCjN9S6L9iNjU0")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
keyboard_inline = InlineKeyboardMarkup().add(button3,button2,button1)
|
| 14 |
+
text =''' #WELCOM To Our Family 🏠
|
| 15 |
+
SUPER GAP 🔛ᯓ𝗖𝗟𝗨𝗕 𝗛𝗢𝗨𝗦𝗘
|
| 16 |
+
Voice Chat ✅ 24 🕧Active
|
| 17 |
+
Gap Chat ✅ 5 k🕓In Day
|
| 18 |
+
For Professional Members🧬 '''
|
| 19 |
+
|
| 20 |
+
keyboard1 = ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=True).add("👋 گروه!", "🚀 چنل","")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@dp.message_handler(commands=['random'])
|
| 24 |
+
async def random_answer(message: types.Message):
|
| 25 |
+
await message.answer_photo('https://raw.githubusercontent.com/g0d1t/xcvv/main/photo_2023-06-05_22-30-28.jpg',text, reply_markup=keyboard_inline)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
@dp.message_handler(commands=['start', 'help'])
|
| 30 |
+
async def welcome(message: types.Message):
|
| 31 |
+
await message.reply("سلام به ربات گرافیک سرعت خوش امدی", reply_markup=keyboard1)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@dp.callback_query_handler(text=["randomvalue_of10", "randomvalue_of100"])
|
| 35 |
+
async def random_value(call: types.CallbackQuery):
|
| 36 |
+
if call.data == "randomvalue_of10":
|
| 37 |
+
await call.message.answer(randint(1, 10))
|
| 38 |
+
if call.data == "randomvalue_of100":
|
| 39 |
+
await call.message.answer(randint(1, 100))
|
| 40 |
+
await call.answer()
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
@dp.message_handler()
|
| 44 |
+
async def kb_answer(message: types.Message):
|
| 45 |
+
if message.text == '👋 Hello!':
|
| 46 |
+
await message.reply("Hi! How are you?")
|
| 47 |
+
elif message.text == '💋 Youtube':
|
| 48 |
+
await message.reply("name")
|
| 49 |
+
else:
|
| 50 |
+
await message.reply(f"Your message is: {message.text}")
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
executor.start_polling(dp)
|