Event Object
The event object fired to the event handlers could be splitted into two, EventBase
or GroupUser
.
EventBase¶
EventBase
is used for map events, they have their own classes for each event which always inherits from this class.
The only diffrrence is that they're using different mechanism to gather info and maybe additional info (such as source post for bubble pops).
phillip.abstract.EventBase
¶
An Abstract Class (ABC) representing base osu! beatmapset event.
api_beatmap: List[phillip.osu.classes.api.Beatmap]
property
readonly
¶
Difficulties returned by osu! API.
artist: str
property
readonly
¶
Beatmap's artist.
beatmapset: Beatmap
property
readonly
¶
Beatmapset info returned by the osu-web JSON.
creator: str
property
readonly
¶
Mapper of beatmap.
discussion: Discussion
property
readonly
¶
Discussion info returned by the osu-web JSON.
event_source_url: str
property
readonly
¶
URL to event cause.
gamemodes: List[str]
property
readonly
¶
Game modes inside the beatmapset.
map_cover: str
property
readonly
¶
URL to map's cover image.
time: datetime
property
readonly
¶
A datetime
object representing the time where the event happened.
title: str
property
readonly
¶
Beatmap's title.
user_id: int
property
readonly
¶
The user that causes this event to occur.
event_type(self)
¶
Event that happened on the beatmap (bubbled, qualified, etc.)
Source code in phillip\abstract.py
@abstractmethod
def event_type(self) -> str:
"""Event that happened on the beatmap (bubbled, qualified, etc.)"""
pass
get_beatmap(self)
async
¶
Fetch beatmapset info from osu! API.
Source code in phillip\abstract.py
async def get_beatmap(self) -> List[ApiBeatmap]:
"""Fetch beatmapset info from osu! API."""
if not self._beatmap:
self._beatmap = await self.app.api.get_beatmaps(s=self.beatmapset.id)
return self._beatmap # type: ignore
GroupUser¶
GroupUser
rrepresents a user inside a group that is defined from scraping the site.
phillip.osu.classes.web.GroupUser
¶
A class representing a user inside a grup.
Parameters:
- obj -
dict
-- osu! json object, gathered from groups page.
Attributes:
- id -
int
-- osu! user ID. - username -
str
-- osu! username. - profile_colour -
str
-- Hex of user's role color. - avatar_url -
str
-- User's avatar URL. - country_code -
str
-- Country code of user. - default_group -
str
-- Highest group of the user. - is_active -
bool
-- Representation if user is still active on osu! or not. - is_bot -
bool
-- Is user a bot? - is_online -
bool
-- Is the user is only at the moment or not. - is_supporter -
bool
-- Does the user have supporter tag? - last_visit -
str
-- User's last login to osu! - pm_friends_only -
bool
-- Represents if user only enables forum pm to friends only or not. - country -
dict
-- A dictionary with key of code and name, representing the country code and full country name respectively. - cover -
dict
-- A dictionary with custom_url, id, and url as key, representing cover url, id, and cover url respectively. - support_level -
int
-- Supporter tag level of user.
Warning
This class may change in the future as osu!web development goes.