Skip to content

Commit

Permalink
Grouping - InlineKeyboard changed , timeout updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kaulketh committed Mar 15, 2019
1 parent b5ed68e commit 4fb47b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion bot/conf/greenhouse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# keyboard configs
kb1 = [[lib.group1[1], lib.group1[2], lib.group1[3], lib.group3[1]],
[lib.group3[2], lib.group2[1], lib.group2[2], lib.group2[3]],
# [lib.group1[0], lib.group3[0], lib.group2[0]],
[lib.grouping],
[lib.stop_bot, lib.live_stream, lib.reload]
]
Expand Down
2 changes: 1 addition & 1 deletion bot/conf/lib_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
timeout if no user activity
"""
timeout = 600
timeout = 60


""" language settings
Expand Down
14 changes: 7 additions & 7 deletions bot/greenhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ def __group_menu(bot, update):
selection = ()
logger.info('Grouping mode called.')
inline_keyboard = [
[__get_inline_btn(lib.group1[1], conf.RELAIS_01), __get_inline_btn(lib.group1[2], conf.RELAIS_02),
__get_inline_btn(lib.group1[3], conf.RELAIS_03), __get_inline_btn(lib.group3[1], conf.RELAIS_04)],
[__get_inline_btn(lib.group3[2], conf.RELAIS_05), __get_inline_btn(lib.group2[1], conf.RELAIS_06),
__get_inline_btn(lib.group2[2], conf.RELAIS_07), __get_inline_btn(lib.group2[3], conf.RELAIS_08)],
[__get_inline_btn(lib.btn_finished, lib.btn_finished), __get_inline_btn(lib.btn_cancel, lib.btn_cancel)]
[__get_btn(lib.group1[1], conf.RELAIS_01), __get_btn(lib.group1[2], conf.RELAIS_02),
__get_btn(lib.group1[3], conf.RELAIS_03), __get_btn(lib.group3[1], conf.RELAIS_04)],
[__get_btn(lib.group3[2], conf.RELAIS_05), __get_btn(lib.group2[1], conf.RELAIS_06),
__get_btn(lib.group2[2], conf.RELAIS_07), __get_btn(lib.group2[3], conf.RELAIS_08)],
[__get_btn(lib.btn_finished, lib.btn_finished), __get_btn(lib.btn_cancel, lib.btn_cancel)]
]

global reply_markup
Expand All @@ -446,8 +446,8 @@ def __group_menu(bot, update):
return GROUPING


def __get_inline_btn(text, callback):
return InlineKeyboardButton(text, callback_data=callback)
def __get_btn(text, callback):
return InlineKeyboardButton('{0}({1})'.format(text, callback), callback_data=callback)
# end: grouping


Expand Down

0 comments on commit 4fb47b9

Please sign in to comment.