Ejemplo n.º 1
0
"""
falando sobre heranças, onde se pode fazer com que a classe mae tenha atributos da classe filha (conceitualmente errado)
"""
from classes.interface import Interface

i1 = Interface()
i1.chama_metodo_interface()
Ejemplo n.º 2
0
async def text(message : Message):

    # --------Global variables
    global interface
    global database

    # --------Set interface language
    if message.text in INTERFACE_LANGUAGE.keys():
        interface = Interface(INTERFACE_LANGUAGE[message.text])

        animation, text, keyboard = interface.welcome()
        await bot.send_animation(chat_id=message.chat.id,animation = open(animation,'rb'))
        await bot.send_message(chat_id=message.chat.id, text = text.format(message.from_user.first_name),parse_mode='html',reply_markup=keyboard)


    # --------Keyboard listener
    if message.text in list(WELCOME_LANGUAGE.values())[0] or list(WELCOME_LANGUAGE.values())[1]:
        if   message.text == WELCOME_LANGUAGE[interface.language][0]:
            photo, caption = interface.about_us()
            await send_photo(message.chat.id,photo=photo)
            await bot.send_message(message.chat.id,text =caption,parse_mode='html')
            
        elif message.text == WELCOME_LANGUAGE[interface.language][1]:# start_quiz
            photo,caption,keyboard = interface.importance()
            database.add_quiz(message.chat.id)
            await send_photo(message.chat.id,photo,caption,keyboard)
            
        elif message.text == WELCOME_LANGUAGE[interface.language][2]:
            await bot.send_message(message.chat.id,database.get_works(),parse_mode='html')
            pass
        elif message.text == WELCOME_LANGUAGE[interface.language][3]:#contact
            await bot.send_contact(chat_id=message.chat.id,phone_number='+77756508888',first_name='Yqylasfilms', last_name='LoveStory',vcard='19191919191919191919')
            await bot.send_contact(chat_id=message.chat.id,phone_number='+77056458888',first_name='Yqylasfilms', last_name='LoveStory',vcard='19191919191919191919')

        elif message.text == WELCOME_LANGUAGE[interface.language][4]:# address
            text,location = interface.office_address()
            await bot.send_message(chat_id=message.chat.id,text=text,parse_mode='html')
            await bot.send_location(chat_id=message.chat.id,latitude=location[0],longitude=location[1])

        elif message.text == WELCOME_LANGUAGE[interface.language][5]:# price_list
            document,keyboard = interface.send_price()
            await bot.send_document(chat_id=message.chat.id,document=document,reply_markup=keyboard)
            
        elif message.text == WELCOME_LANGUAGE[interface.language][6]:
            await start(message)
            
        # elif message.text == WELCOME_LANGUAGE[interface.language][7]:
        #     pass

    if message.text in LOVESTORY_KEYBOARD:
        if message.text != LOVESTORY_KEYBOARD[-1]:
            document, keyboard = interface.send_price()
            photo,text = interface.each_price(message.text)
            await send_photo(message.chat.id,photo,text,keyboard)
        else:
             animation, text, keyboard = interface.welcome()
             await send_photo(chat_id=message.chat.id,keyboard=keyboard)
        
    try:
        await bot.delete_message(message.chat.id, message.message_id)
    except Exception as e:
        print(e)
Ejemplo n.º 3
0
"""
Animal -> respirar (é um Animal)
    Lobo(Animal) -> respirar / uivar (Lobo é um lobo e um Animal)
    Cachorro(Lobo) -> respirar / uivar / latir (cachorro é um Cachorro, também é um lobo() e um Animal())
"""

from classes.interface import Interface

interface1 = Interface()
interface1.metodo_da_interface()
Ejemplo n.º 4
0


admins  = [626420006,508774864,318364070, 269903576,557795357]



# -------------Connection
dbname = 'puttgvir'
user = '******'
password = '******'
host = 'rogue.db.elephantsql.com'
port = '5432'

# -------------Classes
interface = Interface()
database = Database(dbname,user,password,host,port)





# -------------Bot
# TOKEN = '1251528088:AAECXGaHJx7J7PsDPKsot5rpWlThNN-hpuw'
# TOKEN = '1300236281:AAFhQKebBujEHIlNN43r7xQ2YKtqWWzyy78'
TOKEN = '1265307353:AAEZHrSyw6-AhWyXrZvMMuc0zxzYa2jGOD8'
bot = Bot(TOKEN)
dp = Dispatcher(bot)


Ejemplo n.º 5
0
def main():

    root = Tk()
    ex = Interface(root)
    root.geometry("250x650+300+300")
    root.mainloop()