In general, it was necessary to do what the green, that is, stavka3 fell out with a very small probability, I sort of understood and wrote, but the question arose if the user bet on black or red how to do it would choose 50/50 and if the rate matches what it is introduced winnings

if (cmd.lower().startswith("рулетка")): try: c, i, a = cmd.lower().split() i = str(i) a = int(a) except ValueError: self.current.remove(msg.user_id) return await msg.answer("💬 .азино рулетка [цвет] (черный, красный, зеленый) [ставка] - сыграть в рулетку на указанную сумму.") except Exception: import traceback traceback.print_exc() self.current.remove(msg) return await msg.answer("Произошла ошибка.") if i == "черный" or i == "чёрный": stavka = 1 vivod = "🖤" elif i == "красный": stavka = 2 vivod = "❤" elif i == "зеленый" or i == "зелёный": stavka = 3 vivod = "💚" elif i == i: return await msg.answer("💬 Ты ввел неверный цвет доступные цвета (черный, красный, зеленый)") bett = a if bett < self.min_bet: self.current.remove(msg.user_id) return await msg.answer("💰 Минимальная ставка: 5.00$") if bett > 10000000: self.current.remove(msg.user_id) return await msg.answer("💰 Ставка, не больше чем 10.000.000$.") if p.balance - bett < 0: self.current.remove(msg.user_id) return await msg.answer(f"📛 У вас не хватает средств!\n💰 Наличные: {round(p.balance, 2)}$") p, _ = await self.pwmanager.get_or_create(self.player, user_id=msg.user_id) bot = random.randrange(1, 100) text = "" vivod2 = "" if stavka == 1 and bot == 1: text += f"➕ Тебе повезло! Ты выбрал {vivod}, и я выбрала {vivod}, ты получаешь " + str(bett * 2) + "$ (x2)" p.balance += bett * 2 elif stavka == 2 and bot == 2: text += f"➕ Тебе повезло! Ты выбрал {vivod}, и я выбрала {vivod}, ты получаешь " + str(bett * 2) + "$ (x2)" p.balance += bett * 2 elif stavka == 3 and bot <= 5: vivod2 = "💚" text += f"➕ Тебе повезло! Ты выбрал {vivod}, и я выбрала {vivod}, ты получаешь " + str(bett * 3) + "$ (x3)" p.balance += bett * 3 else: text += f"➖ Ха! Тебе не повезло! Ты выбрал {vivod}, а я выбрала {vivod2}, ты теряешь " + str(bett) + "$" p.balance -= bett text += f"\n💰 Наличные: {round(p.balance, 2)}$" await self.pwmanager.update(p) self.current.remove(msg.user_id) return await msg.answer(text) 
  • 3
    Remove parts of the code that are not needed to solve the problem (for example, those where characters are displayed, and some others). They add nothing, but only take away attention and time. - Enikeyschik
  • 2
    elif i == i - what is it about? - Enikeyschik
  • This is supposedly if the user entered the wrong color from the top, then displays the xd text, sorry for this bad code, I'm just here for a week) - Daeeros

0