Пример #1
0
def command_faq(m):
    cid = m.chat.id
    database.update_stage(m.chat.username, 5)
    bot.send_chat_action(cid, 'typing')  # show the bot "typing" (max. 5 secs)
    bot.send_message(
        cid,
        """Hello! Here is an exhaustive list of FAQ that our users have for us. Take a quick look!

Who are we?
Buyn is a social shopping platform working out of I3. We hope to connect shoppers together with a user-centric focused framework. Buyn is currently working with the support of NUS Enterprise. Check out our insta page for more details at @officialbuyn and leave us comments on how to be better. :-)

When do I make payments?
You will only be required to make payments when your Cart is filled and ready to go. Get your friends to help you with filling the Cart!

Which payment options are available?
We currently only accepts PayNow. So sorry for the inconvenience! 

How do I return my products?
For product returns, Buyn will follow the existing individual company policies that you are shopping out from. Please contact a Buyn admin via /return if you would like to return a product. :-)

I want to shop at a brand which is not here. What can I do?
Please tell us how to best expand our brand list here /recommendbrands. We look forward to hearing from you amigo! 

How long do I have to wait?
Each Cart lasts for 24hours, we will inform you once the Cart reaches 80% of its stipulated goal. Sit back and relax while your Cart fills :-)

What if my Cart doesnt fill?
You can have the option to extend your Cart’s waiting time or cancel your order. Although we do prefer the former!"""
    )
Пример #2
0
def command_edit(m):
    database.update_stage(m.chat.username, 4)
    cid = m.chat.id
    Edititem[0] = cid
    bot.send_chat_action(cid, 'typing')
    msg = bot.reply_to(
        m,
        """Hey there, change of mind? No problem! Can we have your Personal Transaction Number (PTN) for your purchase please?"""
    )
    bot.register_next_step_handler(msg, edit_choice)
Пример #3
0
def command_join(m):
    cid = m.chat.id
    database.update_stage(m.chat.username, 3)
    Joinitem[7] = cid
    bot.send_chat_action(cid, 'typing')
    msg = bot.reply_to(
        m,
        """Hello there good looking 🤩, seems likes you’re joining a cart. Can we have the Unique Cart Number (UCN) please?"""
    )
    bot.register_next_step_handler(msg, join_CartID)
Пример #4
0
def command_recommend(m):
    try:
        cid = m.chat.id
        database.update_stage(m.chat.username, 7)
        bot.send_chat_action(cid, 'typing')
        msg = bot.reply_to(
            m,
            """Hey there! Please tell us your desired brand who is not currently on the platform."""
        )
        bot.register_next_step_handler(msg, recommend_input)
    except Exception as e:
        bot.reply_to(m, 'oooops')
Пример #5
0
def command_start(m):
    cid = m.chat.id
    markup = types.ReplyKeyboardMarkup(row_width=1, one_time_keyboard=True)
    itembtn1 = types.KeyboardButton('/create')
    itembtn2 = types.KeyboardButton('/join')
    itembtn3 = types.KeyboardButton('/edit')
    itembtn4 = types.KeyboardButton('/help')
    itembtn5 = types.KeyboardButton('/brandlist')
    itembtn6 = types.KeyboardButton('/recommendbrand')
    itembtn7 = types.KeyboardButton('/status')
    itembtn8 = types.KeyboardButton('/faq')
    markup.add(itembtn1, itembtn2, itembtn3, itembtn4, itembtn5, itembtn6,
               itembtn7, itembtn8)
    database.update_stage(m.chat.username, 1)
    bot.send_message(cid, "Welcome to Buyn", reply_markup=markup)
