bot.setnext Module

The module contains functionality for changing the order of instrument groups.

bot.setnext.abort(update, _)

Abort the conversation.

Parameters
  • update (telegram.update.Update) – The incoming Telegram Update.

  • _ – The callback context as provided by the dispatcher.

Return type

int

bot.setnext.build_conversation(board_role)

Builds the telegram.ext.ConversationHandler to set the instrument group for the next sweep.

Parameters

board_role (ptbcontrib.roles.roles.Role) – The bot.constants.BOARD_ROLE role.

Return type

telegram.ext.conversationhandler.ConversationHandler

bot.setnext.inline_query_results(instruments=None)

Builds a list of telegram.InlineQueryResultArticle to show as reply to an inline query. The IDs will be the index of the instrument groups in INSTRUMENTS.

Parameters

instruments (typing.Union[typing.List[str], str, None]) – Pass to only allow the specified instruments. Must be a subset of INSTRUMENTS.

Return type

typing.List[telegram.inline.inlinequeryresultarticle.InlineQueryResultArticle]

bot.setnext.offer_section(update, _)

Shows the user a list of available instrument groups. If there is an inline query, the nearest match is extracted with fuzzy matching.

Parameters
  • update (telegram.update.Update) – The incoming Telegram Update.

  • _ – The callback context as provided by the dispatcher.

Return type

str

bot.setnext.parse_selection(update, context)

Parses the chosen instrument groups and saves the setting.

Parameters
  • update (telegram.update.Update) – The incoming Telegram Update.

  • context (telegram.ext.callbackcontext.CallbackContext) – The callback context as provided by the dispatcher.

Return type

int

bot.setnext.start(update, context)

Starts the conversation and asks the user to go to inline mode to select the instrument.

Parameters
  • update (telegram.update.Update) – The Telegram update.

  • context (telegram.ext.callbackcontext.CallbackContext) – The callback context as provided by the dispatcher.

Return type

typing.Union[str, int]