Пример #1
0
def Your_Code(update, context):

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    Send.Message(Bot_Variables, "hello")

    Send.Edited_Inline_Keyboard(Bot_Variables, "Text Here",
                                Button.Inline(["c", "Alert", "Alert"]),
                                Button.Inline(["c", "Answer", "Answer"]))
Пример #2
0
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
Пример #3
0
def Func(Bot_Variables):

    Message = Bot_Variables[4]

    User_Privileges = Bot_Variables[8]

    if User_Privileges == "root":

        if Message == "root":
            Send.Keyboard(Bot_Variables, "root", Button.Markup("Users"),
                          Button.Markup("Add Privileges"))
Пример #4
0
def Func(Bot_Variables):
    Users = Bot_Variables[10][0]

    Users_count = Users.find({}).count()

    capacity = len(configure.TOKENS) * configure.Users_Per_Bot

    capacity_presents = (int(Users_count) / int(capacity)) * 100

    if capacity_presents > float(configure.presents):

        chat_ids = Users.find({"user privileges": "root"})
        chat_ids_count = Users.find({"user privileges": "root"}).count()

        for i in range(chat_ids_count):

            Send.Message([Bot_Variables[0], chat_ids[i]["chat_id"]],
                         "bots users capacity has reach " +
                         str(float(capacity_presents)) + "%\n Users " +
                         str(Users_count) + "/" + str(capacity))
def Func(Bot_Variables):

    Chat_ID = Bot_Variables[1]

    Message = Bot_Variables[4]
    Users = Bot_Variables[10][0]
    update = Bot_Variables[12]
    context = Bot_Variables[14]

    Users.update_one({"chat_id": Chat_ID}, {"$set": {"neshama.name": Message}})

    write_type = Users.find_one({"chat_id": Chat_ID})["write_type"]

    Send.Inline_Keyboard(
        Bot_Variables, send_neshama.Func(Message[0], Bot_Variables),
        Button.Inline(["C", "⬅️", rolling_left.Func(write_type)],
                      ["C", "➡️", rolling_right.Func(write_type)]))

    Users.update_one({"chat_id": Chat_ID},
                     {"$set": {
                         "virtual_location": "עוד ➕"
                     }})
    Users.update_one({"chat_id": Chat_ID}, {"$set": {"neshama.place": 0}})
Пример #6
0
def Your_Code(update, context):
    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]

    user = Users.find_one({"chat_id": Chat_ID})

    chapter = int(user["book"]["bookmark"])
    favorites = user["favorites"]

    book_chapters = user["book"]["chapters"]
    write_type = user["write_type"]

    if chapter not in favorites:
        favorites.append(chapter)

        Users.update_one({"chat_id": Chat_ID},
                         {"$set": {
                             "favorites": favorites
                         }})

        Send.Callback_Answer(
            Bot_Variables, "פרק " + str(int_to_gematria(chapter + 1)) + " (" +
            str(chapter + 1) + ")" + " נוסף למועדפים ✅")

        Send.Edited_Inline_Keyboard(
            Bot_Variables, send_neshama.Func(chapter, Bot_Variables),
            Button.Inline(["C", "⬅️", rolling_left.Func(write_type)], [
                "C",
                favoriets_name.Func(update, context), "Favorite_neshama"
            ], ["C", "➡️", rolling_right.Func(write_type)]),
            Button.Inline(
                ["C",
                 is_read_name.Func(update, context), "is_read_neshama"]))

    else:

        favorites.remove(chapter)
        Users.update_one({"chat_id": Chat_ID},
                         {"$set": {
                             "favorites": favorites
                         }})
        Send.Callback_Answer(
            Bot_Variables, "פרק " + str(int_to_gematria(chapter + 1)) + " (" +
            str(chapter + 1) + ")" + " הוסר ממועדפים 🚫")

        Send.Edited_Inline_Keyboard(
            Bot_Variables, send_neshama.Func(chapter, Bot_Variables),
            Button.Inline(["C", "⬅️", rolling_left.Func(write_type)], [
                "C",
                favoriets_name.Func(update, context), "Favorite_neshama"
            ], ["C", "➡️", rolling_right.Func(write_type)]),
            Button.Inline(
                ["C",
                 is_read_name.Func(update, context), "is_read_neshama"]))
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]

    Users = Bot_Variables[10][0]

    user = Users.find_one({"chat_id": Chat_ID})

    chapters = user["stats_chapters"]

    c_count = 0
    t_count = 0

    arrey_chap = []
    for i in range(150):
        try:
            c_count = c_count + chapters[str(i)]
            arrey_chap.append(int(chapters[str(i)]))
        except:
            arrey_chap.append(0)

    t_count = min(arrey_chap)

    chapters_left = 150 - len(user["book"]["chapters"])
    text = """
    
פרקים שנשארו לסיום בסיבוב הנוכחי : {} 
   
מספר פרקים כולל שקראת: {}
    
מספר פעמים שסיימת את התהילים: {}
   
   
    """.format(chapters_left, c_count, t_count)

    Send.Message(Bot_Variables, text)
