File size: 5,508 Bytes
056f521
 
 
 
 
 
 
 
 
 
 
 
 
6cb6c86
056f521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# <============================================== IMPORTS =========================================================>
import random
from datetime import datetime

from pyrogram import filters

from Database.mongodb.karma_mongo import get_couple, save_couple
from Mikobot import app

# <=======================================================================================================>

# List of additional images
ADDITIONAL_IMAGES = [
    "https://files.catbox.moe/a1kkfb.jpg"
]


# <================================================ FUNCTION =======================================================>
def dt():
    now = datetime.now()
    dt_string = now.strftime("%d/%m/%Y %H:%M")
    dt_list = dt_string.split(" ")
    return dt_list


def dt_tom():
    a = (
        str(int(dt()[0].split("/")[0]) + 1)
        + "/"
        + dt()[0].split("/")[1]
        + "/"
        + dt()[0].split("/")[2]
    )
    return a


tomorrow = str(dt_tom())
today = str(dt()[0])

C = """
โ€ขโžต๐Ÿ’žเฟ ๐‡๐š๐ฉ๐ฉ๐ฒ ๐œ๐จ๐ฎ๐ฉ๐ฅ๐ž ๐จ๐Ÿ ๐ญ๐ก๐ž ๐๐š๐ฒ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข {} + ( PGM๐ŸŽ€๐Ÿ˜ถ (https://t.me/Chalnayaaaaaarr) + ่Šฑ็ซ (https://t.me/zd_sr07) + ใ‚ผใƒญใƒ„ใƒผ (https://t.me/wewewe_x) ) = ๐Ÿ’ž
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข ๐—ก๐—ฒ๐˜„ ๐—ฐ๐—ผ๐˜‚๐—ฝ๐—น๐—ฒ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฑ๐—ฎ๐˜† ๐—บ๐—ฎ๐˜†๐—ฏ๐—ฒ
โ”Š ๐—ฐ๐—ต๐—ผ๐˜€๐—ฒ๐—ป ๐—ฎ๐˜ 12AM {}
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
"""
CAP = """
โ€ขโžต๐Ÿ’žเฟ ๐‡๐š๐ฉ๐ฉ๐ฒ ๐œ๐จ๐ฎ๐ฉ๐ฅ๐ž ๐จ๐Ÿ ๐ญ๐ก๐ž ๐๐š๐ฒ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข {} + {} = ๐Ÿ’ž
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข ๐—ก๐—ฒ๐˜„ ๐—ฐ๐—ผ๐˜‚๐—ฝ๐—น๐—ฒ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฑ๐—ฎ๐˜† ๐—บ๐—ฎ๐˜†๐—ฏ๐—ฒ
โ”Š ๐—ฐ๐—ต๐—ผ๐˜€๐—ฒ๐—ป ๐—ฎ๐˜ 12AM {}
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
"""

CAP2 = """
โ€ขโžต๐Ÿ’žเฟ ๐‡๐š๐ฉ๐ฉ๐ฒ ๐œ๐จ๐ฎ๐ฉ๐ฅ๐ž ๐จ๐Ÿ ๐ญ๐ก๐ž ๐๐š๐ฒ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Š{} (tg://openmessage?user_id={}) + {} (tg://openmessage?user_id={}) = ๐Ÿ’ž\n
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข ๐—ก๐—ฒ๐˜„ ๐—ฐ๐—ผ๐˜‚๐—ฝ๐—น๐—ฒ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฑ๐—ฎ๐˜† ๐—บ๐—ฎ๐˜†๐—ฏ๐—ฒ
โ”Š ๐—ฐ๐—ต๐—ผ๐˜€๐—ฒ๐—ป ๐—ฎ๐˜ 12AM {}
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
"""


@app.on_message(filters.command(["couple", "couples", "shipping"]) & ~filters.private)
async def nibba_nibbi(_, message):
    COUPLES_PIC = random.choice(ADDITIONAL_IMAGES)  # Move inside the command function
    if message.from_user.id == 5540249238:
        my_ = await _.get_users("rfxtuv")
        me = await _.get_users(5540249238)
        await message.reply_photo(
            photo=COUPLES_PIC, caption=C.format(me.mention, tomorrow)
        )
    else:
        try:
            chat_id = message.chat.id
            is_selected = await get_couple(chat_id, today)
            if not is_selected:
                list_of_users = []
                async for i in _.get_chat_members(message.chat.id, limit=50):
                    if not i.user.is_bot:
                        list_of_users.append(i.user.id)
                if len(list_of_users) < 2:
                    return await message.reply_text("Not enough users in the group.")
                c1_id = random.choice(list_of_users)
                c2_id = random.choice(list_of_users)
                while c1_id == c2_id:
                    c1_id = random.choice(list_of_users)
                c1_mention = (await _.get_users(c1_id)).mention
                c2_mention = (await _.get_users(c2_id)).mention
                await _.send_photo(
                    message.chat.id,
                    photo=COUPLES_PIC,
                    caption=CAP.format(c1_mention, c2_mention, tomorrow),
                )

                couple = {"c1_id": c1_id, "c2_id": c2_id}
                await save_couple(chat_id, today, couple)

            elif is_selected:
                c1_id = int(is_selected["c1_id"])
                c2_id = int(is_selected["c2_id"])

                c1_name = (await _.get_users(c1_id)).first_name
                c2_name = (await _.get_users(c2_id)).first_name
                print(c1_id, c2_id, c1_name, c2_name)
                couple_selection_message = f"""โ€ขโžต๐Ÿ’žเฟ ๐‡๐š๐ฉ๐ฉ๐ฒ ๐œ๐จ๐ฎ๐ฉ๐ฅ๐ž ๐จ๐Ÿ ๐ญ๐ก๐ž ๐๐š๐ฒ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข [{c1_name}](tg://openmessage?user_id={c1_id}) + [{c2_name}](tg://openmessage?user_id={c2_id}) = ๐Ÿ’ž
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”Šโ€ขโžข ๐—ก๐—ฒ๐˜„ ๐—ฐ๐—ผ๐˜‚๐—ฝ๐—น๐—ฒ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฑ๐—ฎ๐˜† ๐—บ๐—ฎ๐˜†๐—ฏ๐—ฒ
โ”Š ๐—ฐ๐—ต๐—ผ๐˜€๐—ฒ๐—ป ๐—ฎ๐˜ 12AM {tomorrow}
โ•ฐโ”€โ”€โ”€โ€ขโžขโ™ก"""
                await _.send_photo(
                    message.chat.id, photo=COUPLES_PIC, caption=couple_selection_message
                )
        except Exception as e:
            print(e)
            await message.reply_text(str(e))


# <=================================================== HELP ====================================================>
__help__ = """
๐Ÿ’˜ *Choose couples in your chat*

โžฆ /couple, /couples, /shipping *:* Choose 2 users and send their names as couples in your chat.
"""

__mod_name__ = "COUPLE"
# <================================================ END =======================================================>