mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 21:44:21 +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
|
import datetime
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from sqlalchemy.orm import sessionmaker, relationship
|
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
|
import requests
|
||||||
from errors import RequestError, NotFoundError, AlreadyExistingError
|
from errors import RequestError, NotFoundError, AlreadyExistingError
|
||||||
import re
|
import re
|
||||||
|
|
|
@ -94,6 +94,10 @@ th {
|
||||||
font-size: small;
|
font-size: small;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.saver-data {
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
.timestamp-data {
|
.timestamp-data {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ import math
|
||||||
import db
|
import db
|
||||||
import errors
|
import errors
|
||||||
import stagismo
|
import stagismo
|
||||||
from telegram import Bot, Update, Message
|
from telegram import Bot, Update
|
||||||
from telegram.ext import Updater, CommandHandler
|
from telegram.ext import Updater, CommandHandler
|
||||||
from discord import Status as DiscordStatus
|
from discord import Status as DiscordStatus
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ def cmd_discord(bot: Bot, update: Update):
|
||||||
for member in members_in_channels[channel]:
|
for member in members_in_channels[channel]:
|
||||||
if member.status == DiscordStatus.offline and member.voice.voice_channel is None:
|
if member.status == DiscordStatus.offline and member.voice.voice_channel is None:
|
||||||
continue
|
continue
|
||||||
if member.bot:
|
|
||||||
continue
|
|
||||||
# Online status emoji
|
# Online status emoji
|
||||||
if member.status == DiscordStatus.online:
|
if member.bot:
|
||||||
|
message += "🤖 "
|
||||||
|
elif member.status == DiscordStatus.online:
|
||||||
message += "🔵 "
|
message += "🔵 "
|
||||||
elif member.status == DiscordStatus.idle:
|
elif member.status == DiscordStatus.idle:
|
||||||
message += "⚫️ "
|
message += "⚫️ "
|
||||||
|
@ -111,6 +111,10 @@ def cmd_discord(bot: Bot, update: Update):
|
||||||
message += f" | 🎮 {member.game.name}"
|
message += f" | 🎮 {member.game.name}"
|
||||||
elif member.game.type == 1:
|
elif member.game.type == 1:
|
||||||
message += f" | 📡 [{member.game.name}]({member.game.url})"
|
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"
|
||||||
message += "\n"
|
message += "\n"
|
||||||
bot.send_message(update.message.chat.id, message, disable_web_page_preview=True)
|
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 id="diario-{{ entry.id }}" class="diario-entry">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<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 %}
|
{% if entry.author %}
|
||||||
<div id="author-{{ entry.id }}" class="author-data diario-data">
|
<div id="author-{{ entry.id }}" class="author-data diario-data">
|
||||||
{{ entry.author.royal.username }}
|
{{ entry.author.royal.username }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if entry.saver %}
|
|
||||||
<div id="saver-{{ entry.id }}" class="saver-data diario-data">
|
|
||||||
{{ entry.saver.royal.username }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div id="timestamp-{{ entry.id }}" class="timestamp-data diario-data">
|
<div id="timestamp-{{ entry.id }}" class="timestamp-data diario-data">
|
||||||
|
|
|
@ -38,11 +38,13 @@
|
||||||
<td>{{ record.wins }}</td>
|
<td>{{ record.wins }}</td>
|
||||||
<td sorttable_customkey="{{ record.rank_tier }}">
|
<td sorttable_customkey="{{ record.rank_tier }}">
|
||||||
<div class="dota-rank-medal">
|
<div class="dota-rank-medal">
|
||||||
<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 %}
|
||||||
{% if record.rank_tier is not none and record.rank_tier >= 10 %}
|
<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 %}
|
||||||
{{ record.get_rank_name() }} {{ record.get_rank_number() }}
|
{% endif %}
|
||||||
{% else %}
|
{% if record.rank_tier is not None and record.rank_tier < 10 %}
|
||||||
<span class="rl-unranked">Unranked</span>
|
<span class="rl-unranked">Unranked</span>
|
||||||
|
{% else %}
|
||||||
|
{{ record.get_rank_name() }} {{ record.get_rank_number() }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends, Diario, Telegram
|
from db import Session, Royal, Steam, RocketLeague, Dota, Osu, Overwatch, LeagueOfLegends, Diario, Telegram
|
||||||
from sqlalchemy.orm import joinedload
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue