
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
This module will help you create layered callback menus. The module is based on the concept that each callback has all the preceding callbacks in it.
pip install aiogram-pagination
To create callbacks you need to use the callback factory from the aiogram-pagination module
from aiogram_pagination.utils.callback_stack_factory import CallbackStackFactory
cb = CallbackStackFactory('foo', 'bar')
You can use both the simple version of the callback stack and the version with abbreviated callbacks.
Simple version:
from aiogram_pagination.callback_stack import SimpleCallbackStack
callback_stack = SimpleCallbackStack(callback_data={'foo': 0, 'bar': 1, 'previous': ''},
callback_factory=cb)
callback_stack.next(callback_data={'foo': 6, 'bar': 6},
callback_factory=cb)
callback_stack.previous()
Version with abbreviation:
from aiogram_pagination.callback_stack import AbbreviatedCallbackStack
callback_stack = AbbreviatedCallbackStack(
callback_data={'foo': 0, 'bar': 1, 'previous': ''},
callback_factory=cb
)
callback_stack.next(callback_data={'foo': 6, 'bar': 6},
callback_factory=cb)
callback_stack.previous(default='some:callback')
For configuration, you can use any configuration file placed in the root directory of the project or in the data folder.
The module uses configs under the "callback stack" key. the default is config.json in the data folder of the aiogram-pagination module.
Example:
{
"callback_stack":
{
"storage": "redis",
"cache_time_limit": 3600,
"max_pagination_depth": false,
"redis_db": 1
}
}
FAQs
Module for deep pagination in an aiogram bot
We found that aiogram-pagination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.