Answer the question
In order to leave comments, you need to log in
Is there a converter from aiogram to telebot?
I found the game code for the bot
, but it is for aiograms, I don’t understand it and I can’t redo it myself ..
@dp.message_handler(regexp=r"(^Куб|куб) ?(\d+)? ?(\d+)?")
async def process_start_command(message: types.Message):
stts = cur.execute("SELECT user_status from users where userid = ?", (message.from_user.id,)).fetchone()
status = (stts[0])
command_parse = re.compile(r"(^Куб|куб) ?(\d+)? ?(\d+)?")
parsed = command_parse.match(message.text)
dice_value = parsed.group(2)
dice_value = int(dice_value)
summ = parsed.group(3)
summ = (summ)
name1 = message.from_user.get_mention(as_html=True)
if str(status) == 'Спонсор бота':
if int(summ) <= int(275000000000):
if dice_value > 6:
await message.reply(f"<b>{name1}</b> введите сообщение в формате: \n<b>Куб (число от 1 до 6) (ставка)</b>", parse_mode='html')
else:
if not summ:
await message.reply(f"<b>{name1}</b> введите сообщение в формате: \n<b>Куб (число от 1 до 6) (ставка)</b>", parse_mode='html')
else:
if not dice_value:
await message.reply(f"<b>{name1}</b> введите сообщение в формате: \n<b>Куб (число от 1 до 6) (ставка)</b>", parse_mode='html')
else:
balanc = cur.execute("SELECT balance from users where userid = ?", (message.from_user.id,)).fetchone()
balance = (balanc[0])
summ = int(summ)
if balance >= summ:
dice_value = int(dice_value)
bot_data = await bot.send_dice (message.chat.id)
bot_data = bot_data['dice']['value']
plus = bot_data + 1
minus = bot_data - 1
summ2 = summ * 10
data = {}
data["suma"] = summ
data['user_id'] = message.from_user.id
data1 = {}
data1["suma"] = summ2
data1['user_id'] = message.from_user.id
await sleep(5)
if bot_data > dice_value:
await message.reply( f'{name1} ты проиграл(а) <b>{summ}</b>', parse_mode='html')
cur.execute("""UPDATE users SET balance = balance - :suma WHERE userid = :user_id;""", data)
elif bot_data < dice_value:
await message.reply( f'{name1} ты проиграл(а) <b>{summ}</b>', parse_mode='html')
cur.execute("""UPDATE users SET balance = balance - :suma WHERE userid = :user_id;""", data)
else:
await message.reply( f'{name1} ты выиграл(а) <b>{summ2}</b>', parse_mode='html')
cur.execute("""UPDATE users SET balance = balance + :suma WHERE userid = :user_id;""", data1)
conn.commit()
elif balance < summ:
balanc = cur.execute("SELECT balance from users where userid = ?", (message.from_user.id,)).fetchone()
balance = (balanc[0])
await message.reply( f'{name1} у тебя нет столько \nТвой баланс:{balance} ', parse_mode='html')
else:
await message.reply( f'{name1} нельзя играть на сумы более <code>275000000000</code>', parse_mode='html')
Answer the question
In order to leave comments, you need to log in
Is there a converter from aiogram to telebot?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question