mini_apps.apps.mini_event

class mini_apps.apps.mini_event.Event(*args, **kwargs)

Bases: BaseModel

DoesNotExist

alias of EventDoesNotExist

class mini_apps.apps.mini_event.MiniEventApp(*args)

Bases: App

This class has custom logic

async broadcast_event_change(event)

Sends an event to all connected clients

async check_starting()

Called periodically, used to check if the user needs to be notified of an event

event_data(event: Event, user: User, attendees: int | None = None)

Formats an event, adding user-specific data

async handle_message(client: Client, type: str, data: dict)

Handles messages received from the client

inline_buttons()

Returns the telegram inline button that opens the web app

load_events()

Load all the events from the database

async on_client_authenticated(client: Client)

Called when a client has been authenticated

on_server_start()

Called when the server starts

async on_telegram_inline(query: InlineQuery)

Called on telegram bot inline queries

async on_telegram_start(args: str, event: NewMessage)

Called when a user sends /start to the bot

register_models()

Registers the database models

unique_filename(path: Path)

Returns a file name that does not exist based on an input filename

class mini_apps.apps.mini_event.UserEvent(*args, **kwargs)

Bases: BaseModel

DoesNotExist

alias of UserEventDoesNotExist