Пример #8
0
def Func(update,context):

    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update,context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """


    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """



    Message = Bot_Variables[4]

    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]
    Names = Bot_Variables[10][2]

    Users.update_one({"chat_id": Chat_ID}, {"$set": {"virtual_location" : "איזור אישי 🙎‍♂️"}})

    Names.update_one({"chat_id": Chat_ID,"status": "pending"}, {"$set": {"for":Message}})





    for_name = Message + " "+ Names.find_one({"chat_id":Chat_ID,"status":"pending"})["name"]


    text = """
    דוגמא איך יראה פרק תהילים כשמשתמש יקבל אותו עם השם שרשמת:
    
מספר הפרקים שנקראו על שם {}: 0 ( % 0.0  )
מספר פרקים שנשארו לסיום התהילים על שמו: 150 ( % 100.0  )

פרק: קל״ח ( 138 )

{}

לְדָוִד אוֹדְךָ בְכָל־לִבִּי נֶגֶד אֱלֹהִים אֲזַמְּרֶךָּ׃ אֶשְׁתַּחֲוֶה אֶל־הֵיכַל קָדְשְׁךָ וְאוֹדֶה אֶת־שְׁמֶךָ עַל־חַסְדְּךָ וְעַל־אֲמִתֶּךָ כִּי־הִגְדַּלְתָּ עַל־כָּל־שִׁמְךָ אִמְרָתֶךָ׃ בְּיוֹם קָרָאתִי וַתַּעֲנֵנִי תַּרְהִבֵנִי בְנַפְשִׁי עֹז׃ יוֹדוּךָ יְהוָה כָּל־מַלְכֵי־אָרֶץ כִּי שָׁמְעוּ אִמְרֵי־פִיךָ׃ וְיָשִׁירוּ בְּדַרְכֵי יְהוָה כִּי גָדוֹל כְּבוֹד יְהוָה׃ כִּי־רָם יְהוָה וְשָׁפָל יִרְאֶה וְגָבֹהַּ מִמֶּרְחָק יְיֵדָע׃ אִם־אֵלֵךְ בְּקֶרֶב צָרָה תְּחַיֵּנִי עַל אַף אֹיְבַי תִּשְׁלַח יָדֶךָ וְתוֹשִׁיעֵנִי יְמִינֶךָ׃ יְהוָה יִגְמֹר בַּעֲדִי יְהוָה חַסְדְּךָ לְעוֹלָם מַעֲשֵׂי יָדֶיךָ אַל־תֶּרֶף׃
    
    """.format(for_name,for_name)

    Send.Inline_Keyboard(Bot_Variables, text,
                         Button.Inline(
                                       ["C", "✅ אשר ופרסם ✅", "aproove_post"],
                             ["C", "🖌️ ערוך שוב 🖌️", "post_name"]

                         ),

    Button.Inline(
        ["C", "❌ ביטול ❌", "canel_post"],


    )

                         )
