Finally add logging, use dateparser in RemindMe

This commit is contained in:
Zeva Rose 2022-03-23 18:27:23 -06:00
parent 75b850e734
commit b0c461ab7d
26 changed files with 349 additions and 78 deletions

View file

@ -1,6 +1,7 @@
[flake8] [flake8]
extend-ignore = extend-ignore =
Q0, E501, C812, E203, W503, # These default to arguing with Black. We might configure some of them eventually Q0, E501, C812, E203, W503, # These default to arguing with Black. We might configure some of them eventually
ANN002, ANN003, # Ignore *args, **kwargs
ANN1, # Ignore self and cls annotations ANN1, # Ignore self and cls annotations
ANN204, ANN206, # return annotations for special methods and class methods ANN204, ANN206, # return annotations for special methods and class methods
D105, D107, # Missing Docstrings in magic method and __init__ D105, D107, # Missing Docstrings in magic method and __init__

View file

@ -4,22 +4,25 @@ from importlib.metadata import version as _v
from dis_snek import Intents from dis_snek import Intents
from jarvis_core.db import connect from jarvis_core.db import connect
from jarvis_core.log import get_logger
from jarvis import utils from jarvis import utils
from jarvis.client import Jarvis from jarvis.client import Jarvis
from jarvis.config import get_config from jarvis.config import JarvisConfig
try: try:
__version__ = _v("jarvis") __version__ = _v("jarvis")
except Exception: except Exception:
__version__ = "0.0.0" __version__ = "0.0.0"
jconfig = get_config() jconfig = JarvisConfig.from_yaml()
logger = logging.getLogger("discord") logger = get_logger("jarvis")
logger.setLevel(logging.getLevelName(jconfig.log_level)) logger.setLevel(jconfig.log_level)
file_handler = logging.FileHandler(filename="jarvis.log", encoding="UTF-8", mode="w") file_handler = logging.FileHandler(filename="jarvis.log", encoding="UTF-8", mode="w")
file_handler.setFormatter(logging.Formatter("[%(asctime)s][%(levelname)s][%(name)s] %(message)s")) file_handler.setFormatter(
logging.Formatter("[%(asctime)s] [%(name)s] [%(levelname)8s] %(message)s")
)
logger.addHandler(file_handler) logger.addHandler(file_handler)
intents = Intents.DEFAULT | Intents.MESSAGES | Intents.GUILD_MEMBERS | Intents.GUILD_MESSAGES intents = Intents.DEFAULT | Intents.MESSAGES | Intents.GUILD_MEMBERS | Intents.GUILD_MESSAGES
@ -31,11 +34,17 @@ jarvis = Jarvis(intents=intents, default_prefix="!", sync_interactions=jconfig.s
async def run() -> None: async def run() -> None:
"""Run J.A.R.V.I.S.""" """Run J.A.R.V.I.S."""
logger.info("Starting JARVIS")
logger.debug("Connecting to database")
connect(**jconfig.mongo["connect"], testing=jconfig.mongo["database"] != "jarvis") connect(**jconfig.mongo["connect"], testing=jconfig.mongo["database"] != "jarvis")
jconfig.get_db_config() logger.debug("Loading configuration from database")
# jconfig.get_db_config()
logger.debug("Loading extensions")
for extension in utils.get_extensions(): for extension in utils.get_extensions():
jarvis.load_extension(extension) jarvis.load_extension(extension)
logger.debug(f"Loaded {extension}")
jarvis.max_messages = jconfig.max_messages jarvis.max_messages = jconfig.max_messages
logger.debug("Running JARVIS")
await jarvis.astart(jconfig.token) await jarvis.astart(jconfig.token)

View file

@ -1,4 +1,5 @@
"""Custom JARVIS client.""" """Custom JARVIS client."""
import logging
import re import re
import traceback import traceback
from datetime import datetime from datetime import datetime
@ -49,15 +50,19 @@ CMD_FMT = fmt(Fore.GREEN, Format.BOLD)
class Jarvis(Snake): class Jarvis(Snake):
def __init__(self, *args, **kwargs): # noqa: ANN002 ANN003 def __init__(self, *args, **kwargs): # noqa: ANN002 ANN003
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.logger = logging.getLogger(__name__)
self.phishing_domains = [] self.phishing_domains = []
@Task.create(IntervalTrigger(days=1)) @Task.create(IntervalTrigger(days=1))
async def _update_domains(self) -> None: async def _update_domains(self) -> None:
self.logger.debug("Updating phishing domains")
async with ClientSession(headers={"X-Identity": "Discord: zevaryx#5779"}) as session: async with ClientSession(headers={"X-Identity": "Discord: zevaryx#5779"}) as session:
response = await session.get("https://phish.sinking.yachts/v2/recent/86415") response = await session.get("https://phish.sinking.yachts/v2/recent/86415")
response.raise_for_status() response.raise_for_status()
data = await response.json() data = await response.json()
self.logger.debug(f"Found {len(data)} changes to phishing domains")
for update in data: for update in data:
if update["type"] == "add": if update["type"] == "add":
if update["domain"] not in self.phishing_domains: if update["domain"] not in self.phishing_domains:
@ -67,19 +72,21 @@ class Jarvis(Snake):
self.phishing_domains.remove(update["domain"]) self.phishing_domains.remove(update["domain"])
async def _sync_domains(self) -> None: async def _sync_domains(self) -> None:
self.logger.debug("Loading phishing domains")
async with ClientSession(headers={"X-Identity": "Discord: zevaryx#5779"}) as session: async with ClientSession(headers={"X-Identity": "Discord: zevaryx#5779"}) as session:
response = await session.get("https://phish.sinking.yachts/v2/all") response = await session.get("https://phish.sinking.yachts/v2/all")
response.raise_for_status() response.raise_for_status()
self.phishing_domains = await response.json() self.phishing_domains = await response.json()
self.logger.info(f"Protected from {len(self.phishing_domains)} phishing domains")
@listen() @listen()
async def on_ready(self) -> None: async def on_ready(self) -> None:
"""Lepton on_ready override.""" """Lepton on_ready override."""
await self._sync_domains() await self._sync_domains()
self._update_domains.start() self._update_domains.start()
print("Logged in as {}".format(self.user)) # noqa: T001 self.logger.info("Logged in as {}".format(self.user)) # noqa: T001
print("Connected to {} guild(s)".format(len(self.guilds))) # noqa: T001 self.logger.info("Connected to {} guild(s)".format(len(self.guilds))) # noqa: T001
print( # noqa: T001 self.logger.info( # noqa: T001
"https://discord.com/api/oauth2/authorize?client_id=" "https://discord.com/api/oauth2/authorize?client_id="
"{}&permissions=8&scope=bot%20applications.commands".format(self.user.id) "{}&permissions=8&scope=bot%20applications.commands".format(self.user.id)
) )
@ -418,7 +425,11 @@ class Jarvis(Snake):
message = event.message message = event.message
modlog = await Setting.find_one(q(guild=message.guild.id, setting="modlog")) modlog = await Setting.find_one(q(guild=message.guild.id, setting="modlog"))
if modlog: if modlog:
fields = [EmbedField("Original Message", message.content or "N/A", False)] try:
content = message.content or "N/A"
except AttributeError:
content = "N/A"
fields = [EmbedField("Original Message", content, False)]
if message.attachments: if message.attachments:
value = "\n".join([f"[{x.filename}]({x.url})" for x in message.attachments]) value = "\n".join([f"[{x.filename}]({x.url})" for x in message.attachments])

