# made by Bharath. for ultroid
# idea from Calsi-bot dev's wish cmd

"""
✘ Commands Available -

•  {i}wish - `some text`
      Wishes do come true, sometimes 😹 🙌
"""

import random

from . import *


@ultroid_cmd(pattern="wish ?(.*)")
async def cast(wish):
    bish = wish.pattern_match.group(1)
    if not bish:
        return await eod(wish, "`I can't fulfill empty wishes`")
    edits_ = await eor(wish, "`. . .`")

    rand_num = random.randint(0, 100)
    if rand_num > 54:
        congo = "Congratulations, Odds are in your favour"
    elif rand_num < 45:
        congo = "Luck doesn't seem to favour you on this one"
    else:
        congo = "This wish can go Either ways!"
    my_wish = f"**Your Wish:** __{bish}__ **has been Casted.**\n\n"
    my_wish += f"**Chance of Success: {rand_num}% ✨**\n\n"
    my_wish += f"__{congo}__"

    await wish.respond(my_wish)
    if rand_num > 49:  # cheap thrills 😹
        await eod(edits_, "✨", time=4)
    else:
        await eod(edits_, "😕", time=4)
    
  
  
HELP.update({f"{__name__.split('.')[1]}": f"{__doc__.format(i=HNDLR)}"})