Пример #9
0
def Your_Code(update,context):

    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update,context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """

    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """



    Users = Bot_Variables[10][0]


    Chat_ID = Bot_Variables[1]

    Users.update_one({"chat_id": Chat_ID}, {"$set": {"random_chapter" : 92}})


    Send.Inline_Keyboard(Bot_Variables, Send_Book.Func(92,Bot_Variables),
                         Button.Inline(
                                       ["C", favoriets_name.Func(update,context), "add_random_chapter_to_favoeites"]),
                         Button.Inline(["C", "🔴 סמן כנקרא 🔴", "mark_random_as_read"])
                         )
def Func(update,context):

    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update,context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """


    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """
    Users = Bot_Variables[10][0]
    Chat_ID = Bot_Variables[1]

    favirites = Users.find_one({"chat_id":Chat_ID})["favorites"]





    Inline_Keyboard = {'inline_keyboard': []}

    Buttons = []

    bot_name = telegram.Bot(Bot_Variables[0]).get_me().username

    for i in range(int(len(favirites))):

                link = "https://t.me/" +bot_name +"?start=T{}"

                url = link.format(str(favirites[i]))
                Buttons.append( [{'text': int_to_gematria(favirites[i]+1), 'url':url}])

    Json_Message = Bot_Variables[11]

    Inline_Keyboard = {'inline_keyboard': [ ]}

    for i in range(len(Buttons)):
        Inline_Keyboard["inline_keyboard"].append(Buttons[i])

    Json_Message.reply_text("פרקים מועדפים ⭐️",reply_markup=Inline_Keyboard)
def Your_Code(update, context):
    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]
    Names = Bot_Variables[10][2]

    Send.Message(Bot_Variables, "✅ פורסם בהצלחה ✅")
    user = Names.find_one({"chat_id": Chat_ID, "status": "pending"})

    link = user["link"]
    name = user["name"]
    to = user["for"]
    Names.update_one({
        "chat_id": Chat_ID,
        "status": "pending"
    }, {"$set": {
        "status": "in progress"
    }})

    text = "לינק אישי: {} \nפרסמו לינק זה לחברים כדי שישתתפו בקריאת התהילים {} {}".format(
        link, to, name)

    Send.Message(Bot_Variables, text)
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    text = "לחיפוש שלחו כאן את הפרק שברצונכם לקבל, ניתן לחפש על ידי מספר אותיות ואותיות עם גרשיים לדוגמא אם נרצה לחפש את הפרק קכ״ט  ניתן לרשום אחד מהצירופים לקבלת הפרק: קכ״ט / קכט /  129"
    Send.Keyboard(Bot_Variables, text, Button.Markup("חזור ↩️"))
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    lucks = [
        "מאזניים ♎️", "עקרב ♏️", "קשת ♐️", "גדי ♑️", "דלי ♒️", "דגים ♓️",
        "טלה ♈️", "שור ♉️", "תאומים ♊️", "סרטן ♋️", "אריה ♌️", "בתולה ♍️"
    ]

    Send.Inline_Keyboard(
        Bot_Variables,
        "בחר מזל",
        Button.Inline(["C", lucks[0], "l0"], ["C", lucks[1], "l1"]),
        Button.Inline(["C", lucks[2], "l2"], ["C", lucks[3], "l3"]),
        Button.Inline(["C", lucks[4], "l4"], ["C", lucks[5], "l5"]),
        Button.Inline(["C", lucks[6], "l6"], ["C", lucks[7], "l7"]),
        Button.Inline(["C", lucks[8], "l8"], ["C", lucks[9], "l9"]),
        Button.Inline(["C", lucks[10], "l10"], ["C", lucks[11], "l11"]),
    )