View file

@ -1,7 +1,8 @@
"""J.A.R.V.I.S. BanCog.""" """J.A.R.V.I.S. BanCog."""
import logging
import re import re
from dis_snek import InteractionContext, Permissions from dis_snek import InteractionContext, Permissions, Snake
from dis_snek.client.utils.misc_utils import find, find_all from dis_snek.client.utils.misc_utils import find, find_all
from dis_snek.ext.paginators import Paginator from dis_snek.ext.paginators import Paginator
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
@ -24,6 +25,10 @@ from jarvis.utils.permissions import admin_or_permissions
class BanCog(ModcaseCog): class BanCog(ModcaseCog):
"""J.A.R.V.I.S. BanCog.""" """J.A.R.V.I.S. BanCog."""
def __init__(self, bot: Snake):
super().__init__(bot)
self.logger = logging.getLogger(__name__)
async def discord_apply_ban( async def discord_apply_ban(
self, self,
ctx: InteractionContext, ctx: InteractionContext,

View file

@ -1,5 +1,7 @@
"""J.A.R.V.I.S. KickCog.""" """J.A.R.V.I.S. KickCog."""
from dis_snek import InteractionContext, Permissions import logging
from dis_snek import InteractionContext, Permissions, Snake
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
from dis_snek.models.discord.user import User from dis_snek.models.discord.user import User
from dis_snek.models.snek.application_commands import ( from dis_snek.models.snek.application_commands import (
@ -18,6 +20,10 @@ from jarvis.utils.permissions import admin_or_permissions
class KickCog(ModcaseCog): class KickCog(ModcaseCog):
"""J.A.R.V.I.S. KickCog.""" """J.A.R.V.I.S. KickCog."""
def __init__(self, bot: Snake):
super().__init__(bot)
self.logger = logging.getLogger(__name__)
@slash_command(name="kick", description="Kick a user") @slash_command(name="kick", description="Kick a user")
@slash_option(name="user", description="User to kick", opt_type=OptionTypes.USER, required=True) @slash_option(name="user", description="User to kick", opt_type=OptionTypes.USER, required=True)
@slash_option( @slash_option(

View file

@ -1,7 +1,8 @@
"""J.A.R.V.I.S. LockCog.""" """J.A.R.V.I.S. LockCog."""
import logging
from typing import Union from typing import Union
from dis_snek import InteractionContext, Scale from dis_snek import InteractionContext, Scale, Snake
from dis_snek.client.utils.misc_utils import get from dis_snek.client.utils.misc_utils import get
from dis_snek.models.discord.channel import GuildText, GuildVoice from dis_snek.models.discord.channel import GuildText, GuildVoice
from dis_snek.models.discord.enums import Permissions from dis_snek.models.discord.enums import Permissions
@ -20,6 +21,10 @@ from jarvis.utils.permissions import admin_or_permissions
class LockCog(Scale): class LockCog(Scale):
"""J.A.R.V.I.S. LockCog.""" """J.A.R.V.I.S. LockCog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command(name="lock", description="Lock a channel") @slash_command(name="lock", description="Lock a channel")
@slash_option( @slash_option(
name="reason", name="reason",

View file

@ -1,4 +1,6 @@
"""J.A.R.V.I.S. LockdownCog.""" """J.A.R.V.I.S. LockdownCog."""
import logging
from dis_snek import InteractionContext, Scale, Snake from dis_snek import InteractionContext, Scale, Snake
from dis_snek.client.utils.misc_utils import find_all, get from dis_snek.client.utils.misc_utils import find_all, get
from dis_snek.models.discord.channel import GuildCategory, GuildChannel from dis_snek.models.discord.channel import GuildCategory, GuildChannel
@ -93,6 +95,10 @@ async def unlock_all(bot: Snake, guild: Guild, admin: Member) -> None:
class LockdownCog(Scale): class LockdownCog(Scale):
"""J.A.R.V.I.S. LockdownCog.""" """J.A.R.V.I.S. LockdownCog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command( @slash_command(
name="lockdown", name="lockdown",
description="Manage server-wide lockdown", description="Manage server-wide lockdown",

View file

@ -1,7 +1,8 @@
"""J.A.R.V.I.S. MuteCog.""" """J.A.R.V.I.S. MuteCog."""
import logging
from datetime import datetime from datetime import datetime
from dis_snek import InteractionContext, Permissions from dis_snek import InteractionContext, Permissions, Snake
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
from dis_snek.models.discord.user import Member from dis_snek.models.discord.user import Member
from dis_snek.models.snek.application_commands import ( from dis_snek.models.snek.application_commands import (
@ -21,6 +22,10 @@ from jarvis.utils.permissions import admin_or_permissions
class MuteCog(ModcaseCog): class MuteCog(ModcaseCog):
"""J.A.R.V.I.S. MuteCog.""" """J.A.R.V.I.S. MuteCog."""
def __init__(self, bot: Snake):
super().__init__(bot)
self.logger = logging.getLogger(__name__)
@slash_command(name="mute", description="Mute a user") @slash_command(name="mute", description="Mute a user")
@slash_option(name="user", description="User to mute", opt_type=OptionTypes.USER, required=True) @slash_option(name="user", description="User to mute", opt_type=OptionTypes.USER, required=True)
@slash_option( @slash_option(

View file

@ -1,4 +1,6 @@
"""J.A.R.V.I.S. PurgeCog.""" """J.A.R.V.I.S. PurgeCog."""
import logging
from dis_snek import InteractionContext, Permissions, Scale, Snake from dis_snek import InteractionContext, Permissions, Scale, Snake
from dis_snek.models.discord.channel import GuildText from dis_snek.models.discord.channel import GuildText
from dis_snek.models.snek.application_commands import ( from dis_snek.models.snek.application_commands import (
@ -18,6 +20,7 @@ class PurgeCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command(name="purge", description="Purge messages from channel") @slash_command(name="purge", description="Purge messages from channel")
@slash_option( @slash_option(

View file

@ -1,5 +1,7 @@
"""J.A.R.V.I.S. RolepingCog.""" """J.A.R.V.I.S. RolepingCog."""
from dis_snek import InteractionContext, Permissions, Scale import logging
from dis_snek import InteractionContext, Permissions, Scale, Snake
from dis_snek.client.utils.misc_utils import find_all from dis_snek.client.utils.misc_utils import find_all
from dis_snek.ext.paginators import Paginator from dis_snek.ext.paginators import Paginator
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
@ -21,6 +23,10 @@ from jarvis.utils.permissions import admin_or_permissions
class RolepingCog(Scale): class RolepingCog(Scale):
"""J.A.R.V.I.S. RolepingCog.""" """J.A.R.V.I.S. RolepingCog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command( @slash_command(
name="roleping", name="roleping",
description="Set up warnings for pinging specific roles", description="Set up warnings for pinging specific roles",

View file

@ -1,5 +1,7 @@
"""J.A.R.V.I.S. WarningCog.""" """J.A.R.V.I.S. WarningCog."""
from dis_snek import InteractionContext, Permissions import logging
from dis_snek import InteractionContext, Permissions, Snake
from dis_snek.client.utils.misc_utils import get_all from dis_snek.client.utils.misc_utils import get_all
from dis_snek.ext.paginators import Paginator from dis_snek.ext.paginators import Paginator
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
@ -10,6 +12,7 @@ from dis_snek.models.snek.application_commands import (
slash_option, slash_option,
) )
from dis_snek.models.snek.command import check from dis_snek.models.snek.command import check
from jarvis_core.db import q
from jarvis_core.db.models import Warning from jarvis_core.db.models import Warning
from jarvis.utils import build_embed from jarvis.utils import build_embed
@ -21,6 +24,10 @@ from jarvis.utils.permissions import admin_or_permissions
class WarningCog(ModcaseCog): class WarningCog(ModcaseCog):
"""J.A.R.V.I.S. WarningCog.""" """J.A.R.V.I.S. WarningCog."""
def __init__(self, bot: Snake):
super().__init__(bot)
self.logger = logging.getLogger(__name__)
@slash_command(name="warn", description="Warn a user") @slash_command(name="warn", description="Warn a user")
@slash_option(name="user", description="User to warn", opt_type=OptionTypes.USER, required=True) @slash_option(name="user", description="User to warn", opt_type=OptionTypes.USER, required=True)
@slash_option( @slash_option(
@ -72,8 +79,10 @@ class WarningCog(ModcaseCog):
async def _warnings(self, ctx: InteractionContext, user: User, active: bool = True) -> None: async def _warnings(self, ctx: InteractionContext, user: User, active: bool = True) -> None:
warnings = ( warnings = (
await Warning.find( await Warning.find(
user=user.id, q(
guild=ctx.guild.id, user=user.id,
guild=ctx.guild.id,
)
) )
.sort("created_at", -1) .sort("created_at", -1)
.to_list(None) .to_list(None)
@ -94,7 +103,7 @@ class WarningCog(ModcaseCog):
else: else:
fields = [] fields = []
for warn in active_warns: for warn in active_warns:
admin = await ctx.guild.get_member(warn.admin) admin = await ctx.guild.fetch_member(warn.admin)
admin_name = "||`[redacted]`||" admin_name = "||`[redacted]`||"
if admin: if admin:
admin_name = f"{admin.username}#{admin.discriminator}" admin_name = f"{admin.username}#{admin.discriminator}"
@ -144,6 +153,6 @@ class WarningCog(ModcaseCog):
embed.set_thumbnail(url=ctx.guild.icon.url) embed.set_thumbnail(url=ctx.guild.icon.url)
pages.append(embed) pages.append(embed)
paginator = Paginator(bot=self.bot, *pages, timeout=300) paginator = Paginator.create_from_embeds(self.bot, *pages, timeout=300)
await paginator.send(ctx) await paginator.send(ctx)

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. Autoreact Cog.""" """J.A.R.V.I.S. Autoreact Cog."""
import logging
import re import re
from typing import Optional, Tuple from typing import Optional, Tuple
@ -23,6 +24,7 @@ class AutoReactCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
self.custom_emote = re.compile(r"^<:\w+:(\d+)>$") self.custom_emote = re.compile(r"^<:\w+:(\d+)>$")
async def create_autoreact( async def create_autoreact(

View file

@ -1,9 +1,9 @@
"""J.A.R.V.I.S. Complete the Code 2 Cog.""" """J.A.R.V.I.S. Complete the Code 2 Cog."""
import logging
import re import re
from datetime import datetime, timedelta
import aiohttp import aiohttp
from dis_snek import InteractionContext, Snake from dis_snek import InteractionContext, Scale, Snake
from dis_snek.ext.paginators import Paginator from dis_snek.ext.paginators import Paginator
from dis_snek.models.discord.embed import EmbedField from dis_snek.models.discord.embed import EmbedField
from dis_snek.models.discord.user import Member, User from dis_snek.models.discord.user import Member, User
@ -14,7 +14,6 @@ from jarvis_core.db import q
from jarvis_core.db.models import Guess from jarvis_core.db.models import Guess
from jarvis.utils import build_embed from jarvis.utils import build_embed
from jarvis.utils.cachecog import CacheCog
guild_ids = [578757004059738142, 520021794380447745, 862402786116763668] guild_ids = [578757004059738142, 520021794380447745, 862402786116763668]
@ -25,11 +24,12 @@ invites = re.compile(
) )
class CTCCog(CacheCog): class CTCCog(Scale):
"""J.A.R.V.I.S. Complete the Code 2 Cog.""" """J.A.R.V.I.S. Complete the Code 2 Cog."""
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
super().__init__(bot) self.bot = bot
self.logger = logging.getLogger(__name__)
self._session = aiohttp.ClientSession() self._session = aiohttp.ClientSession()
self.url = "https://completethecodetwo.cards/pw" self.url = "https://completethecodetwo.cards/pw"
@ -79,6 +79,7 @@ class CTCCog(CacheCog):
if guessed: if guessed:
await ctx.send("Already guessed, dipshit.", ephemeral=True) await ctx.send("Already guessed, dipshit.", ephemeral=True)
return return
result = await self._session.post(self.url, data=guess) result = await self._session.post(self.url, data=guess)
correct = False correct = False
if 200 <= result.status < 400: if 200 <= result.status < 400:
@ -96,15 +97,6 @@ class CTCCog(CacheCog):
) )
@cooldown(bucket=Buckets.USER, rate=1, interval=2) @cooldown(bucket=Buckets.USER, rate=1, interval=2)
async def _guesses(self, ctx: InteractionContext) -> None: async def _guesses(self, ctx: InteractionContext) -> None:
exists = self.check_cache(ctx)
if exists:
await ctx.defer(ephemeral=True)
await ctx.send(
f"Please use existing interaction: {exists['paginator']._message.jump_url}",
ephemeral=True,
)
return
guesses = Guess.objects().order_by("-correct", "-id") guesses = Guess.objects().order_by("-correct", "-id")
fields = [] fields = []
for guess in guesses: for guess in guesses:
@ -141,14 +133,6 @@ class CTCCog(CacheCog):
paginator = Paginator.create_from_embeds(self.bot, *pages, timeout=300) paginator = Paginator.create_from_embeds(self.bot, *pages, timeout=300)
self.cache[hash(paginator)] = {
"guild": ctx.guild.id,
"user": ctx.author.id,
"timeout": datetime.utcnow() + timedelta(minutes=5),
"command": ctx.subcommand_name,
"paginator": paginator,
}
await paginator.send(ctx) await paginator.send(ctx)

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. dbrand cog.""" """J.A.R.V.I.S. dbrand cog."""
import logging
import re import re
import aiohttp import aiohttp
@ -28,6 +29,7 @@ class DbrandCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
self.base_url = "https://dbrand.com/" self.base_url = "https://dbrand.com/"
self._session = aiohttp.ClientSession() self._session = aiohttp.ClientSession()
self._session.headers.update({"Content-Type": "application/json"}) self._session.headers.update({"Content-Type": "application/json"})

View file

@ -1,6 +1,7 @@
"""J.A.R.V.I.S. Developer Cog.""" """J.A.R.V.I.S. Developer Cog."""
import base64 import base64
import hashlib import hashlib
import logging
import re import re
import subprocess # noqa: S404 import subprocess # noqa: S404
import uuid as uuidpy import uuid as uuidpy
@ -47,6 +48,10 @@ MAX_FILESIZE = 5 * (1024**3) # 5GB
class DevCog(Scale): class DevCog(Scale):
"""J.A.R.V.I.S. Developer Cog.""" """J.A.R.V.I.S. Developer Cog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command(name="hash", description="Hash some data") @slash_command(name="hash", description="Hash some data")
@slash_option( @slash_option(
name="method", name="method",

View file

@ -1,5 +1,6 @@
"""J.A.R.V.I.S. GitLab Cog.""" """J.A.R.V.I.S. GitLab Cog."""
import asyncio import asyncio
import logging
from datetime import datetime from datetime import datetime
import gitlab import gitlab
@ -17,7 +18,7 @@ from dis_snek.models.snek.application_commands import (
from dis_snek.models.snek.command import cooldown from dis_snek.models.snek.command import cooldown
from dis_snek.models.snek.cooldowns import Buckets from dis_snek.models.snek.cooldowns import Buckets
from jarvis.config import get_config from jarvis.config import JarvisConfig
from jarvis.utils import build_embed from jarvis.utils import build_embed
guild_ids = [862402786116763668] guild_ids = [862402786116763668]
@ -28,7 +29,8 @@ class GitlabCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
config = get_config() self.logger = logging.getLogger(__name__)
config = JarvisConfig.from_yaml()
self._gitlab = gitlab.Gitlab("https://git.zevaryx.com", private_token=config.gitlab_token) self._gitlab = gitlab.Gitlab("https://git.zevaryx.com", private_token=config.gitlab_token)
# J.A.R.V.I.S. GitLab ID is 29 # J.A.R.V.I.S. GitLab ID is 29
self.project = self._gitlab.projects.get(29) self.project = self._gitlab.projects.get(29)
@ -473,5 +475,5 @@ class GitlabCog(Scale):
def setup(bot: Snake) -> None: def setup(bot: Snake) -> None:
"""Add GitlabCog to J.A.R.V.I.S. if Gitlab token exists.""" """Add GitlabCog to J.A.R.V.I.S. if Gitlab token exists."""
if get_config().gitlab_token: if JarvisConfig.from_yaml().gitlab_token:
GitlabCog(bot) GitlabCog(bot)

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. image processing cog.""" """J.A.R.V.I.S. image processing cog."""
import logging
import re import re
from io import BytesIO from io import BytesIO
@ -28,6 +29,7 @@ class ImageCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
self._session = aiohttp.ClientSession() self._session = aiohttp.ClientSession()
self.tgt_match = re.compile(r"([0-9]*\.?[0-9]*?) ?([KMGTP]?B?)", re.IGNORECASE) self.tgt_match = re.compile(r"([0-9]*\.?[0-9]*?) ?([KMGTP]?B?)", re.IGNORECASE)

View file

@ -1,10 +1,11 @@
"""J.A.R.V.I.S. Remind Me Cog.""" """J.A.R.V.I.S. Remind Me Cog."""
import asyncio import asyncio
import logging
import re import re
from datetime import datetime, timedelta
from typing import List from typing import List
from bson import ObjectId from bson import ObjectId
from dateparser import parse
from dis_snek import InteractionContext, Scale, Snake from dis_snek import InteractionContext, Scale, Snake
from dis_snek.client.utils.misc_utils import get from dis_snek.client.utils.misc_utils import get
from dis_snek.models.discord.channel import GuildChannel from dis_snek.models.discord.channel import GuildChannel
@ -32,6 +33,10 @@ invites = re.compile(
class RemindmeCog(Scale): class RemindmeCog(Scale):
"""J.A.R.V.I.S. Remind Me Cog.""" """J.A.R.V.I.S. Remind Me Cog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command(name="remindme", description="Set a reminder") @slash_command(name="remindme", description="Set a reminder")
@slash_option( @slash_option(
name="private", name="private",
@ -44,6 +49,14 @@ class RemindmeCog(Scale):
ctx: InteractionContext, ctx: InteractionContext,
private: bool = False, private: bool = False,
) -> None: ) -> None:
reminders = len([x async for x in Reminder.find(q(user=ctx.author.id, active=True))])
if reminders >= 5:
await ctx.send(
"You already have 5 (or more) active reminders. "
"Please either remove an old one, or wait for one to pass",
ephemeral=True,
)
return
modal = Modal( modal = Modal(
title="Set your reminder!", title="Set your reminder!",
components=[ components=[
@ -56,12 +69,13 @@ class RemindmeCog(Scale):
), ),
InputText( InputText(
label="When to remind you?", label="When to remind you?",
placeholder="1h 30m", placeholder="1h 30m | in 5 minutes | November 11, 4011",
style=TextStyles.SHORT, style=TextStyles.SHORT,
custom_id="delay", custom_id="delay",
), ),
], ],
) )
await ctx.send_modal(modal) await ctx.send_modal(modal)
try: try:
response = await self.bot.wait_for_modal(modal, author=ctx.author.id, timeout=60 * 5) response = await self.bot.wait_for_modal(modal, author=ctx.author.id, timeout=60 * 5)
@ -82,33 +96,19 @@ class RemindmeCog(Scale):
await ctx.send("Hey, you should probably make this readable", ephemeral=True) await ctx.send("Hey, you should probably make this readable", ephemeral=True)
return return
units = {"w": "weeks", "d": "days", "h": "hours", "m": "minutes", "s": "seconds"} settings = {
delta = {"weeks": 0, "days": 0, "hours": 0, "minutes": 0, "seconds": 0} "PREFER_DATES_FROM": "future",
"TIMEZONE": "UTC",
if times := time_pattern.findall(delay): "RETURN_AS_TIMEZONE_AWARE": False,
for t in times: }
delta[units[t[-1]]] += float(t[:-1]) remind_at = parse(delay, settings=settings)
else: if not remind_at:
await ctx.send( self.logger.debug(f"Failed to parse delay: {delay}")
"Invalid time string, please follow example: `1w 3d 7h 5m 20s`", ephemeral=True await response.send(
f"`{delay}` is not a parsable date, please try again", ephemeral=True
) )
return return
if not any(value for value in delta.items()):
await ctx.send("At least one time period is required", ephemeral=True)
return
reminders = len([x async for x in Reminder.find(q(user=ctx.author.id, active=True))])
if reminders >= 5:
await ctx.send(
"You already have 5 (or more) active reminders. "
"Please either remove an old one, or wait for one to pass",
ephemeral=True,
)
return
remind_at = datetime.utcnow() + timedelta(**delta)
r = Reminder( r = Reminder(
user=ctx.author.id, user=ctx.author.id,
channel=ctx.channel.id, channel=ctx.channel.id,

View file

@ -1,5 +1,6 @@
"""J.A.R.V.I.S. Role Giver Cog.""" """J.A.R.V.I.S. Role Giver Cog."""
import asyncio import asyncio
import logging
from dis_snek import InteractionContext, Permissions, Scale, Snake from dis_snek import InteractionContext, Permissions, Scale, Snake
from dis_snek.client.utils.misc_utils import get from dis_snek.client.utils.misc_utils import get
@ -25,6 +26,7 @@ class RolegiverCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command( @slash_command(
name="rolegiver", name="rolegiver",

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. Settings Management Cog.""" """J.A.R.V.I.S. Settings Management Cog."""
import logging
from typing import Any from typing import Any
from dis_snek import InteractionContext, Scale, Snake from dis_snek import InteractionContext, Scale, Snake
@ -25,6 +26,10 @@ from jarvis.utils.permissions import admin_or_permissions
class SettingsCog(Scale): class SettingsCog(Scale):
"""J.A.R.V.I.S. Settings Management Cog.""" """J.A.R.V.I.S. Settings Management Cog."""
def __init__(self, bot: Snake):
self.bot = bot
self.logger = logging.getLogger(__name__)
async def update_settings(self, setting: str, value: Any, guild: int) -> bool: async def update_settings(self, setting: str, value: Any, guild: int) -> bool:
"""Update a guild setting.""" """Update a guild setting."""
existing = await Setting.find_one(q(setting=setting, guild=guild)) existing = await Setting.find_one(q(setting=setting, guild=guild))

View file

@ -1,4 +1,6 @@
"""J.A.R.V.I.S. Starboard Cog.""" """J.A.R.V.I.S. Starboard Cog."""
import logging
from dis_snek import InteractionContext, Permissions, Scale, Snake from dis_snek import InteractionContext, Permissions, Scale, Snake
from dis_snek.client.utils.misc_utils import find from dis_snek.client.utils.misc_utils import find
from dis_snek.models.discord.channel import GuildText from dis_snek.models.discord.channel import GuildText
@ -32,6 +34,7 @@ class StarboardCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command( @slash_command(
name="starboard", name="starboard",

View file

@ -1,5 +1,6 @@
"""J.A.R.V.I.S. Twitter Cog.""" """J.A.R.V.I.S. Twitter Cog."""
import asyncio import asyncio
import logging
import tweepy import tweepy
from dis_snek import InteractionContext, Permissions, Scale, Snake from dis_snek import InteractionContext, Permissions, Scale, Snake
@ -15,7 +16,7 @@ from dis_snek.models.snek.command import check
from jarvis_core.db import q from jarvis_core.db import q
from jarvis_core.db.models import TwitterAccount, TwitterFollow from jarvis_core.db.models import TwitterAccount, TwitterFollow
from jarvis import jconfig from jarvis.config import JarvisConfig
from jarvis.utils.permissions import admin_or_permissions from jarvis.utils.permissions import admin_or_permissions
@ -24,7 +25,8 @@ class TwitterCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
config = jconfig self.logger = logging.getLogger(__name__)
config = JarvisConfig.from_yaml()
auth = tweepy.AppAuthHandler( auth = tweepy.AppAuthHandler(
config.twitter["consumer_key"], config.twitter["consumer_secret"] config.twitter["consumer_key"], config.twitter["consumer_secret"]
) )

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. Utility Cog.""" """J.A.R.V.I.S. Utility Cog."""
import logging
import platform import platform
import re import re
import secrets import secrets
@ -24,7 +25,6 @@ from dis_snek.models.snek.cooldowns import Buckets
from PIL import Image from PIL import Image
import jarvis import jarvis
from jarvis.config import get_config
from jarvis.data import pigpen from jarvis.data import pigpen
from jarvis.data.robotcamo import emotes, hk, names from jarvis.data.robotcamo import emotes, hk, names
from jarvis.utils import build_embed, get_repo_hash from jarvis.utils import build_embed, get_repo_hash
@ -41,7 +41,7 @@ class UtilCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.config = get_config() self.logger = logging.getLogger(__name__)
@slash_command(name="status", description="Retrieve J.A.R.V.I.S. status") @slash_command(name="status", description="Retrieve J.A.R.V.I.S. status")
@cooldown(bucket=Buckets.CHANNEL, rate=1, interval=30) @cooldown(bucket=Buckets.CHANNEL, rate=1, interval=30)

View file

@ -1,5 +1,6 @@
"""J.A.R.V.I.S. Verify Cog.""" """J.A.R.V.I.S. Verify Cog."""
import asyncio import asyncio
import logging
from random import randint from random import randint
from dis_snek import InteractionContext, Scale, Snake from dis_snek import InteractionContext, Scale, Snake
@ -34,6 +35,7 @@ class VerifyCog(Scale):
def __init__(self, bot: Snake): def __init__(self, bot: Snake):
self.bot = bot self.bot = bot
self.logger = logging.getLogger(__name__)
@slash_command(name="verify", description="Verify that you've read the rules") @slash_command(name="verify", description="Verify that you've read the rules")
@cooldown(bucket=Buckets.USER, rate=1, interval=15) @cooldown(bucket=Buckets.USER, rate=1, interval=15)

199
poetry.lock generated
View file

@ -134,6 +134,25 @@ category = "dev"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[[package]]
name = "dateparser"
version = "1.1.1"
description = "Date parsing library designed to parse dates from HTML pages"
category = "main"
optional = false
python-versions = ">=3.5"
[package.dependencies]
python-dateutil = "*"
pytz = "*"
regex = "<2019.02.19 || >2019.02.19,<2021.8.27 || >2021.8.27,<2022.3.15"
tzlocal = "*"
[package.extras]
calendars = ["convertdate", "hijri-converter", "convertdate"]
fasttext = ["fasttext"]
langdetect = ["langdetect"]
[[package]] [[package]]
name = "dis-snek" name = "dis-snek"
version = "7.0.0" version = "7.0.0"
@ -226,7 +245,7 @@ plugins = ["setuptools"]
[[package]] [[package]]
name = "jarvis-core" name = "jarvis-core"
version = "0.6.1" version = "0.7.0"
description = "" description = ""
category = "main" category = "main"
optional = false optional = false
@ -244,7 +263,7 @@ umongo = "^3.1.0"
type = "git" type = "git"
url = "https://git.zevaryx.com/stark-industries/jarvis/jarvis-core.git" url = "https://git.zevaryx.com/stark-industries/jarvis/jarvis-core.git"
reference = "main" reference = "main"
resolved_reference = "52a3d568030a79db8ad5ddf65c26216913598bf5" resolved_reference = "b81ea66d12b1a32c8291cbe9e14fe17b8e020d08"
[[package]] [[package]]
name = "jedi" name = "jedi"
@ -560,6 +579,17 @@ python-versions = ">=3.6"
[package.extras] [package.extras]
diagrams = ["jinja2", "railroad-diagrams"] diagrams = ["jinja2", "railroad-diagrams"]
[[package]]
name = "python-dateutil"
version = "2.8.2"
description = "Extensions to the standard Python datetime module"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
[package.dependencies]
six = ">=1.5"
[[package]] [[package]]
name = "python-gitlab" name = "python-gitlab"
version = "3.2.0" version = "3.2.0"
@ -626,6 +656,25 @@ rope = ["rope (>0.10.5)"]
test = ["pylint (>=2.5.0)", "pytest", "pytest-cov", "coverage", "numpy", "pandas", "matplotlib", "pyqt5", "flaky"] test = ["pylint (>=2.5.0)", "pytest", "pytest-cov", "coverage", "numpy", "pandas", "matplotlib", "pyqt5", "flaky"]
yapf = ["yapf"] yapf = ["yapf"]
[[package]]
name = "pytz"
version = "2022.1"
description = "World timezone definitions, modern and historical"
category = "main"
optional = false
python-versions = "*"
[[package]]
name = "pytz-deprecation-shim"
version = "0.1.0.post0"
description = "Shims to make deprecation of pytz easier"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7"
[package.dependencies]
tzdata = {version = "*", markers = "python_version >= \"3.6\""}
[[package]] [[package]]
name = "pyyaml" name = "pyyaml"
version = "6.0" version = "6.0"
@ -634,6 +683,14 @@ category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
[[package]]
name = "regex"
version = "2022.3.2"
description = "Alternative regular expression module, to replace re."
category = "main"
optional = false
python-versions = ">=3.6"
[[package]] [[package]]
name = "requests" name = "requests"
version = "2.27.1" version = "2.27.1"
@ -689,6 +746,14 @@ python-versions = "*"
[package.extras] [package.extras]
dev = ["build", "pytest", "pytest-timeout"] dev = ["build", "pytest", "pytest-timeout"]
[[package]]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]] [[package]]
name = "smmap" name = "smmap"
version = "5.0.0" version = "5.0.0"
@ -748,6 +813,30 @@ category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
[[package]]
name = "tzdata"
version = "2022.1"
description = "Provider of IANA time zone data"
category = "main"
optional = false
python-versions = ">=2"
[[package]]
name = "tzlocal"
version = "4.1"
description = "tzinfo object for the local timezone"
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
pytz-deprecation-shim = "*"
tzdata = {version = "*", markers = "platform_system == \"Windows\""}
[package.extras]
devenv = ["black", "pyroma", "pytest-cov", "zest.releaser"]
test = ["pytest-mock (>=3.3)", "pytest (>=4.3)"]
[[package]] [[package]]
name = "ujson" name = "ujson"
version = "5.1.0" version = "5.1.0"
@ -825,7 +914,7 @@ multidict = ">=4.0"
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "2adcfd60566d51e43a6f5a3ee0f96140a38e91401800916042cc7cd7e6adb37d" content-hash = "ce783f7855bb480b335731403679dc8249644570965a4cff6091eb377c5472df"
[metadata.files] [metadata.files]
aiohttp = [ aiohttp = [
@ -963,6 +1052,10 @@ colorama = [
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
] ]
dateparser = [
{file = "dateparser-1.1.1-py2.py3-none-any.whl", hash = "sha256:9600874312ff28a41f96ec7ccdc73be1d1c44435719da47fea3339d55ff5a628"},
{file = "dateparser-1.1.1.tar.gz", hash = "sha256:038196b1f12c7397e38aad3d61588833257f6f552baa63a1499e6987fa8d42d9"},
]
dis-snek = [ dis-snek = [
{file = "dis-snek-7.0.0.tar.gz", hash = "sha256:c39d0ff5e1f0cde3a0feefcd05f4a7d6de1d6b1aafbda745bbaa7a63d541af0f"}, {file = "dis-snek-7.0.0.tar.gz", hash = "sha256:c39d0ff5e1f0cde3a0feefcd05f4a7d6de1d6b1aafbda745bbaa7a63d541af0f"},
{file = "dis_snek-7.0.0-py3-none-any.whl", hash = "sha256:5a1fa72d3d5de96a7550a480d33a4f4a6ac8509391fa20890c2eb495fb45d221"}, {file = "dis_snek-7.0.0-py3-none-any.whl", hash = "sha256:5a1fa72d3d5de96a7550a480d33a4f4a6ac8509391fa20890c2eb495fb45d221"},
@ -1502,6 +1595,10 @@ pyparsing = [
{file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"}, {file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"},
{file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"}, {file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"},
] ]
python-dateutil = [
{file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"},
{file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
]
python-gitlab = [ python-gitlab = [
{file = "python-gitlab-3.2.0.tar.gz", hash = "sha256:8f6ee81109fec231fc2b74e2c4035bb7de0548eaf82dd119fe294df2c4a524be"}, {file = "python-gitlab-3.2.0.tar.gz", hash = "sha256:8f6ee81109fec231fc2b74e2c4035bb7de0548eaf82dd119fe294df2c4a524be"},
{file = "python_gitlab-3.2.0-py3-none-any.whl", hash = "sha256:48f72e033c06ab1c244266af85de2cb0a175f8a3614417567e2b14254ead9b2e"}, {file = "python_gitlab-3.2.0-py3-none-any.whl", hash = "sha256:48f72e033c06ab1c244266af85de2cb0a175f8a3614417567e2b14254ead9b2e"},
@ -1514,6 +1611,14 @@ python-lsp-server = [
{file = "python-lsp-server-1.4.0.tar.gz", hash = "sha256:769142c07573f6b66e930cbd7c588b826082550bef6267bb0aec63e7b6260009"}, {file = "python-lsp-server-1.4.0.tar.gz", hash = "sha256:769142c07573f6b66e930cbd7c588b826082550bef6267bb0aec63e7b6260009"},
{file = "python_lsp_server-1.4.0-py3-none-any.whl", hash = "sha256:3160c97c6d1edd8456f262fc0e4aad6b322c0cfd1b58d322a41679e57787594d"}, {file = "python_lsp_server-1.4.0-py3-none-any.whl", hash = "sha256:3160c97c6d1edd8456f262fc0e4aad6b322c0cfd1b58d322a41679e57787594d"},
] ]
pytz = [
{file = "pytz-2022.1-py2.py3-none-any.whl", hash = "sha256:e68985985296d9a66a881eb3193b0906246245294a881e7c8afe623866ac6a5c"},
{file = "pytz-2022.1.tar.gz", hash = "sha256:1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7"},
]
pytz-deprecation-shim = [
{file = "pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl", hash = "sha256:8314c9692a636c8eb3bda879b9f119e350e93223ae83e70e80c31675a0fdc1a6"},
{file = "pytz_deprecation_shim-0.1.0.post0.tar.gz", hash = "sha256:af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d"},
]
pyyaml = [ pyyaml = [
{file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"},
{file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"},
@ -1549,6 +1654,82 @@ pyyaml = [
{file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"},
{file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"},
] ]
regex = [
{file = "regex-2022.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ab69b4fe09e296261377d209068d52402fb85ef89dc78a9ac4a29a895f4e24a7"},
{file = "regex-2022.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5bc5f921be39ccb65fdda741e04b2555917a4bced24b4df14eddc7569be3b493"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:43eba5c46208deedec833663201752e865feddc840433285fbadee07b84b464d"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c68d2c04f7701a418ec2e5631b7f3552efc32f6bcc1739369c6eeb1af55f62e0"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:caa2734ada16a44ae57b229d45091f06e30a9a52ace76d7574546ab23008c635"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef806f684f17dbd6263d72a54ad4073af42b42effa3eb42b877e750c24c76f86"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be319f4eb400ee567b722e9ea63d5b2bb31464e3cf1b016502e3ee2de4f86f5c"},
{file = "regex-2022.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:42bb37e2b2d25d958c25903f6125a41aaaa1ed49ca62c103331f24b8a459142f"},
{file = "regex-2022.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:fbc88d3ba402b5d041d204ec2449c4078898f89c4a6e6f0ed1c1a510ef1e221d"},
{file = "regex-2022.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:91e0f7e7be77250b808a5f46d90bf0032527d3c032b2131b63dee54753a4d729"},
{file = "regex-2022.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:cb3652bbe6720786b9137862205986f3ae54a09dec8499a995ed58292bdf77c2"},
{file = "regex-2022.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:878c626cbca3b649e14e972c14539a01191d79e58934e3f3ef4a9e17f90277f8"},
{file = "regex-2022.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6df070a986fc064d865c381aecf0aaff914178fdf6874da2f2387e82d93cc5bd"},
{file = "regex-2022.3.2-cp310-cp310-win32.whl", hash = "sha256:b549d851f91a4efb3e65498bd4249b1447ab6035a9972f7fc215eb1f59328834"},
{file = "regex-2022.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:8babb2b5751105dc0aef2a2e539f4ba391e738c62038d8cb331c710f6b0f3da7"},
{file = "regex-2022.3.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:1977bb64264815d3ef016625adc9df90e6d0e27e76260280c63eca993e3f455f"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e73652057473ad3e6934944af090852a02590c349357b79182c1b681da2c772"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b22ff939a8856a44f4822da38ef4868bd3a9ade22bb6d9062b36957c850e404f"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:878f5d649ba1db9f52cc4ef491f7dba2d061cdc48dd444c54260eebc0b1729b9"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0008650041531d0eadecc96a73d37c2dc4821cf51b0766e374cb4f1ddc4e1c14"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:06b1df01cf2aef3a9790858af524ae2588762c8a90e784ba00d003f045306204"},
{file = "regex-2022.3.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:57484d39447f94967e83e56db1b1108c68918c44ab519b8ecfc34b790ca52bf7"},
{file = "regex-2022.3.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:74d86e8924835f863c34e646392ef39039405f6ce52956d8af16497af4064a30"},
{file = "regex-2022.3.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:ae17fc8103f3b63345709d3e9654a274eee1c6072592aec32b026efd401931d0"},
{file = "regex-2022.3.2-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:5f92a7cdc6a0ae2abd184e8dfd6ef2279989d24c85d2c85d0423206284103ede"},
{file = "regex-2022.3.2-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:5dcc4168536c8f68654f014a3db49b6b4a26b226f735708be2054314ed4964f4"},
{file = "regex-2022.3.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:1e30762ddddb22f7f14c4f59c34d3addabc789216d813b0f3e2788d7bcf0cf29"},
{file = "regex-2022.3.2-cp36-cp36m-win32.whl", hash = "sha256:286ff9ec2709d56ae7517040be0d6c502642517ce9937ab6d89b1e7d0904f863"},
{file = "regex-2022.3.2-cp36-cp36m-win_amd64.whl", hash = "sha256:d326ff80ed531bf2507cba93011c30fff2dd51454c85f55df0f59f2030b1687b"},
{file = "regex-2022.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9d828c5987d543d052b53c579a01a52d96b86f937b1777bbfe11ef2728929357"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c87ac58b9baaf50b6c1b81a18d20eda7e2883aa9a4fb4f1ca70f2e443bfcdc57"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d6c2441538e4fadd4291c8420853431a229fcbefc1bf521810fbc2629d8ae8c2"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f3356afbb301ec34a500b8ba8b47cba0b44ed4641c306e1dd981a08b416170b5"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d96eec8550fd2fd26f8e675f6d8b61b159482ad8ffa26991b894ed5ee19038b"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf668f26604e9f7aee9f8eaae4ca07a948168af90b96be97a4b7fa902a6d2ac1"},
{file = "regex-2022.3.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0eb0e2845e81bdea92b8281a3969632686502565abf4a0b9e4ab1471c863d8f3"},
{file = "regex-2022.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:87bc01226cd288f0bd9a4f9f07bf6827134dc97a96c22e2d28628e824c8de231"},
{file = "regex-2022.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:09b4b6ccc61d4119342b26246ddd5a04accdeebe36bdfe865ad87a0784efd77f"},
{file = "regex-2022.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:9557545c10d52c845f270b665b52a6a972884725aa5cf12777374e18f2ea8960"},
{file = "regex-2022.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:0be0c34a39e5d04a62fd5342f0886d0e57592a4f4993b3f9d257c1f688b19737"},
{file = "regex-2022.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7b103dffb9f6a47ed7ffdf352b78cfe058b1777617371226c1894e1be443afec"},
{file = "regex-2022.3.2-cp37-cp37m-win32.whl", hash = "sha256:f8169ec628880bdbca67082a9196e2106060a4a5cbd486ac51881a4df805a36f"},
{file = "regex-2022.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:4b9c16a807b17b17c4fa3a1d8c242467237be67ba92ad24ff51425329e7ae3d0"},
{file = "regex-2022.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:67250b36edfa714ba62dc62d3f238e86db1065fccb538278804790f578253640"},
{file = "regex-2022.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5510932596a0f33399b7fff1bd61c59c977f2b8ee987b36539ba97eb3513584a"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6f7ee2289176cb1d2c59a24f50900f8b9580259fa9f1a739432242e7d254f93"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d7a68fa53688e1f612c3246044157117403c7ce19ebab7d02daf45bd63913e"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aaf5317c961d93c1a200b9370fb1c6b6836cc7144fef3e5a951326912bf1f5a3"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad397bc7d51d69cb07ef89e44243f971a04ce1dca9bf24c992c362406c0c6573"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:297c42ede2c81f0cb6f34ea60b5cf6dc965d97fa6936c11fc3286019231f0d66"},
{file = "regex-2022.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:af4d8cc28e4c7a2f6a9fed544228c567340f8258b6d7ea815b62a72817bbd178"},
{file = "regex-2022.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:452519bc4c973e961b1620c815ea6dd8944a12d68e71002be5a7aff0a8361571"},
{file = "regex-2022.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cb34c2d66355fb70ae47b5595aafd7218e59bb9c00ad8cc3abd1406ca5874f07"},
{file = "regex-2022.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3d146e5591cb67c5e836229a04723a30af795ef9b70a0bbd913572e14b7b940f"},
{file = "regex-2022.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:03299b0bcaa7824eb7c0ebd7ef1e3663302d1b533653bfe9dc7e595d453e2ae9"},
{file = "regex-2022.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9ccb0a4ab926016867260c24c192d9df9586e834f5db83dfa2c8fffb3a6e5056"},
{file = "regex-2022.3.2-cp38-cp38-win32.whl", hash = "sha256:f7e8f1ee28e0a05831c92dc1c0c1c94af5289963b7cf09eca5b5e3ce4f8c91b0"},
{file = "regex-2022.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:35ed2f3c918a00b109157428abfc4e8d1ffabc37c8f9abc5939ebd1e95dabc47"},
{file = "regex-2022.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:55820bc631684172b9b56a991d217ec7c2e580d956591dc2144985113980f5a3"},
{file = "regex-2022.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:83f03f0bd88c12e63ca2d024adeee75234d69808b341e88343b0232329e1f1a1"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42d6007722d46bd2c95cce700181570b56edc0dcbadbfe7855ec26c3f2d7e008"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:320c2f4106962ecea0f33d8d31b985d3c185757c49c1fb735501515f963715ed"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbd3fe37353c62fd0eb19fb76f78aa693716262bcd5f9c14bb9e5aca4b3f0dc4"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17e51ad1e6131c496b58d317bc9abec71f44eb1957d32629d06013a21bc99cac"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:72bc3a5effa5974be6d965ed8301ac1e869bc18425c8a8fac179fbe7876e3aee"},
{file = "regex-2022.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e5602a9b5074dcacc113bba4d2f011d2748f50e3201c8139ac5b68cf2a76bd8b"},
{file = "regex-2022.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:729aa8ca624c42f309397c5fc9e21db90bf7e2fdd872461aabdbada33de9063c"},
{file = "regex-2022.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d6ecfd1970b3380a569d7b3ecc5dd70dba295897418ed9e31ec3c16a5ab099a5"},
{file = "regex-2022.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:13bbf0c9453c6d16e5867bda7f6c0c7cff1decf96c5498318bb87f8136d2abd4"},
{file = "regex-2022.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:58ba41e462653eaf68fc4a84ec4d350b26a98d030be1ab24aba1adcc78ffe447"},
{file = "regex-2022.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c0446b2871335d5a5e9fcf1462f954586b09a845832263db95059dcd01442015"},
{file = "regex-2022.3.2-cp39-cp39-win32.whl", hash = "sha256:20e6a27959f162f979165e496add0d7d56d7038237092d1aba20b46de79158f1"},
{file = "regex-2022.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:9efa41d1527b366c88f265a227b20bcec65bda879962e3fc8a2aee11e81266d7"},
{file = "regex-2022.3.2.tar.gz", hash = "sha256:79e5af1ff258bc0fe0bdd6f69bc4ae33935a898e3cbefbbccf22e88a27fa053b"},
]
requests = [ requests = [
{file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"},
{file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"},
@ -1565,6 +1746,10 @@ rope = [
{file = "rope-0.23.0-py3-none-any.whl", hash = "sha256:edf2ed3c9b35a8814752ffd3ea55b293c791e5087e252461de898e953cf9c146"}, {file = "rope-0.23.0-py3-none-any.whl", hash = "sha256:edf2ed3c9b35a8814752ffd3ea55b293c791e5087e252461de898e953cf9c146"},
{file = "rope-0.23.0.tar.gz", hash = "sha256:f87662c565086d660fc855cc07f37820267876634c3e9e51bddb32ff51547268"}, {file = "rope-0.23.0.tar.gz", hash = "sha256:f87662c565086d660fc855cc07f37820267876634c3e9e51bddb32ff51547268"},
] ]
six = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
]
smmap = [ smmap = [
{file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"}, {file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"},
{file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"}, {file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"},
@ -1589,6 +1774,14 @@ typing-extensions = [
{file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"}, {file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"},
{file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"},
] ]
tzdata = [
{file = "tzdata-2022.1-py2.py3-none-any.whl", hash = "sha256:238e70234214138ed7b4e8a0fab0e5e13872edab3be586ab8198c407620e2ab9"},
{file = "tzdata-2022.1.tar.gz", hash = "sha256:8b536a8ec63dc0751342b3984193a3118f8fca2afe25752bb9b7fffd398552d3"},
]
tzlocal = [
{file = "tzlocal-4.1-py3-none-any.whl", hash = "sha256:28ba8d9fcb6c9a782d6e0078b4f6627af1ea26aeaa32b4eab5324abc7df4149f"},
{file = "tzlocal-4.1.tar.gz", hash = "sha256:0f28015ac68a5c067210400a9197fc5d36ba9bc3f8eaf1da3cbd59acdfed9e09"},
]
ujson = [ ujson = [
{file = "ujson-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:644552d1e89983c08d0c24358fbcb5829ae5b5deee9d876e16d20085cfa7dc81"}, {file = "ujson-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:644552d1e89983c08d0c24358fbcb5829ae5b5deee9d876e16d20085cfa7dc81"},
{file = "ujson-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0cae4a9c141856f7ad1a79c17ff1aaebf7fd8faa2f2c2614c37d6f82ed261d96"}, {file = "ujson-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0cae4a9c141856f7ad1a79c17ff1aaebf7fd8faa2f2c2614c37d6f82ed261d96"},

View file

@ -20,6 +20,7 @@ orjson = "^3.6.6"
jarvis-core = {git = "https://git.zevaryx.com/stark-industries/jarvis/jarvis-core.git", rev = "main"} jarvis-core = {git = "https://git.zevaryx.com/stark-industries/jarvis/jarvis-core.git", rev = "main"}
aiohttp = "^3.8.1" aiohttp = "^3.8.1"
pastypy = "^1.0.1" pastypy = "^1.0.1"
dateparser = "^1.1.1"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
python-lsp-server = {extras = ["all"], version = "^1.3.3"} python-lsp-server = {extras = ["all"], version = "^1.3.3"}