From 95c1469de59ea5751347b3df111f2e4776e91be0 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 19 Jul 2021 14:09:57 -0600 Subject: [PATCH 1/7] Fix wording in modlog for deleted messages --- jarvis/cogs/modlog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis/cogs/modlog.py b/jarvis/cogs/modlog.py index c48153d..537c713 100644 --- a/jarvis/cogs/modlog.py +++ b/jarvis/cogs/modlog.py @@ -406,7 +406,7 @@ class ModlogCog(commands.Cog): channel = message.guild.get_channel(modlog["value"]) embed = build_embed( title="Message Deleted", - description=f"{message.author.mention}'s deleted a message", + description=f"{message.author.mention}'s message was deleted", fields=fields, color="#fc9e3f", ) From 64d969abf94166e40e877664ebf54651e794c3a1 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 19 Jul 2021 14:57:35 -0600 Subject: [PATCH 2/7] Update README.md and requirements.txt --- README.md | 40 ++++++++++++++++++++++++++++++++-------- requirements.txt | 11 +++++++---- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6516876..5bab4ff 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,46 @@ +![python 3.8+](https://img.shields.io/badge/python-3.8+-blue) +[![tokei lines of code](https://tokei.rs/b1/git.zevaryx.com/stark-industries/j.a.r.v.i.s.?category=code)](https://git.zevaryx.com/stark-industries/j.a.r.v.i.s.) +[![discord chat widget](https://img.shields.io/discord/862402786116763668?style=social&logo=discord)](https://discord.gg/VtgZntXcnZ) + J.A.R.V.I.S # Just Another Very Intelligent System (J.A.R.V.I.S.) -Welcome to the J.A.R.V.I.S. Initiative! While the main goal is to create the best discord bot there can be. A great achievement would be to present him to the Robots and have him integrated into the dbrand server. Feel free to suggest anything you may think to be useful… or cool. +Welcome to the J.A.R.V.I.S. Initiative! While the main goal is to create the best discord bot there can be, a great achievement would be to present him to the Robots and have him integrated into the dbrand server. Feel free to suggest anything you may think to be useful… or cool. **Note:** Some commands have been custom made to be used in the dbrand server. ## Features -Currently J.A.R.V.I.S offers: +J.A.R.V.I.S. currently offers: -* 👩‍💼 **Administration**: `verify`, `ban/unban`, `kick`, `purge`, `mute/unmute` and more! -* 🚓 **Moderation**: `lock/unlock`, `lockdown`, `warn`, `autoreact`, and also more! -* 👻 **Fun**: `jokes`. Please proceed to laugh now. -* 👑 **dbrand**: `ctc2` and other shit that I cba to explain! +- 👩‍💼 **Administration**: `verify`, `ban/unban`, `kick`, `purge`, `mute/unmute` and more! +- 🚓 **Moderation**: `lock/unlock`, `lockdown`, `warn`, `autoreact`, and also more! +- 👻 **Fun**: `jokes`. Please proceed to laugh now. +- 👑 **dbrand**: `ctc2` and other dbrand-specific commands. [Join their server](https://discord.gg/dbrand) to see them in action! ## Contributing Before **creating an issue**, please ensure that it hasn't already been reported/suggested. -And if you have a question, please DM {insert random ass here} instead of opening an issue. -If you wish to contribute to the J.A.R.V.I.S codebase or documentation, feel free to fork the repository and submit a pull request! +If you have a question, please join the community Discord before opening an issue. + + +If you wish to contribute to the J.A.R.V.I.S codebase or documentation, join the Discord! The recognized developers there will help you get started. + +## Community + +Join the [Stark R&D Department Discord server](https://discord.gg/VtgZntXcnZ) to be kept up-to-date on code updates and issues. + +## Requirements +- MongoDB 4.4 or higher +- Python 3.8 or higher +- [tokei](https://github.com/XAMPPRocky/tokei) 12.1 or higher + +On top of the above requirements, the following pip packages are also required: +- `discord-py>=1.7, <2` +- `psutil>=5.8, <6` +- `GitPython>=3.1, <4` +- `PyYaml>=5.4, <6` +- `discord-py-slash-command>=2.3, <3` +- `pymongo>=3.12.0, <4` +- `opencv-python>=4.5, <5` diff --git a/requirements.txt b/requirements.txt index bfdb75e..88ec417 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ -discord-py>=1.7, <1.8 -psutil>=5.8, <5.9 -GitPython>=3.1, <3.2 -PyYaml>=5.4, <5.5 +discord-py>=1.7, <2 +psutil>=5.8, <6 +GitPython>=3.1, <4 +PyYaml>=5.4, <6 +discord-py-slash-command>=2.3, <3 +pymongo>=3.12.0, <4 +opencv-python>=4.5, <5 From d8907a505d94bbd9071ad2dcf57316e5ba64d0dc Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 19 Jul 2021 14:59:32 -0600 Subject: [PATCH 3/7] Add space above image to prevent pushing on badges --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5bab4ff..0f98ff6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![tokei lines of code](https://tokei.rs/b1/git.zevaryx.com/stark-industries/j.a.r.v.i.s.?category=code)](https://git.zevaryx.com/stark-industries/j.a.r.v.i.s.) [![discord chat widget](https://img.shields.io/discord/862402786116763668?style=social&logo=discord)](https://discord.gg/VtgZntXcnZ) +
+ J.A.R.V.I.S # Just Another Very Intelligent System (J.A.R.V.I.S.) From 9d567410cce80b721359b6f49838cf9f283aa95a Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 19 Jul 2021 15:00:01 -0600 Subject: [PATCH 4/7] Add space above image to prevent pushing on badges --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bab4ff..c281f99 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -![python 3.8+](https://img.shields.io/badge/python-3.8+-blue) +[![python 3.8+](https://img.shields.io/badge/python-3.8+-blue)]() [![tokei lines of code](https://tokei.rs/b1/git.zevaryx.com/stark-industries/j.a.r.v.i.s.?category=code)](https://git.zevaryx.com/stark-industries/j.a.r.v.i.s.) [![discord chat widget](https://img.shields.io/discord/862402786116763668?style=social&logo=discord)](https://discord.gg/VtgZntXcnZ) +
+ J.A.R.V.I.S # Just Another Very Intelligent System (J.A.R.V.I.S.) From 9ed0b57faf261ee83c794a8b459e1df7b976ba6f Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 20 Jul 2021 14:41:41 +0000 Subject: [PATCH 5/7] Fixes regex pattern matching on Discord invites --- jarvis/__init__.py | 26 ++++++++++++++++++++++---- jarvis/cogs/modlog.py | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index dbaa0c3..da05ec4 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -25,7 +25,8 @@ intents.members = True restart_ctx = None invites = re.compile( - r"(https?://)?(www.)?(discord.(gg|io|me|li)|discordapp.com/invite)/([^\s/]+?)(?=\b)" + r"(https?://)?(www.)?(discord.(gg|io|me|li)|discord(app)?.com/invite)/([^\s/]+?)(?=\b)", + flags=re.IGNORECASE, ) @@ -92,7 +93,7 @@ async def on_member_join(user: Member): async def on_message(message: Message): if ( not isinstance(message.channel, DMChannel) - and not message.author.id == get_config().client_id + and message.author.id != jarvis.user.id ): autoreact = db.jarvis.autoreact.find_one( {"guild": message.guild.id, "channel": message.channel.id} @@ -192,9 +193,26 @@ async def on_message(message: Message): ) if autopurge: await message.delete(delay=autopurge["delay"]) - matches = invites.match(message.content) + content = re.sub(r"\s+", "", message.content) +<<<<<<< HEAD + content = re.sub(r"[^\w\d./]+", "", content) + match = invites.search(content) + if match: +======= + content = re.sub(r"[^\w\s]", "", content) + matches = invites.match(content) if matches: - if matches.group(5) not in ["dbrand", "VtgZntXcnZ"]: +>>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 + guild_invites = await message.guild.invites() + allowed = [x.code for x in guild_invites] + [ + "dbrand", + "VtgZntXcnZ", + ] +<<<<<<< HEAD + if match.group(6) not in allowed: +======= + if matches.group(6) not in allowed: +>>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 await message.delete() db.jarvis.warns.insert_one( { diff --git a/jarvis/cogs/modlog.py b/jarvis/cogs/modlog.py index c48153d..853a927 100644 --- a/jarvis/cogs/modlog.py +++ b/jarvis/cogs/modlog.py @@ -357,7 +357,7 @@ class ModlogCog(commands.Cog): async def on_message_edit( self, before: discord.Message, after: discord.Message ): - if before.author != self.bot.client.id: + if before.author != self.bot.user.id: modlog = self.db.jarvis.settings.find_one( {"guild": after.guild.id, "setting": "modlog"} ) From 7d509920235861e3e61ee7505c6f3fb24404ca82 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 20 Jul 2021 08:43:35 -0600 Subject: [PATCH 6/7] Fix bad merge headers remaining in file --- jarvis/__init__.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index da05ec4..cc2f332 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -194,25 +194,15 @@ async def on_message(message: Message): if autopurge: await message.delete(delay=autopurge["delay"]) content = re.sub(r"\s+", "", message.content) -<<<<<<< HEAD content = re.sub(r"[^\w\d./]+", "", content) match = invites.search(content) if match: -======= - content = re.sub(r"[^\w\s]", "", content) - matches = invites.match(content) - if matches: ->>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 guild_invites = await message.guild.invites() allowed = [x.code for x in guild_invites] + [ "dbrand", "VtgZntXcnZ", ] -<<<<<<< HEAD if match.group(6) not in allowed: -======= - if matches.group(6) not in allowed: ->>>>>>> d2cf3549ece5640fd7e215a75e12421c8f19fa10 await message.delete() db.jarvis.warns.insert_one( { From 6bf06bf6ca1433646f6a4feb4bbc26e8da83fb2c Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 20 Jul 2021 08:43:51 -0600 Subject: [PATCH 7/7] Bump version to 1.0.1 --- jarvis/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index cc2f332..953ec4d 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -35,7 +35,7 @@ jarvis = commands.Bot( ) slash = SlashCommand(jarvis, sync_commands=True, sync_on_cog_reload=True) jarvis_self = Process() -__version__ = "1.0.0" +__version__ = "1.0.1" db = DBManager(get_config().mongo).mongo