def Your_Code(update, context):
    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]
    Names = Bot_Variables[10][2]

    count = Names.find({"chat_id": Chat_ID, "status": "in progress"}).count()
    count2 = Names.find({"chat_id": Chat_ID, "status": "finished"}).count()
    if count == 0 and count2 == 0:
        Send.Message(Bot_Variables, "לא פרסמת שום שם עדיין")
    else:

        names = Names.find({"chat_id": Chat_ID, "status": "in progress"})

        text = ""
        for i in range(names.count()):

            name = "שם: {}\n".format(names[i]["name"])
            chapters_count = "פרקים שנקראו: {}\n".format(
                str(len(names[i]["chapters_stats"])))
            link = "לינק אישי: {}\n\n".format(names[i]["link"])

            text = text + name + chapters_count + link

        names = Names.find({"chat_id": Chat_ID, "status": "finished"})

        for i in range(names.count()):
            name = " שם: " + names[i]["name"] + ","

            chapters_count = " הכל ✔️"
            text = text + name + " פרקים שנקראו: " + str(
                chapters_count) + "\n\n"

        Send.Inline_Keyboard(
            Bot_Variables, text,
            Button.Inline(["C", "🚫 מחיקת שם 🚫", "delete_name"]))
def Your_Code(update, context):
    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]

    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]

    Names = Bot_Variables[10][2]
    Users = Bot_Variables[10][0]
    user = Users.find_one({"chat_id": Chat_ID})

    men_name = user["read for name"]["name"][0]
    chapter = user["read for name"]["name"][1]
    chat = user["read for name"]["chat"]

    chapters = Names.find_one({
        "chat_id": chat,
        "name": men_name
    })["chapters_stats"]

    if (not chapter in chapters):
        chapters.append(chapter)
        Names.update_one({
            "chat_id": chat,
            "name": men_name
        }, {"$set": {
            "chapters_stats": chapters
        }})

    Send.Callback_Alert(
        Bot_Variables, "פרק " + str(int_to_gematria(chapter + 1)) + " (" +
        str(chapter + 1) + ")" + " סומן כנקרא ✅")
    to = Names.find_one({"chat_id": chat, "name": men_name})["for"]
    llist = [chapter, len(chapters), men_name, to, Bot_Variables]

    t = SSend_chapter.Func(llist)
    next = Names.find_one({"chat_id": chat, "name": men_name})["link"]

    Send.Edited_Inline_Keyboard(Bot_Variables, t,
                                Button.Inline(["u", "➕ פרק נוסף ➕️", next]))
