raito.plugins.roles.providers.sql.sqlite moduleΒΆ

class raito.plugins.roles.providers.sql.sqlite.SQLiteRoleProvider(storage, session_factory=None)[source]ΒΆ

Bases: SQLAlchemyRoleProvider

SQLite-based role provider.

Required packages sqlalchemy[asyncio], aiosqlite package installed (pip install raito[sqlite])

Parameters:
  • storage (SQLAlchemyStorage)

  • session_factory (async_sessionmaker[AsyncSession] | None)

async set_role(bot_id, user_id, role_slug)[source]ΒΆ

Set the role for a specific user.

Parameters:
  • bot_id (int) – The Telegram bot ID

  • user_id (int) – The Telegram user ID

  • role_slug (str) – The role slug to assign

Return type:

None

async remove_role(bot_id, user_id)[source]ΒΆ

Remove the role for a specific user.

Parameters:
  • bot_id (int) – The Telegram bot ID

  • user_id (int) – The Telegram user ID

Return type:

None