src package¶
Subpackages¶
Submodules¶
src.app module¶
src.bot module¶
-
class
src.bot.
DispatcherManual
(bot, loop=None, storage: Optional[aiogram.dispatcher.storage.BaseStorage] = None, run_tasks_by_default: bool = False, throttling_rate_limit=0.1, no_throttle_error=False, filters_factory=None)[source]¶ Bases:
aiogram.dispatcher.dispatcher.Dispatcher
Dispatcher with user availability in database check.
-
class
src.bot.
IncomingHistoryMiddleware
[source]¶ Bases:
aiogram.dispatcher.middlewares.BaseMiddleware
Middleware for storing incoming history.
-
class
src.bot.
TellerBot
(token: String, loop: Union[asyncio.base_events.BaseEventLoop, asyncio.events.AbstractEventLoop, None] = None, connections_limit: Optional[Integer] = None, proxy: Optional[String] = None, proxy_auth: Optional[aiohttp.helpers.BasicAuth] = None, validate_token: Optional[Boolean] = True, parse_mode: Optional[String] = None, timeout: Union[Integer, Float, aiohttp.client.ClientTimeout, None] = None)[source]¶ Bases:
aiogram.bot.bot.Bot
Custom bot class.
src.database module¶
-
class
src.database.
MongoStorage
[source]¶ Bases:
aiogram.dispatcher.storage.BaseStorage
MongoDB asynchronous storage for FSM using motor.
-
get_state
(user: int, **kwargs) → Optional[str][source]¶ Get current state of user with Telegram ID
user
.
-
reset_state
(user: int, with_data: bool = True, **kwargs)[source]¶ Reset state for user with Telegram ID
user
.
-
set_data
(user: int, data: Optional[Dict[KT, VT]] = None, **kwargs) → None[source]¶ Set state data
data
of user with Telegram IDuser
.
-
set_state
(user: int, state: Optional[str] = None, **kwargs) → None[source]¶ Set new state
state
of user with Telegram IDuser
.
-
src.i18n module¶
-
class
src.i18n.
I18nMiddlewareManual
(domain, path, default='en')[source]¶ Bases:
aiogram.contrib.middlewares.i18n.I18nMiddleware
I18n middleware which gets user locale from database.
src.money module¶
-
src.money.
gateway_currency_regexp
(currency)[source]¶ Return regexp that ignores gateway if it isn’t specified.
src.notifications module¶
src.states module¶
-
class
src.states.
Escrow
[source]¶ Bases:
aiogram.dispatcher.filters.state.StatesGroup
States of user during escrow exchange.
States are uncontrollable by users and are only used to determine what action user is required to perform. Because there are two parties in escrow exchange and steps are dependant on which currencies are used, states do not define full steps of exchange.
-
amount
= <State 'Escrow:amount'>¶ Send sum in any of the currencies.
-
bank
= <State 'Escrow:bank'>¶ Choose escrow initiator’s bank from listed.
-
fee
= <State 'Escrow:fee'>¶ Agree or disagree to pay fee.
-
full_card
= <State 'Escrow:full_card'>¶ Send fiat receiver’s full card number to fiat sender.
-
name
= <State 'Escrow:name'>¶ Send fiat sender’s name on card. Required to verify fiat transfer.
-
receive_address
= <State 'Escrow:receive_address'>¶ Send escrow asset receiver’s address in blockchain.
-
receive_card_number
= <State 'Escrow:receive_card_number'>¶ Send first and last 4 digits of fiat receiver’s card number.
-
send_address
= <State 'Escrow:send_address'>¶ Escrow asset sender’s address in blockchain.
-
send_card_number
= <State 'Escrow:send_card_number'>¶ Send first and last 4 digits of fiat sender’s card number.
-
-
class
src.states.
OrderCreation
[source]¶ Bases:
aiogram.dispatcher.filters.state.StatesGroup
Steps of order creation.
States represent values user is required to send. They are in order and skippable unless otherwise specified.
-
amount
= <State 'OrderCreation:amount'>¶ Sum in any of the currencies.
-
buy
= <State 'OrderCreation:buy'>¶ Currency user wants to buy (unskippable).
-
buy_gateway
= <State 'OrderCreation:buy_gateway'>¶ Gateway of buy currency (unskippable).
-
comments
= <State 'OrderCreation:comments'>¶ Any additional comments.
-
duration
= <State 'OrderCreation:duration'>¶ Duration in days.
-
location
= <State 'OrderCreation:location'>¶ Location object or location name.
-
payment_system
= <State 'OrderCreation:payment_system'>¶ Cashless payment system.
-
price
= <State 'OrderCreation:price'>¶ Price in one of the currencies.
-
sell
= <State 'OrderCreation:sell'>¶ Currency user wants to sell (unskippable).
-
sell_gateway
= <State 'OrderCreation:sell_gateway'>¶ Gateway of sell currency (unskippable).
-
set_order
= <State 'OrderCreation:set_order'>¶ Finish order creation by skipping comments state.
-
-
src.states.
asking_support
= <State '@:asking_support'>¶ Ask support a question.
-
src.states.
cashback_address
= <State '@:cashback_address'>¶ Send new value of chosen order’s field during editing.
-
src.states.
field_editing
= <State '@:field_editing'>¶ Send new value of chosen order’s field during editing.
src.whitelist module¶
Whitelists for orders.