Пример #16
0
def Func(update,context):

    Bot_Variables = Get_Bot_Variables.Func([update,context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]

    * in order to use "Get_Other_Functions.Func(Other_Function_Name,*args)" you have to import this module: "import Program.Get_Other_Functions as Get_Other_Functions"
    """


    """"
    --- Send Class ---

# -In order to use Send Functions you have to import Send module: "from Program.Send import Send as Send" - #
# -In order to use Button Functions you have to import Button module: "from Program.Button import Button as Button" - #


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Send.Message(Bot_Variables, "Text Message")
Пример #17
0
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """
    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]

    user = Users.find_one({"chat_id": Chat_ID})

    chapter = int(user["book"]["bookmark"])
    book_chapters = user["book"]["chapters"]
    is_read_chapters = len(user["book"]["chapters"])
    write_type = user["write_type"]

    if is_read_chapters == 0:
        Users.update_one({"chat_id": Chat_ID}, {"$set": {"book.bookmark": 0}})

        Send.Inline_Keyboard(
            Bot_Variables, Send_Book.Func(0, Bot_Variables),
            Button.Inline([
                "C", "⬅️",
                rolling_left.Func(chapter, book_chapters, write_type)
            ], ["C", favoriets_name.Func(update, context), "Favorite"], [
                "C", "➡️",
                rolling_right.Func(chapter, book_chapters, write_type)
            ]),
            Button.Inline(["C",
                           is_read_name.Func(update, context), "is_read"]))
    else:
        Send.Inline_Keyboard(
            Bot_Variables,
            "כבר התחלת לקרוא כמה פרקים בתהילים מה ברצונך לעשות?",
            Button.Inline(["C", "🔵 להמשיך מאיפה שהפסקת 🔵", "start_bookmark"]),
            Button.Inline(["C", "♻️ לקרוא מחדש ♻️", "start_over"]))
Пример #18
0
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Message = Bot_Variables[4]
    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]
    Names = Bot_Variables[10][2]

    Users.update_one({"chat_id": Chat_ID},
                     {"$set": {
                         "virtual_location": "post_name2"
                     }})
    seperator = generate_link.Func(Bot_Variables)
    link = "https://t.me/" + telegram.Bot(
        Bot_Variables[0]).get_me().username + "?start=T" + seperator
    name = {
        "chat_id": Chat_ID,
        "name": Message,
        "for": "",
        "status": "pending",
        "chapters_stats": [],
        "link": link,
        "seperator": seperator
    }
    condition = Names.find({
        "chat_id": Chat_ID,
        "status": "pending"
    }).count() > 0
    if condition == False:
        Names.insert_one(name)
    else:
        Names.update_one({
            "chat_id": Chat_ID,
            "status": "pending"
        }, {"$set": {
            "name": Message
        }})

    Send.Message(
        Bot_Variables,
        "כתוב לשם מה תרצה שיקראו על שמו את התהילים, לרפואתו/הצלחתו/עילוי נשמת וכו"
    )
Пример #19
0
def Your_Code(update, context):
    """
    ---- imports ----

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    import Program.Get_Bot_Variables as Get_Bot_Variables

    import threading

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]

    user = Users.find_one({"chat_id": Chat_ID})

    chapter = int(user["book"]["bookmark"])
    book_chapters = user["book"]["chapters"]
    write_type = user["write_type"]

    if chapter not in book_chapters:
        book_chapters.append(chapter)

        Users.update_one({"chat_id": Chat_ID},
                         {"$set": {
                             "book.chapters": book_chapters
                         }})

        Send.Callback_Answer(
            Bot_Variables, "פרק " + str(int_to_gematria(chapter + 1)) + " (" +
            str(chapter + 1) + ")" + " סומן כנקרא ✅")
        if chapter < 149:
            Users.update_one({"chat_id": Chat_ID},
                             {"$set": {
                                 "book.bookmark": chapter + 1
                             }})
            Send.Edited_Inline_Keyboard(
                Bot_Variables, Send_Book.Func(chapter + 1, Bot_Variables),
                Button.Inline([
                    "C", "⬅️",
                    rolling_left.Func(chapter, book_chapters, write_type)
                ], ["C", favoriets_name.Func(update, context), "Favorite"], [
                    "C", "➡️",
                    rolling_right.Func(chapter, book_chapters, write_type)
                ]),
                Button.Inline(
                    ["C", is_read_name.Func(update, context), "is_read"]))

            try:
                chapter_count = Users.find_one(
                    {"chat_id": Chat_ID})["stats_chapters"][str(chapter)]
            except:
                chapter_count = 0
            Users.update_one({"chat_id": Chat_ID}, {
                "$set": {
                    "stats_chapters." + str(chapter): int(chapter_count) + 1
                }
            })
        else:
            try:
                chapter_count = Users.find_one(
                    {"chat_id": Chat_ID})["stats_chapters"][str(chapter)]
            except:
                chapter_count = 0
            Users.update_one({"chat_id": Chat_ID}, {
                "$set": {
                    "stats_chapters." + str(chapter): int(chapter_count) + 1
                }
            })
            #Users.update_one({"chat_id": Chat_ID}, {"$set": {"book.bookmark": chapter+1}})
            Send.Edited_Inline_Keyboard(
                Bot_Variables, Send_Book.Func(chapter, Bot_Variables),
                Button.Inline([
                    "C", "⬅️",
                    rolling_left.Func(chapter, book_chapters, write_type)
                ], ["C", favoriets_name.Func(update, context), "Favorite"], [
                    "C", "➡️",
                    rolling_right.Func(chapter, book_chapters, write_type)
                ]),
                Button.Inline(
                    ["C", is_read_name.Func(update, context), "is_read"]))

    else:

        book_chapters.remove(chapter)
        Users.update_one({"chat_id": Chat_ID},
                         {"$set": {
                             "book.chapters": book_chapters
                         }})
        Send.Callback_Answer(
            Bot_Variables, "פרק " + str(int_to_gematria(chapter + 1)) + " (" +
            str(chapter + 1) + ")" + " סומן כלא נקרא 🚫")

        chapter_count = Users.find_one({"chat_id": Chat_ID})["stats_chapters"]
        chapter_count = chapter_count[str(chapter)] - 1

        Users.update_one(
            {"chat_id": Chat_ID},
            {"$set": {
                "stats_chapters." + str(chapter): chapter_count
            }})

        Send.Edited_Inline_Keyboard(
            Bot_Variables, Send_Book.Func(chapter, Bot_Variables),
            Button.Inline([
                "C", "⬅️",
                rolling_left.Func(chapter, book_chapters, write_type)
            ], ["C", favoriets_name.Func(update, context), "Favorite"], [
                "C", "➡️",
                rolling_right.Func(chapter, book_chapters, write_type)
            ]),
            Button.Inline(["C",
                           is_read_name.Func(update, context), "is_read"]))

    if len(book_chapters) > 149:
        Users.update_one({"chat_id": Chat_ID}, {"$set": {"book.chapters": []}})

        Send.Message(
            Bot_Variables,
            "ברכותינו‼️ סיימתם את ספר התהילים בהצלחה ❗️💚📖📖 התווספה נקודה לסטטיסטיקה האישית שלכם!💚🥳🥳😇😇😇"
        )
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    url = "https://telegram.me/share/url?url={}"

    text = "讗谞讬 诪讝诪讬谉 讗讜转讱 诇讛讬讻谞住 诇讘讜讟 讛转讛讬诇讬诐 砖诇 讟诇讙专诐馃槆馃寑"

    url = url.format(
        urllib.parse.quote(text + "\n https://t.me/Tehilim_Book_bot"))

    Send.Inline_Keyboard(Bot_Variables, "砖诇讞 诇讞讘专 讗转 讘讜讟 讛转讛讬诇讬诐 馃寑",
                         Button.Inline(["U", "诇讞抓 诇砖讬转讜祝 馃憤", url]))
