mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
Merge branch 'master' of github.com:Steffo99/royalbot-iv
This commit is contained in:
commit
4eee2268b7
6 changed files with 24 additions and 16 deletions
3
db.py
3
db.py
|
@ -1,8 +1,7 @@
|
|||
import time
|
||||
import datetime
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker, relationship
|
||||
from sqlalchemy import Column, BigInteger, Integer, String, Numeric, DateTime, ForeignKey, Float, Enum, create_engine, UniqueConstraint
|
||||
from sqlalchemy import Column, BigInteger, Integer, String, DateTime, ForeignKey, Float, Enum, create_engine, UniqueConstraint
|
||||
import requests
|
||||
from errors import RequestError, NotFoundError, AlreadyExistingError
|
||||
import re
|
||||
|
|
|
@ -94,6 +94,10 @@ th {
|
|||
font-size: small;
|
||||
}
|
||||
|
||||
.saver-data {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.timestamp-data {
|
||||
text-align: right;
|
||||
}
|
|
@ -4,7 +4,7 @@ import math
|
|||
import db
|
||||
import errors
|
||||
import stagismo
|
||||
from telegram import Bot, Update, Message
|
||||
from telegram import Bot, Update
|
||||
from telegram.ext import Updater, CommandHandler
|
||||
from discord import Status as DiscordStatus
|
||||
|
||||
|
@ -80,10 +80,10 @@ def cmd_discord(bot: Bot, update: Update):
|
|||
for member in members_in_channels[channel]:
|
||||
if member.status == DiscordStatus.offline and member.voice.voice_channel is None:
|
||||
continue
|
||||
if member.bot:
|
||||
continue
|
||||
# Online status emoji
|
||||
if member.status == DiscordStatus.online:
|
||||
if member.bot:
|
||||
message += "🤖 "
|
||||
elif member.status == DiscordStatus.online:
|
||||
message += "🔵 "
|
||||
elif member.status == DiscordStatus.idle:
|
||||
message += "⚫️ "
|
||||
|
@ -111,6 +111,10 @@ def cmd_discord(bot: Bot, update: Update):
|
|||
message += f" | 🎮 {member.game.name}"
|
||||
elif member.game.type == 1:
|
||||
message += f" | 📡 [{member.game.name}]({member.game.url})"
|
||||
elif member.game.type == 2:
|
||||
message += f" | 🎧 {member.game.name}"
|
||||
elif member.game.type == 3:
|
||||
message += f" | 📺 {member.game.name}"
|
||||
message += "\n"
|
||||
message += "\n"
|
||||
bot.send_message(update.message.chat.id, message, disable_web_page_preview=True)
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
<div id="diario-{{ entry.id }}" class="diario-entry">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{% if entry.saver %}
|
||||
<div id="saver-{{ entry.id }}" class="saver-data diario-data">
|
||||
Salvato da {{ entry.saver.royal.username }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if entry.author %}
|
||||
<div id="author-{{ entry.id }}" class="author-data diario-data">
|
||||
{{ entry.author.royal.username }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if entry.saver %}
|
||||
<div id="saver-{{ entry.id }}" class="saver-data diario-data">
|
||||
{{ entry.saver.royal.username }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div id="timestamp-{{ entry.id }}" class="timestamp-data diario-data">
|
||||
|
|
|
@ -38,11 +38,13 @@
|
|||
<td>{{ record.wins }}</td>
|
||||
<td sorttable_customkey="{{ record.rank_tier }}">
|
||||
<div class="dota-rank-medal">
|
||||
{% if record.rank_tier is not None %}
|
||||
<img class="thirtytwo dota-rank-medal-icon" src="{{ record.get_rank_icon_url() }}">{% if record.get_rank_stars_url() %}<img class="thirtytwo dota-rank-medal-stars" src="{{ record.get_rank_stars_url() }}">{% endif %}
|
||||
{% if record.rank_tier is not none and record.rank_tier >= 10 %}
|
||||
{{ record.get_rank_name() }} {{ record.get_rank_number() }}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% if record.rank_tier is not None and record.rank_tier < 10 %}
|
||||
<span class="rl-unranked">Unranked</span>
|
||||
{% else %}
|
||||
{{ record.get_rank_name() }} {{ record.get_rank_number() }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from flask import Flask, render_template
|
||||
from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends, Diario, Telegram
|
||||
from sqlalchemy.orm import joinedload
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
|
Loading…
Reference in a new issue