mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
ravage them, arsene
This commit is contained in:
parent
c3dca23b1b
commit
ab88d70465
2 changed files with 35 additions and 8 deletions
27
db.py
27
db.py
|
@ -1215,6 +1215,33 @@ mini_list = [Royal, Telegram, Steam, Dota, LeagueOfLegends, Osu, Discord, Overwa
|
|||
Terraria13]
|
||||
|
||||
|
||||
class Matchmaker(Base):
|
||||
__tablename__ = "matchmakers"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
|
||||
matchmaking_name = Column(String)
|
||||
matchmaking_desc = Column(Text)
|
||||
|
||||
min_players = Column(Integer)
|
||||
max_players = Column(Integer)
|
||||
|
||||
timestamp = Column(DateTime)
|
||||
expires_in = Column(DateTime)
|
||||
|
||||
players = relationship("MatchmakingEntry", lazy="joined")
|
||||
|
||||
|
||||
class MatchmakingEntry(Base):
|
||||
__tablename__ = "matchmakingentry"
|
||||
|
||||
royal_id = Column(Integer, ForeignKey("royals.id"), primary_key=True)
|
||||
royal = relationship("Royal", backref="matchmades", lazy="joined")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# If run as script, create all the tables in the db
|
||||
if __name__ == "__main__":
|
||||
print("Creating new tables...")
|
||||
|
|
|
@ -114,20 +114,20 @@ def osu_pp_change(item, change: typing.Tuple[DirtyDelta, DirtyDelta, DirtyDelta,
|
|||
try:
|
||||
if std.delta >= 1:
|
||||
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||
f"✳️ {item.royal.username} ha ora **{int(std.value)}pp** (+{int(std.delta)}) su osu!",
|
||||
parse_mode="Markdown")
|
||||
f"✳️ {item.royal.username} ha ora <b>{int(std.value)}pp</b> (+{int(std.delta)}) su osu!",
|
||||
parse_mode="HTML")
|
||||
if taiko.delta >= 1:
|
||||
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||
f"✳️ {item.royal.username} ha ora **{int(taiko.value)}pp** (+{int(taiko.delta)}) su osu!taiko!",
|
||||
parse_mode="Markdown")
|
||||
f"✳️ {item.royal.username} ha ora <b>{int(taiko.value)}pp</b> (+{int(taiko.delta)}) su osu!taiko!",
|
||||
parse_mode="HTML")
|
||||
if catch.delta >= 1:
|
||||
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||
f"✳️ {item.royal.username} ha ora **{int(catch.value)}pp** (+{int(catch.delta)}) su osu!catch!",
|
||||
parse_mode="Markdown")
|
||||
f"✳️ {item.royal.username} ha ora <b>{int(catch.value)}pp</b> (+{int(catch.delta)}) su osu!catch!",
|
||||
parse_mode="HTML")
|
||||
if mania.delta >= 1:
|
||||
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||
f"✳️ {item.royal.username} ha ora **{int(mania.value)}pp** (+{int(mania.delta)}) su osu!mania!",
|
||||
parse_mode="Markdown")
|
||||
f"✳️ {item.royal.username} ha ora <b>{int(mania.value)}pp</b> (+{int(mania.delta)}) su osu!mania!",
|
||||
parse_mode="HTML")
|
||||
except Exception:
|
||||
logger.warning(f"Couldn't notify on Telegram: {item}")
|
||||
sentry.captureException()
|
||||
|
|
Loading…
Reference in a new issue