Пример #21
0
database = "Tehilim"
collection = "Users"

test_id = 42155571
activate = False

message_text = "לקהל המשתמשים שלנו אנחנו שמחים לבשר שעדכנו את הבוט , נוספו האפשרויות להשתמש בקריאה משותפת , לאותיות נשמה שמירה במועדפים ועוד! על מנת לקבל את העדכון פשוט לחצו על הפקודה /start ð゚リワð゚リホð゚リヌ"

#__________________________________________________________________________________________________________
Users = CM.Func(database, collection)

ids = Users.find({})
len_ids = Users.count_documents({})
chats = []
print("Total Users:", str(len_ids), "\n")
if activate:

    for i in range(len_ids):
        chats.append(ids[i]["chat_id"])

    for i in range(len_ids):
        Send.Message([TOKEN, chats[i]], message_text)

else:
    for i in range(len_ids):
        chats.append(ids[i]["chat_id"])
    print(chats)

    Send.Message([TOKEN, test_id], message_text)
Пример #22
0
    def start(cls, update, context):

        # - get info - #
        cls.Bot_Variables = Get_Bot_Variables.Func([update, context],
                                                   cls.TOKEN)

        #Update_Account_Asset.Func(cls.Bot_Variables)

        Chat_ID = cls.Bot_Variables[1]

        User_Doc = cls.Bot_Variables[10][0].find_one({"chat_id": Chat_ID})

        this_bot = telegram.Bot(cls.TOKEN).get_me()

        number_of_users_in_this_bot = cls.Bot_Variables[10][0].find({
            "bot_user":
            this_bot["id"]
        }).count()

        #Update_Bot_Asset.Func(cls.Bot_Variables,this_bot)

        # - if user exists in mongo - #
        if User_Doc != None:

            # - if the current bot is the user bot , let him in the bot - #
            if User_Doc["bot_user"] == this_bot["id"]:
                START.Func(update, context)
            # - else send him message whit the bot he is registered with - #
            else:

                bot_user = cls.Bot_Variables[10][0].find_one(
                    {"chat_id": Chat_ID})["bot_user"]
                bot_user_name = cls.Bot_Variables[10][2].find_one(
                    {"id": bot_user})["username"]
                Send.Message(
                    cls.Bot_Variables,
                    configure.message_when_reach_limit + " @" + bot_user_name)

        # - if user not exists in mongo - #
        else:
            # - if this bot users capacity not reach the limit - #
            if number_of_users_in_this_bot < configure.Users_Per_Bot:
                cls.Bot_Variables[13].append(this_bot["id"])
                Add_User_Info.Func(cls.Bot_Variables)
                START.Func(update, context)

            else:

                # - check if there is a bot that not reach the limit - #
                check = cl.Func(cls.Bot_Variables)
                if check[0]:
                    Send.Message(
                        cls.Bot_Variables,
                        configure.message_when_reach_limit + " @" + check[1])
                # - if all bots reach limits - #
                else:
                    cls.Bot_Variables[13].append(this_bot["id"])
                    Add_User_Info.Func(cls.Bot_Variables)
                    START.Func(update, context)

        Check_Capacity.Func(cls.Bot_Variables)
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    Chat_ID = Bot_Variables[1]
    Users = Bot_Variables[10][0]

    user = Users.find_one({"chat_id": Chat_ID})

    write_type = user["write_type"]

    if write_type == "right to left":
        write_type = "גלילה מימין לשמאל ⬅️"
    else:
        write_type = "גלילה משמאל לימין ➡️"

    luck = user["luck"]

    Send.Inline_Keyboard(Bot_Variables, "שינוי הגדרות",
                         Button.Inline(["C", write_type, "write_type"]))