Пример #6
0
def command_create(m):
    cid = m.chat.id
    database.update_stage(m.chat.username, 2)
    Customeritem[0] = cid
    print(Customeritem[0])
    bot.send_chat_action(cid, 'typing')
    markup2 = types.ReplyKeyboardMarkup(row_width=1, one_time_keyboard=True)
    itembtn1 = types.KeyboardButton('Colorpop: [$50]💄')
    itembtn2 = types.KeyboardButton('Sephora: [$40]💄')
    itembtn3 = types.KeyboardButton('Sephora: [$110]💄')
    itembtn4 = types.KeyboardButton('Uniqlo: [$60]👚')
    itembtn5 = types.KeyboardButton('Zara: [$79]👚')
    itembtn6 = types.KeyboardButton("The Editor's Market: [$60]👚")
    itembtn7 = types.KeyboardButton("The Editor's Market: [$60]👚")
    itembtn8 = types.KeyboardButton('The Tinsel Rack: [$100]👚')
    itembtn9 = types.KeyboardButton('Abercrombie & Fitch: [$160]👚')
    itembtn10 = types.KeyboardButton('Gardenpicks: [$50]🥜')
    itembtn11 = types.KeyboardButton('MyProtein: [$100]💊')
    markup2.add(itembtn1, itembtn2, itembtn3, itembtn4, itembtn5, itembtn6,
                itembtn7, itembtn8, itembtn9, itembtn10, itembtn11)
    msg = bot.reply_to(
        m,
        """Hello there! 😊 Seems like you’re creating a new cart to share.

This is a list of all minimum basket size to qualify for free shipping by retailers. Take a look!:

Colorpop: $50 💄 https://colourpop.com/

Sephora: $40 [FREE SHIPPING] $110 [FREE NEXT DAY] 💄 https://www.sephora.sg/

Uniqlo: $60 👚 https://www.uniqlo.com/sg/store/#undefined

Zara: $79 👚 https://www.zara.com/sg/ 

The Editor’s Market: Free Shipping, discount starts at 3 pieces and more, discounts up to 6 pieces. We are offering two options for you at $60 and $120 👚 https://www.theeditorsmarket.com/

The Tinsel Rack: $100 👚 https://www.thetinselrack.com/

Abercrombie & Fitch: $160 👚 https://www.abercrombie.sg/en_SG/home

Gardenpicks: $50 🥜 http://gardenpicks.com.sg/

MyProtein: $100 💊 http://gardenpicks.com.sg/

Can you please give us the name of the brand that you will be shopping from? 📥""",
        reply_markup=markup2)
    bot.register_next_step_handler(
        msg, create_chooseBrand)  # display msg and jumping to next function
Пример #7
0
def command_status(m):
    try:
        cid = m.chat.id
        database.update_stage(m.chat.username, 8)
        markup18 = types.ReplyKeyboardMarkup(row_width=1,
                                             one_time_keyboard=True)
        itembtn1 = types.KeyboardButton('Query your bubble')
        itembtn2 = types.KeyboardButton('Query the bubble status')
        itembtn3 = types.KeyboardButton('Query my items')
        itembtn4 = types.KeyboardButton('Query my address')
        markup18.add(itembtn1, itembtn2, itembtn3, itembtn4)
        msg = bot.reply_to(m,
                           """What you want to query?""",
                           reply_markup=markup18)
        bot.register_next_step_handler(msg, status_input)
    except Exception as e:
        bot.reply_to(m, 'oooops')
Пример #8
0
def command_brandlist(m):
    cid = m.chat.id
    database.update_stage(m.chat.username, 6)
    bot.send_chat_action(cid, 'typing')  # show the bot "typing" (max. 5 secs)
    bot.send_message(
        cid,
        """Current brands on Buyn and their minimum basket size to qualify for free shipping!
1.	Colorpop: $50 💄
2.	Sephora: $40 [FREE SHIPPING] $110 [FREE NEXT DAY] 💄
3.	Uniqlo: $60 👚
4.	Zara: $79 👚
5.	The Editor’s Market: 3 pieces and more, discounts up to 6 pieces. 👚
6.	The Tinsel Rack: $100 👚
7.	Abercrombie & Fitch: $160 👚
8.	Love, Bonito: Nil 👚
9.	Gardenpicks: $50 🥜
10.	MyProtein: $100 💊""")
Пример #9
0
def task():
    if not session.get('logged_in', False):
        return redirect('/')

    team_id = session['team_id']
    if request.method == 'GET':
        stage = get_task(team_id).stage
        if stage > 1000:
            user = get_user(team_id)
            return user.flag
        else:
            answer, task_body = generate()
            update_answer(team_id, answer)
            return render_template('task.html', stage=stage, task=task_body)
    else:
        task = get_task(team_id)
        answer = str(request.form['answer'])
        if answer == task.answer:
            update_stage(team_id, task.stage + 1)
        return redirect('/task')