mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-26 21:14:19 +00:00
🧹 Run reformat code on the whole repository
This commit is contained in:
parent
b20f20f387
commit
94d0ae7d05
36 changed files with 736 additions and 712 deletions
8
poetry.lock
generated
8
poetry.lock
generated
|
@ -428,7 +428,7 @@ pyasn1 = ">=0.1.3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sentry-sdk"
|
name = "sentry-sdk"
|
||||||
version = "1.5.6"
|
version = "1.5.5"
|
||||||
description = "Python client for Sentry (https://sentry.io)"
|
description = "Python client for Sentry (https://sentry.io)"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
|
@ -619,7 +619,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "1.1"
|
lock-version = "1.1"
|
||||||
python-versions = "^3.8"
|
python-versions = "^3.8"
|
||||||
content-hash = "4d75b8fb7e3dfb1b0c87e6f31ab9e033e96a990b0e74a1212acd76d673cd06f9"
|
content-hash = "f1333f44e4018f9a78626bfaf5db96ab65db60cec6607a6395f9f9213981105f"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
aiohttp = [
|
aiohttp = [
|
||||||
|
@ -1064,8 +1064,8 @@ rsa = [
|
||||||
{ file = "rsa-4.8.tar.gz", hash = "sha256:5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" },
|
{ file = "rsa-4.8.tar.gz", hash = "sha256:5c6bd9dc7a543b7fe4304a631f8a8a3b674e2bbfc49c2ae96200cdbe55df6b17" },
|
||||||
]
|
]
|
||||||
sentry-sdk = [
|
sentry-sdk = [
|
||||||
{file = "sentry-sdk-1.5.6.tar.gz", hash = "sha256:ac2a50128409d57655279817aedcb7800cace1f76b266f3dd62055d5afd6e098"},
|
{ file = "sentry-sdk-1.5.5.tar.gz", hash = "sha256:98fd155fa5d5fec1dbabed32a1a4ae2705f1edaa5dae4e7f7b62a384ba30e759" },
|
||||||
{file = "sentry_sdk-1.5.6-py2.py3-none-any.whl", hash = "sha256:1ab34e3851a34aeb3d1af1a0f77cec73978c4e9698e5210d050e4932953cb241"},
|
{ file = "sentry_sdk-1.5.5-py2.py3-none-any.whl", hash = "sha256:3817274fba2498c8ebf6b896ee98ac916c5598706340573268c07bf2bb30d831" },
|
||||||
]
|
]
|
||||||
six = [
|
six = [
|
||||||
{ file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" },
|
{ file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" },
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
|
import logging
|
||||||
|
import pathlib
|
||||||
|
import re
|
||||||
|
|
||||||
|
import coloredlogs
|
||||||
import discord
|
import discord
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
import royalnet.scrolls as sc
|
import royalnet.scrolls as sc
|
||||||
import royalnet_telethon as rt
|
|
||||||
import royalnet_discordpy as rd
|
import royalnet_discordpy as rd
|
||||||
import pathlib
|
import royalnet_telethon as rt
|
||||||
import re
|
|
||||||
import coloredlogs
|
|
||||||
import sentry_sdk
|
|
||||||
import sentry_sdk.integrations.atexit
|
import sentry_sdk.integrations.atexit
|
||||||
import sentry_sdk.integrations.dedupe
|
import sentry_sdk.integrations.dedupe
|
||||||
import sentry_sdk.integrations.modules
|
import sentry_sdk.integrations.modules
|
||||||
import sentry_sdk.integrations.threading
|
import sentry_sdk.integrations.threading
|
||||||
import logging
|
|
||||||
|
|
||||||
from . import commands
|
from . import commands
|
||||||
from .database import engine, base
|
from .database import engine, base
|
||||||
|
@ -101,11 +101,13 @@ register_telegram(tg_router, commands.whoami, ["whoami"])
|
||||||
register_telegram(tg_router, commands.fiorygi_balance_self, ["balance"])
|
register_telegram(tg_router, commands.fiorygi_balance_self, ["balance"])
|
||||||
register_telegram(tg_router, commands.fiorygi_balance_other, ["balance"], r"(?P<target>\S+)")
|
register_telegram(tg_router, commands.fiorygi_balance_other, ["balance"], r"(?P<target>\S+)")
|
||||||
register_telegram(tg_router, commands.fiorygi_give, ["give"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
register_telegram(tg_router, commands.fiorygi_give, ["give"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
||||||
register_telegram(tg_router, commands.fiorygi_magick, ["magick"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
register_telegram(tg_router, commands.fiorygi_magick, ["magick"],
|
||||||
|
r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
||||||
register_telegram(tg_router, commands.fiorygi_transactions_self, ["transactions"])
|
register_telegram(tg_router, commands.fiorygi_transactions_self, ["transactions"])
|
||||||
register_telegram(tg_router, commands.fiorygi_transactions_other, ["transactions"], r"(?P<target>\S+)")
|
register_telegram(tg_router, commands.fiorygi_transactions_other, ["transactions"], r"(?P<target>\S+)")
|
||||||
register_telegram(tg_router, commands.fiorygi_dig, ["dig"], r"(?P<slug>[a-z0-9-]+)")
|
register_telegram(tg_router, commands.fiorygi_dig, ["dig"], r"(?P<slug>[a-z0-9-]+)")
|
||||||
register_telegram(tg_router, commands.fiorygi_bury, ["bury"], r"(?P<slug>[a-z0-9-]+)\s+(?P<value>[0-9]+)(?:\s+(?P<message>.+))?")
|
register_telegram(tg_router, commands.fiorygi_bury, ["bury"],
|
||||||
|
r"(?P<slug>[a-z0-9-]+)\s+(?P<value>[0-9]+)(?:\s+(?P<message>.+))?")
|
||||||
register_telegram(tg_router, commands.version, ["version"])
|
register_telegram(tg_router, commands.version, ["version"])
|
||||||
register_telegram(tg_router, commands.cv, ["cv", "civù"])
|
register_telegram(tg_router, commands.cv, ["cv", "civù"])
|
||||||
register_telegram(tg_router, commands.rocoinflip, ["rocoinflip"], r'"(?P<teama>[^"]+)"\s+"(?P<teamb>[^"]+)"')
|
register_telegram(tg_router, commands.rocoinflip, ["rocoinflip"], r'"(?P<teama>[^"]+)"\s+"(?P<teamb>[^"]+)"')
|
||||||
|
@ -135,11 +137,13 @@ register_discord(ds_router, commands.whoami, ["whoami"])
|
||||||
register_discord(ds_router, commands.fiorygi_balance_self, ["balance"])
|
register_discord(ds_router, commands.fiorygi_balance_self, ["balance"])
|
||||||
register_discord(ds_router, commands.fiorygi_balance_other, ["balance"], r"(?P<target>\S+)")
|
register_discord(ds_router, commands.fiorygi_balance_other, ["balance"], r"(?P<target>\S+)")
|
||||||
register_discord(ds_router, commands.fiorygi_give, ["give"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
register_discord(ds_router, commands.fiorygi_give, ["give"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
||||||
register_discord(ds_router, commands.fiorygi_magick, ["magick"], r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
register_discord(ds_router, commands.fiorygi_magick, ["magick"],
|
||||||
|
r"(?P<target>\S+)\s+(?P<amount>[0-9]+)\s+(?P<reason>.+)")
|
||||||
register_discord(ds_router, commands.fiorygi_transactions_self, ["transactions"])
|
register_discord(ds_router, commands.fiorygi_transactions_self, ["transactions"])
|
||||||
register_discord(ds_router, commands.fiorygi_transactions_other, ["transactions"], r"(?P<target>\S+)")
|
register_discord(ds_router, commands.fiorygi_transactions_other, ["transactions"], r"(?P<target>\S+)")
|
||||||
register_discord(ds_router, commands.fiorygi_dig, ["dig"], r"(?P<slug>[a-z0-9-]+)")
|
register_discord(ds_router, commands.fiorygi_dig, ["dig"], r"(?P<slug>[a-z0-9-]+)")
|
||||||
register_discord(ds_router, commands.fiorygi_bury, ["bury"], r"(?P<slug>[a-z0-9-]+)\s+(?P<value>[0-9]+)(?:\s+(?P<message>.+))?")
|
register_discord(ds_router, commands.fiorygi_bury, ["bury"],
|
||||||
|
r"(?P<slug>[a-z0-9-]+)\s+(?P<value>[0-9]+)(?:\s+(?P<message>.+))?")
|
||||||
register_discord(ds_router, commands.version, ["version"])
|
register_discord(ds_router, commands.version, ["version"])
|
||||||
register_discord(ds_router, commands.rocoinflip, ["rocoinflip"], r'"(?P<teama>[^"]+)"\s+"(?P<teamb>[^"]+)"')
|
register_discord(ds_router, commands.rocoinflip, ["rocoinflip"], r'"(?P<teama>[^"]+)"\s+"(?P<teamb>[^"]+)"')
|
||||||
register_discord(ds_router, commands.hack, ["hack"], r'(?P<activity>.+)')
|
register_discord(ds_router, commands.hack, ["hack"], r'(?P<activity>.+)')
|
||||||
|
@ -149,5 +153,4 @@ register_discord(ds_router, commands.loginprogress, ["loginprogress"])
|
||||||
pda.implementations["telethon.1"].register_conversation(tg_router)
|
pda.implementations["telethon.1"].register_conversation(tg_router)
|
||||||
pda.implementations["discordpy.2"].register_conversation(ds_router)
|
pda.implementations["discordpy.2"].register_conversation(ds_router)
|
||||||
|
|
||||||
|
|
||||||
pda.run()
|
pda.run()
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
from .login import *
|
from .login import *
|
||||||
from .target import *
|
|
||||||
from .sentry import *
|
from .sentry import *
|
||||||
|
from .target import *
|
||||||
|
|
|
@ -6,6 +6,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
|
@ -3,21 +3,21 @@ from .answer import *
|
||||||
from .cat import *
|
from .cat import *
|
||||||
from .ciaoruozi import *
|
from .ciaoruozi import *
|
||||||
from .color import *
|
from .color import *
|
||||||
from .ping import *
|
from .cv import *
|
||||||
from .ship import *
|
from .diobot import *
|
||||||
from .emojify import *
|
|
||||||
from .dog import *
|
from .dog import *
|
||||||
|
from .emojify import *
|
||||||
|
from .fiorygi import *
|
||||||
from .fortune import *
|
from .fortune import *
|
||||||
from .pmots import *
|
from .hack import *
|
||||||
from .spell import *
|
|
||||||
from .smecds import *
|
|
||||||
from .man import *
|
|
||||||
from .login import *
|
from .login import *
|
||||||
from .loginprogress import *
|
from .loginprogress import *
|
||||||
from .whoami import *
|
from .man import *
|
||||||
from .fiorygi import *
|
from .ping import *
|
||||||
from .version import *
|
from .pmots import *
|
||||||
from .cv import *
|
|
||||||
from .rocoinflip import *
|
from .rocoinflip import *
|
||||||
from .hack import *
|
from .ship import *
|
||||||
from .diobot import *
|
from .smecds import *
|
||||||
|
from .spell import *
|
||||||
|
from .version import *
|
||||||
|
from .whoami import *
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import datetime
|
import datetime
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
ANSWERS = [
|
ANSWERS = [
|
||||||
# Cerchiamo di tenere bilanciate le tre colonne, o almeno le prime due.
|
# Cerchiamo di tenere bilanciate le tre colonne, o almeno le prime due.
|
||||||
|
|
|
@ -3,6 +3,7 @@ import logging
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
import royalnet_telethon
|
import royalnet_telethon
|
||||||
import royalnet_telethon.bullet.contents
|
import royalnet_telethon.bullet.contents
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import royalnet.royaltyping as t
|
import itertools
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalnet_discordpy as rd
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import discord
|
import discord
|
||||||
import discord.channel
|
import discord.channel
|
||||||
import itertools
|
import royalnet.engineer as engi
|
||||||
|
import royalnet.royaltyping as t
|
||||||
|
import royalnet_discordpy as rd
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
@rb.capture_errors
|
@rb.capture_errors
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import datetime
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
WHO = [
|
WHO = [
|
||||||
# A chi sarà diretto l'insulto
|
# A chi sarà diretto l'insulto
|
||||||
["Dio", "o"],
|
["Dio", "o"],
|
||||||
|
|
|
@ -2,6 +2,7 @@ import io
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
_emojis = {
|
_emojis = {
|
||||||
"abcd": ["🔡", "🔠"],
|
"abcd": ["🔡", "🔠"],
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import royalnet.royaltyping as t
|
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalpack.database as db
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import sqlalchemy.sql as ss
|
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
import arrow
|
import arrow
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
import royalnet.royaltyping as t
|
||||||
|
import sqlalchemy.sql as ss
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
import royalpack.database as db
|
||||||
|
|
||||||
|
|
||||||
@rb.capture_errors
|
@rb.capture_errors
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import random
|
|
||||||
import datetime
|
import datetime
|
||||||
import royalpack.bolts as rb
|
import random
|
||||||
|
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
# Tutte le fortunes qui devono essere positive :)
|
# Tutte le fortunes qui devono essere positive :)
|
||||||
# O almeno neutrali...
|
# O almeno neutrali...
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import royalnet.royaltyping as t
|
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalnet_discordpy
|
|
||||||
import royalnet_discordpy.bullet.contents
|
|
||||||
import discord
|
import discord
|
||||||
import discord.http
|
import discord.http
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
import royalnet.royaltyping as t
|
||||||
|
import royalnet_discordpy
|
||||||
|
import royalnet_discordpy.bullet.contents
|
||||||
|
|
||||||
activities = {
|
activities = {
|
||||||
"yt": 755600276941176913,
|
"yt": 755600276941176913,
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import discord
|
|
||||||
import royalnet.royaltyping as t
|
|
||||||
import royalnet.engineer as engi
|
|
||||||
import sqlalchemy.orm as so
|
|
||||||
import royalpack.database as db
|
|
||||||
import royalpack.config as cfg
|
|
||||||
import royalnet_telethon.bullet.contents
|
|
||||||
import royalnet_discordpy
|
|
||||||
import royalpack.bolts as rb
|
|
||||||
import aiohttp
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
import arrow
|
import arrow
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
import discord
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
import royalnet.royaltyping as t
|
||||||
|
import royalnet_discordpy
|
||||||
|
import royalnet_telethon.bullet.contents
|
||||||
|
import sqlalchemy.orm as so
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
import royalpack.config as cfg
|
||||||
|
import royalpack.database as db
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
import royalpack.database as db
|
|
||||||
import sqlalchemy.orm as so
|
import sqlalchemy.orm as so
|
||||||
import sqlalchemy.sql as ss
|
import sqlalchemy.sql as ss
|
||||||
import royalpack.bolts as rb
|
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
import royalpack.database as db
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
"mrdima",
|
"mrdima",
|
||||||
|
@ -78,7 +78,6 @@ async def loginprogress(*, _msg: engi.Message, _session: so.Session, **__):
|
||||||
discord = list(map(_has_discord_account, expected))
|
discord = list(map(_has_discord_account, expected))
|
||||||
|
|
||||||
def _render_line(index: int) -> str:
|
def _render_line(index: int) -> str:
|
||||||
|
|
||||||
def _telegram_emoji() -> str:
|
def _telegram_emoji() -> str:
|
||||||
return telegram_emoji(telegram[index])
|
return telegram_emoji(telegram[index])
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import royalpack.bolts as rb
|
|
||||||
|
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import random
|
import random
|
||||||
import royalpack.bolts as rb
|
|
||||||
|
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
|
||||||
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
_ds_list = ["della secca", "del seccatore", "del secchiello", "del secchio", "del secchione", "del secondino",
|
_ds_list = ["della secca", "del seccatore", "del secchiello", "del secchio", "del secchione", "del secondino",
|
||||||
"del sedano", "del sedativo", "della sedia", "del sedicente", "del sedile", "della sega", "del segale",
|
"del sedano", "del sedativo", "della sedia", "del sedicente", "del sedile", "della sega", "del segale",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
import royalspells
|
import royalspells
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import royalnet.engineer as engi
|
|
||||||
import royalnet_telethon as rt
|
|
||||||
import royalnet_discordpy as rd
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
import royalnet.engineer as engi
|
||||||
|
import royalnet_discordpy as rd
|
||||||
|
import royalnet_telethon as rt
|
||||||
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,9 +22,11 @@ async def version(*, _imp: engi.PDAImplementation, _msg: engi.Message, **__):
|
||||||
msg.append(f"- \uE01Croyalnet\uE00C \uE01B{pkg_resources.get_distribution('royalnet').version}\uE00B")
|
msg.append(f"- \uE01Croyalnet\uE00C \uE01B{pkg_resources.get_distribution('royalnet').version}\uE00B")
|
||||||
|
|
||||||
if isinstance(_imp, rt.TelethonPDAImplementation):
|
if isinstance(_imp, rt.TelethonPDAImplementation):
|
||||||
msg.append(f"- \uE01Croyalnet_telethon\uE00C \uE01B{pkg_resources.get_distribution('royalnet_telethon').version}\uE00B")
|
msg.append(
|
||||||
|
f"- \uE01Croyalnet_telethon\uE00C \uE01B{pkg_resources.get_distribution('royalnet_telethon').version}\uE00B")
|
||||||
elif isinstance(_imp, rd.DiscordpyPDAImplementation):
|
elif isinstance(_imp, rd.DiscordpyPDAImplementation):
|
||||||
msg.append(f"- \uE01Croyalnet_discordpy\uE00C \uE01B{pkg_resources.get_distribution('royalnet_discordpy').version}\uE00B")
|
msg.append(
|
||||||
|
f"- \uE01Croyalnet_discordpy\uE00C \uE01B{pkg_resources.get_distribution('royalnet_discordpy').version}\uE00B")
|
||||||
|
|
||||||
msg.append(f"- \uE01Croyalpack\uE00C \uE01B{pkg_resources.get_distribution('royalpack').version}\uE00B")
|
msg.append(f"- \uE01Croyalpack\uE00C \uE01B{pkg_resources.get_distribution('royalpack').version}\uE00B")
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import royalnet.engineer as engi
|
import royalnet.engineer as engi
|
||||||
import royalpack.database as db
|
|
||||||
import royalpack.bolts as rb
|
import royalpack.bolts as rb
|
||||||
|
import royalpack.database as db
|
||||||
|
|
||||||
|
|
||||||
@rb.capture_errors
|
@rb.capture_errors
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import pathlib
|
import pathlib
|
||||||
import royalnet.scrolls as s
|
|
||||||
import royalnet.lazy as l
|
|
||||||
|
|
||||||
|
import royalnet.lazy as l
|
||||||
|
import royalnet.scrolls as s
|
||||||
|
|
||||||
lazy_config = l.Lazy(lambda: s.Scroll.from_file("ROYALPACK", pathlib.Path("royalpack.cfg.toml")))
|
lazy_config = l.Lazy(lambda: s.Scroll.from_file("ROYALPACK", pathlib.Path("royalpack.cfg.toml")))
|
||||||
|
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
"lazy_config",
|
"lazy_config",
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
import logging.config
|
import logging.config
|
||||||
import sqlalchemy
|
|
||||||
import sqlalchemy.pool
|
|
||||||
import alembic
|
import alembic
|
||||||
|
|
||||||
|
from royalpack.config import lazy_config
|
||||||
from royalpack.database.base import Base
|
from royalpack.database.base import Base
|
||||||
from royalpack.database.engine import lazy_engine
|
from royalpack.database.engine import lazy_engine
|
||||||
from royalpack.config import lazy_config
|
|
||||||
|
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
logging.config.fileConfig(alembic.context.config.config_file_name)
|
logging.config.fileConfig(alembic.context.config.config_file_name)
|
||||||
|
|
||||||
|
|
||||||
# Get the metadata
|
# Get the metadata
|
||||||
target_metadata = Base.metadata
|
target_metadata = Base.metadata
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ Create Date: 2021-04-25 23:17:50.846179
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
|
||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
|
|
|
@ -5,10 +5,9 @@ Revises:
|
||||||
Create Date: 2021-04-25 01:00:49.131019
|
Create Date: 2021-04-25 01:00:49.131019
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
import sqlalchemy_utils
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = 'c6aacbd5d796'
|
revision = 'c6aacbd5d796'
|
||||||
|
|
|
@ -5,10 +5,9 @@ Revises: c6aacbd5d796
|
||||||
Create Date: 2021-04-25 02:18:44.248837
|
Create Date: 2021-04-25 02:18:44.248837
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
import sqlalchemy_utils
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = 'e6b0d97063a1'
|
revision = 'e6b0d97063a1'
|
||||||
|
@ -19,8 +18,10 @@ depends_on = None
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.add_column('fiorygi_transactions', sa.Column('timestamp', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
|
op.add_column('fiorygi_transactions',
|
||||||
op.add_column('fiorygi_treasures', sa.Column('creation_time', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False))
|
sa.Column('timestamp', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
|
||||||
|
op.add_column('fiorygi_treasures',
|
||||||
|
sa.Column('creation_time', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False))
|
||||||
op.add_column('fiorygi_treasures', sa.Column('find_time', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False))
|
op.add_column('fiorygi_treasures', sa.Column('find_time', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False))
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import typing as t
|
|
||||||
import sqlalchemy as s
|
|
||||||
import sqlalchemy.sql as ss
|
|
||||||
import sqlalchemy.orm as so
|
|
||||||
import sqlalchemy.ext.declarative as sed
|
|
||||||
import sqlalchemy_utils as su
|
|
||||||
import royalnet.alchemist as ra
|
|
||||||
import colour
|
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
import colour
|
||||||
|
import royalnet.alchemist as ra
|
||||||
|
import sqlalchemy as s
|
||||||
|
import sqlalchemy.ext.declarative as sed
|
||||||
|
import sqlalchemy.orm as so
|
||||||
|
import sqlalchemy.sql as ss
|
||||||
|
import sqlalchemy_utils as su
|
||||||
|
|
||||||
Base: sed.declarative_base = sed.declarative_base()
|
Base: sed.declarative_base = sed.declarative_base()
|
||||||
|
|
||||||
|
|
||||||
user_title_association = s.Table(
|
user_title_association = s.Table(
|
||||||
"user_title_association",
|
"user_title_association",
|
||||||
Base.metadata,
|
Base.metadata,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import sqlalchemy.orm
|
|
||||||
import royalnet.lazy
|
import royalnet.lazy
|
||||||
|
import sqlalchemy.orm
|
||||||
|
|
||||||
from ..config import *
|
from ..config import *
|
||||||
|
|
||||||
|
|
||||||
lazy_engine = royalnet.lazy.Lazy(lambda c: sqlalchemy.create_engine(c["database.uri"]), c=lazy_config)
|
lazy_engine = royalnet.lazy.Lazy(lambda c: sqlalchemy.create_engine(c["database.uri"]), c=lazy_config)
|
||||||
"""
|
"""
|
||||||
The uninitialized sqlalchemy engine.
|
The uninitialized sqlalchemy engine.
|
||||||
|
|
|
@ -7,11 +7,12 @@ Data is fetched from the `Toofz API`_, which in turn fetches it from the Steam l
|
||||||
.. _SteamKit: https://github.com/SteamRE/SteamKit
|
.. _SteamKit: https://github.com/SteamRE/SteamKit
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import royalnet.royaltyping as t
|
|
||||||
import aiohttp
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
|
import royalnet.royaltyping as t
|
||||||
|
|
||||||
|
|
||||||
async def get_leaderboards_info() -> list[t.JSON]:
|
async def get_leaderboards_info() -> list[t.JSON]:
|
||||||
"""
|
"""
|
||||||
|
@ -50,7 +51,8 @@ async def get_all_leaderboard_entries(lbid):
|
||||||
|
|
||||||
while total is None or offset < total:
|
while total is None or offset < total:
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get(f"https://api.toofz.com/leaderboards/dailies/{lbid}/entries?offset={offset}&limit=100") as request:
|
async with session.get(
|
||||||
|
f"https://api.toofz.com/leaderboards/dailies/{lbid}/entries?offset={offset}&limit=100") as request:
|
||||||
print(f"{total=} {offset=} {result=}")
|
print(f"{total=} {offset=} {result=}")
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
assert data["leaderboard"]["id"] == lbid
|
assert data["leaderboard"]["id"] == lbid
|
||||||
|
|
Loading…
Reference in a new issue