Пример #24
0
    def deep_linked(cls, update, context):
        cls.start(update, context)
        cls.Bot_Variables = Get_Bot_Variables.Func([update, context])
        deep_link = update["message"]["text"]
        seperator = ""

        for i in range(8, len(deep_link), 1):
            seperator = seperator + deep_link[i]

        if len(seperator) < 4:
            chapter = int(seperator)
            Users = cls.Bot_Variables[10][0]
            Users.update_one({"chat_id": cls.Bot_Variables[1]},
                             {"$set": {
                                 "random_chapter": chapter
                             }})

            Send.Inline_Keyboard(
                cls.Bot_Variables, Send_Book.Func(chapter, cls.Bot_Variables),
                Button.Inline([
                    "C",
                    favoriets_name.Func(update, context),
                    "add_random_chapter_to_favoeites"
                ]),
                Button.Inline([
                    "C", "🔴 סמן כנקר� 🔴", "mark_random_as_read"
                ]))

        Users = cls.Bot_Variables[10][0]
        Names = cls.Bot_Variables[10][2]

        name = Names.find_one({"seperator": seperator})

        men_name = name["name"]
        chat = name["chat_id"]

        to = name["for"]

        stats = name["chapters_stats"]

        Chapter = ""
        chapters_read = len(stats)

        if len(stats) < 150:
            for i in range(150):
                if (not i in stats):
                    Chapter = i
                    break

            Users.update_one(
                {"chat_id": cls.Bot_Variables[1]},
                {"$set": {
                    "read for name.name": [men_name, Chapter]
                }})
            Users.update_one({"chat_id": cls.Bot_Variables[1]},
                             {"$set": {
                                 "read for name.chat": chat
                             }})
            next = name["link"]

            llist = [Chapter, chapters_read, men_name, to, cls.Bot_Variables]

            t = SSend_chapter.Func(llist)

            Send.Inline_Keyboard(
                cls.Bot_Variables, t,
                Button.Inline([
                    "C", "⭕� סמן כנקר� ⭕�",
                    "mark_as_read_for_name"
                ]), Button.Inline(["u", "➕ פרק נוסף ➕�", next]))
        else:
            text = " ✡✅ קרי�ת פרקי ספר התהילי� {} {} הסתיימה בהצלחה ✅�✡����".format(
                to, men_name)
            Send.Message(cls.Bot_Variables, text)
