mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
updates
This commit is contained in:
parent
ee354d3b45
commit
8682cfac95
4 changed files with 27 additions and 19 deletions
11
db.py
11
db.py
|
@ -996,11 +996,12 @@ class Halloween(Base):
|
||||||
if self[3] is None:
|
if self[3] is None:
|
||||||
# osu! sss
|
# osu! sss
|
||||||
osu = session.query(Osu).join(Royal).filter_by(id=self.royal.id).one_or_none()
|
osu = session.query(Osu).join(Royal).filter_by(id=self.royal.id).one_or_none()
|
||||||
r = requests.get(f"https://osu.ppy.sh/api/get_scores"
|
if osu is not None:
|
||||||
f"?k={config['Osu!']['ppy_api_key']}&b=2038&u={osu.osu_id}")
|
r = requests.get(f"https://osu.ppy.sh/api/get_scores"
|
||||||
j = r.json()
|
f"?k={config['Osu!']['ppy_api_key']}&b=2038&u={osu.osu_id}")
|
||||||
if len(j) > 0:
|
j = r.json()
|
||||||
self[3] = datetime.datetime.now()
|
if len(j) > 0:
|
||||||
|
self[3] = datetime.datetime.now()
|
||||||
|
|
||||||
|
|
||||||
# If run as script, create all the tables in the db
|
# If run as script, create all the tables in the db
|
||||||
|
|
|
@ -711,17 +711,6 @@ class RoyalDiscordBot(discord.Client):
|
||||||
await self.add_video_from_url(radio_message)
|
await self.add_video_from_url(radio_message)
|
||||||
await channel.send(f"📻 Aggiunto un messaggio radio, disattiva con `!radiomessages off`.")
|
await channel.send(f"📻 Aggiunto un messaggio radio, disattiva con `!radiomessages off`.")
|
||||||
logger.info(f"Radio message added to the queue.")
|
logger.info(f"Radio message added to the queue.")
|
||||||
# HALLOWEEN
|
|
||||||
if not random.randrange(4):
|
|
||||||
self.video_queue.insert(0, SecretVideo(file="despair.ogg", enqueuer=None))
|
|
||||||
target = random.sample([m for m in self.main_guild.members if len(m.roles) > 1], 1)[0]
|
|
||||||
logger.debug(f"Despair roll successful, sending to {target.name}.")
|
|
||||||
if target.dm_channel is None:
|
|
||||||
await target.create_dm()
|
|
||||||
await target.dm_channel.send(random.sample(images, 1)[0])
|
|
||||||
else:
|
|
||||||
logger.debug("Despair roll failed.")
|
|
||||||
# END
|
|
||||||
# Parse the parameter as URL
|
# Parse the parameter as URL
|
||||||
url = re.match(r"(?:https?://|ytsearch[0-9]*:).*", " ".join(params[1:]).strip("<>"))
|
url = re.match(r"(?:https?://|ytsearch[0-9]*:).*", " ".join(params[1:]).strip("<>"))
|
||||||
if url is not None:
|
if url is not None:
|
||||||
|
|
|
@ -24,6 +24,10 @@ sentry = Sentry(app, dsn=config["Sentry"]["token"])
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def pre_request():
|
def pre_request():
|
||||||
fl_g.event_started, fl_g.event_progress = db.Halloween.puzzle_status()
|
fl_g.event_started, fl_g.event_progress = db.Halloween.puzzle_status()
|
||||||
|
fl_g.all_moons_done = True
|
||||||
|
for moon in fl_g.event_progress:
|
||||||
|
if not moon:
|
||||||
|
fl_g.all_moons_done = False
|
||||||
fl_g.time_left = datetime.datetime.fromtimestamp(1540999800) - datetime.datetime.now()
|
fl_g.time_left = datetime.datetime.fromtimestamp(1540999800) - datetime.datetime.now()
|
||||||
fl_g.display_on_main_site = (fl_g.time_left < datetime.timedelta(days=7)) or __debug__
|
fl_g.display_on_main_site = (fl_g.time_left < datetime.timedelta(days=7)) or __debug__
|
||||||
fl_g.css = "spoopy.less" if (fl_g.event_started or __debug__) else "nryg.less"
|
fl_g.css = "spoopy.less" if (fl_g.event_started or __debug__) else "nryg.less"
|
||||||
|
@ -70,8 +74,7 @@ def page_mansion():
|
||||||
|
|
||||||
@app.route("/whatpumpkin", methods=["POST"])
|
@app.route("/whatpumpkin", methods=["POST"])
|
||||||
def page_whatpumpkin():
|
def page_whatpumpkin():
|
||||||
abort(400)
|
return redirect("https://t.me/Steffo")
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -70,6 +70,21 @@
|
||||||
i'll reveal that when all others are complete, just to be safe.
|
i'll reveal that when all others are complete, just to be safe.
|
||||||
</div>
|
</div>
|
||||||
<div class="subquests">
|
<div class="subquests">
|
||||||
|
{% if g.all_moons_done %}
|
||||||
|
<div class="quest">
|
||||||
|
<div class="progress">
|
||||||
|
<i class="far fa-moon todo"></i>
|
||||||
|
</div>
|
||||||
|
<h1>
|
||||||
|
PERFORM THE RITUAL!
|
||||||
|
</h1>
|
||||||
|
<div class="description">
|
||||||
|
if <a href="https://ryg.steffo.eu/game/halloween">you have enough moons</a>, prepare for a journey to the unknown.<br>
|
||||||
|
when the time runs out, prepare for the ritual.<br>
|
||||||
|
you'll receive the location through a safe channel, please do not spread it.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% for quest in g.event_progress %}
|
{% for quest in g.event_progress %}
|
||||||
<div class="quest {% if quest %}quest-clear{% endif %}" id="{{ loop.index }}">
|
<div class="quest {% if quest %}quest-clear{% endif %}" id="{{ loop.index }}">
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
|
@ -91,7 +106,7 @@
|
||||||
{% elif loop.index == 2 %}
|
{% elif loop.index == 2 %}
|
||||||
{# la zucca di balu e max #}
|
{# la zucca di balu e max #}
|
||||||
<h2>
|
<h2>
|
||||||
carve the ritual pumpkin
|
<u title="updated">♦</u> carve the ritual pumpkin
|
||||||
</h2>
|
</h2>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
prepare a pumpkin, and empty its inside.<br>
|
prepare a pumpkin, and empty its inside.<br>
|
||||||
|
|
Loading…
Reference in a new issue