Skip to content

Commit

Permalink
Release/v1.1.0 (#17)
Browse files Browse the repository at this point in the history
* Release/v1.0.0 (#10)

* added github workflow to build docker images on PR file

- added `.github` folder and `workflow` folder to house github actions
- setup workflow to build docker image for jainy_bot with date

* added github action for building and publishing jobs

- added workflow for publishing tagged docker images
- added workflow for testing builds with git commit hash (short variant)

* changing secrets path to see if path was wrong

- removed secret name and used env var defined in secret instead

* changing secrets path to see if path was wrong

- added back secret name and used env var defined in secret instead

* changing secrets path to see if path was wrong

- removed secret name, and in github settings made each secret separate input

* added new bot command to track uptime and tidied up some code (#5)

- fixed type hint for ctx in borb.py
- added new uptime class cog
- updated commands package __init__.py to include cogs list for use in auto registration with bot.py
- updated bot.py to auto register cogs

* added new github action to handle tagging (#6)

- added github-tag-action to handle tagging version
- removed env declaration and tag variable

* Create LICENSE

* added feature request template for issues, and updated LICENSE template with name and copyright year (#7)

- added LICENSE template details
- added git issue template for features

* Adding moderation cog and commands (#8)

* added moderation cog with kick command, added new configuration properties to borb_bot config

- updated commands cog list to include new cog
- added moderation cog with kick command and embed message helper
- updated borb_bot config to include moderator roles and audit channel id

* added ban, unban, clean, invite commands, and added custom exception

- added ban, unban, clean, invite commands to moderation cog
- updated doc strings
- added helper functions to make embed messages for auditing
- created custom exception for when user unauthorized to use command

* refactored clean command to properly purge msg by user and correct amount

- refactored clean command to correctly purge messages by user
- set default limit of 1000 messages to look through
- added bot reply for cleaned messages

* added docstrings, refactored helper functions in to util file to be shared across cogs

- added docstrings to methods and functions
- refactored helpers from moderation cog to util file for shared use

* General Cleanup (#9)

* tidied up code to match return signatures and doc strings

- updated return signatures to match doc string and type hints
- removed unused imports

* tidied up code to match return signatures and doc strings

- updated return signatures to match doc string and type hints
- removed unused imports

* updated configuration and corrected null check

- fixed null check to check for correct env var for MOD_AUDIT_CHANNEL_ID and made moderator_roles into env var

* added changelog with notes on release

* fixed casing on moderator_roles to MODERATOR_ROLES

* updated readme

- updated `.env` file variables

* removed logging.py in favor of env var setup for loguru logger, added more exception handling

- removed logging.py in favor of using loguru environment variables to set the logging level
- updated kick command to check for UserNotFound exception thrown by commands object

* updated readme

- added loguru env var for setting log level

* fixed small error being thrown when initial bot command msg gets deleted before cleanup

* cleaned up unused variables, and added more logging

- removed unused os.environ from react_roles since var isn't used
- added logging to uptime command

* cleaned up moderation py to use audit channel and updated dalle to let user know prompt successful

- dalle command lets user know prompt was received now
- moderation command uses the audit channel in addition to native discord audit of mod commands
  • Loading branch information
seekheart authored May 4, 2024
1 parent 681608c commit 3d1591c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions jainy_bot/commands/dalle.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async def dalle(self, ctx: commands.Context, prompt: str):
'prompt': prompt
}

await ctx.send(f'{ctx.author.mention} hang tight I\'m checking with Dall-E')
response = requests.post(DALLE_API_URL, json=payload)

if response.status_code == 200:
Expand Down
13 changes: 11 additions & 2 deletions jainy_bot/commands/moderation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import discord
from discord.ext import commands
from loguru import logger

from config import MODERATOR_ROLES
from jainy_bot.exceptions import UnauthorizedUserException
from .util import make_general_card, make_offender_card, send_audit_message, send_reply_message
import discord


class Moderation(commands.Cog, name="Moderation"):
Expand Down Expand Up @@ -160,7 +161,8 @@ async def invite(self, ctx: commands.Context) -> None:
)
except discord.HTTPException or discord.Forbidden as e:
logger.error(e.text)
return ctx.send(f'Unable to create invite link')
await ctx.send(f'Unable to create invite link')
return

await send_reply_message(ctx, f'Invite link created: {invite.url}')
await send_audit_message(guild=ctx.guild, embed=embed)
Expand Down Expand Up @@ -188,4 +190,11 @@ async def clean(self, ctx: commands.Context, user: discord.Member, num_msg: int)
deleted.append(msg)
await msg.delete()

embed = make_general_card(
title=f'{ctx.author.display_name} cleaned up last {num_msg} messages by user = {user.display_name}',
author=ctx.author,
thumbnail_url=ctx.author.avatar.url
)

await send_reply_message(ctx, f'Deleted last {len(deleted)} messages by user = {user.display_name}')
await send_audit_message(guild=ctx.guild, embed=embed)

0 comments on commit 3d1591c

Please sign in to comment.