Пример #25
0
def Func(update,context):

    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update,context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """


    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """
  
    User_Privileges = Bot_Variables[8]

    if User_Privileges == "sudo":


        Send.Keyboard(Bot_Variables, "תהילים",
                  Button.Markup("✨ קריאה משותפת על שם ✨"),
                  Button.Markup("פרק רנדומלי 😇 ","ספר שלם 📖"),
                  Button.Markup("איזור אישי 🙎‍♂️", "חפש פרק 🔎"),
                  Button.Markup("עוד ➕", "קרדיט 🌀"),
                  Button.Markup("users")

                )
def Func(update, context):
    """
    ---- imports ----

    import Program.Get_Bot_Variables as Get_Bot_Variables

    from Program.Send import Send as Send

    from Program.Button import Button as Button

    """

    Bot_Variables = Get_Bot_Variables.Func([update, context])

    # - Variables - #
    """
    TOKEN = Bot_Variables[0]
    Chat_ID = Bot_Variables[1]
    First_Name = Bot_Variables[2]
    UserName = Bot_Variables[3]
    Message = Bot_Variables[4]
    Message_ID = Bot_Variables[5]
    File_ID = Bot_Variables[6]
    Virtual_Location = Bot_Variables[7]
    User_Privileges = Bot_Variables[8]
    User_Lang = Bot_Variables[9]
    Mongo_Collections = Bot_Variables[10]
    Json_Message = Bot_Variables[11]
    Update = Bot_Variables[12]
    Other_Variables = Bot_Variables[13]
    Context = Bot_Variables[14]
    
    """
    """
    --- Send Class ---


Send.Message(Bot_Variables,"Paste Text Here")

Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))



#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

# send edited keyboard, its edit current inline keyboard and change buttons give deep navigation effect

Send.Edited_Inline_Keyboard(Bot_Variables,"Text Here",
                            Button.Inline(["u","URL Button","www.google.co.il"])
                            )


Send.Callback_Answer(Bot_Variables,"Callback Query Answer")

Send.Callback_Alert(Bot_Variables,"Callback Query Alert")

Send.Forword(Bot_Variables,from_chat_id,to_chat_id,message_id)


# send any file by file id , type : video/voice message/photo/document/sticker
Send.Any_File(Bot_Variables,file_id,caption)


--- Buttons Types ---

# regular markup button
Button.Markup("button text1","button text2")

# make button markup to send user location
Button.Markup_Location("button text")

# make button markup to send user phone number
Button.Markup_Phone("button text")

# regular inline button
Button.Inline( ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"])

#syntax:

* each time activated gives 1 rows of buttons


#Markup synatx
Send.Keyboard(Bot_Variables, "Text Here",
                  Button.Markup("button 1"),
                  Button.Markup(Button.Markup_Location("Send_Location")),
                  Button.Markup( Button.Markup_Phone("Send_Phone") , "button 5", "button 6"))


#Inline synatx
#NOTE: when when you used Button.Inline() for creating buttons for inline keyboard this is the syntax:
# ["URL/CALLBACK Button type( u/c )","button text","the url or callback name"]
# the callback name is the name you gave to the file you created in "Inline_Function" folder (not include the .py extinction)

Send.Inline_Keyboard(Bot_Variables, "Text Here" ,
                         Button.Inline(  ["U","URL Button","https://www.google.co.il/"] ,  ["C","Callback Button","Template"] ) ,
                         Button.Inline(["C","Callback Button","Template"] ,["U","URL Button","https://www.google.co.il/"])
                         )

    """

    today = date.today().strftime("%d/%m/%Y")

    Mongo_Collections = Bot_Variables[10]
    Users = Mongo_Collections[0]
    Virtual_Location = Bot_Variables[7]

    joined_today = Users.find({"joined_time.date": today}).count()
    last_seen_today = Users.find({"last_seen.date": today}).count()

    total_users = Users.find({}).count()

    stats = """
Joined Today: {}
Last Seen Today: {}

Total Joined: {}


    """.format(joined_today, last_seen_today, total_users)

    if Virtual_Location == "sudo":
        Send.Message(Bot_Variables, stats)