Skip to content

Releases: maj113/Angel6

2.5.0 [More Cogs, YT-dlp speed-up, Events...]

23 Jul 20:28
0045e20
Compare
Choose a tag to compare

Woo much smaller release this time :P

Changes in angel6.py:

  • Added more logging events:

    • on_member_update: Show nick and role changes
    • on_message_edit: Shows before and after edit and the link to the message
    • on_member_ban, on_member_unban: Show when someone gets banned/unbanned
  • Remove gif and giflist:

    • Replace with Tag and Taglist,
    • Use Json instead of hardcoding,
    • Convert to use the Json,
    • Add the ability to create, remove and edit new tags from discord
  • Split main file into cogs:

    • botlogging: Anything related to discord logging events
    • fun: Any command that increases one's dopamine :P
    • moderation: All commands that are moderation related
    • system: Any command that's used to interface with the bot
    • utility: Any command that's used to interface with the server
  • Misc changes:

    • Renamed the main file to angel6 since it's easier to import now, hopefully @GreggMutiny won't be mad
    • Some minor changes and refactoring to prepare for cog split

Changes in music.py:

  • Optimizations:

    • Massively optimized yt-dlp extractor as seen here:
      image
      Using these configs:

         "simulate": True,
         "extract_flat": True,
         "extractor_args": {
         "youtube": {
             "skip": ["dash", "hls", "translated_subs"],
             "player_client": ["android_creator"],
             "player_skip": ["configs", "webpage", "js"],
             "max_comments": [0],
         }
      },
    • Used Uvloop on Linux since it's event loop is much faster compared to Asyncio's.

  • Other changes:

    • Set no_warnings to False
    • Replace ssl_verify with nocheckcertificate since the former is deprecated
    • Relax Logger to INFO

Repo and CI changes:

  • Requirements:

    • Bumped some modules,
    • Used git versions for some modules
    • Split reqs into windows and linux
  • Assets:

    • Added assets for tag/taglist
    • Remove old gif/giflist assets
  • CI:

    • Disable Python 3.12 CIs until aiohttp fixes builds
    • Fix some Checks not running on PRs or running 2x times

Yeah I think that sums it up pretty nicely, next release will probably be 2.5.1 and it will be focused on fixing Pylint warnings in the newly split cogs

"Ching Chong Ding Dong idk I'm high as fuck man" - Maj Soklič

2.4.0 [Cat APIs, GH Actions, Refactorings and MANY improvements]

02 Jul 11:48
Compare
Choose a tag to compare

Hi everyone!

It's been a while since I last published a release for Angel6, that was mostly because implementing logging was difficult due to ongoing (and barely documented) API changes, music bot kept breaking and since there have been so many changes It has been really hard to write a proper changelog, between 2.3 and 2.4 there have been 559 commits and tracking these changes has been difficult so this time it there wont be a proper changelog but me describing what I know i changed between releases, okay so;

Music cog:

When I released 2.3 (later internally 2.3.1) I just switched to Opus from PCM since it was IMO much better, however back then I didn't think it would break the cog as badly as it did, there was no more Volume support, a good portion of functions had to be changed just so it played a song, let alone played it properly without anything breaking, looping was broken, pause was broken (still is to some extent), Queue would fail, skipping a song didn't work etc etc, fixing these issues was really hard mostly because the entire music cog was built for an older version of Discord.py (1.7.3) and upgrading to 2.0 meant it would introduce breaking changes and thanks to extremely poor documentation we had back when 2.0 released it was pretty hard to fix some of those.

This release was mostly spent fixing bugs and getting the bot to play the song faster. It now takes roughly 3 sec to play the song compared to the previous 5-6 sec

Changes:

I've documented most of the code (more or less just to make PyLint happy).
code has been cleaned up and I've made it much less error prone than it was in 2.3.

I rewrote some of the code so less external modules are needed.

Code was updated to respect changes in discord.py 2.0,

The cog uses AsyncIO now a lot since that speeds it up by at least 20% while also doing multiple things at the same time.

The codestyle was changed considerably and the cog is now mostly pep-8 compliant, codestyle is enforced with Black auto formatter, format is no longer used and has been replaced with f-strings since It's easier to read and looks cleaner.

Most of the work went into a couple pesky functions (audio_player_task, create_source, create_embed, _play...)

In audio_player_task we no longer duplicate code like crazy, some stuff was called multiple times for absolutely no apparent reason, this function and create_source were the causes of absolute shit performance since the code was almost fully blocking and called outdated and blocking functions

Just like in audio_player_task the function create_source was giving me nightmares daily, fixed something and couple days later 10 new issues were found, the code was slimmed down to 13 lines down from 38 because for some reason it called Youtube-DL's extract_info twice.

Logging wise it's now much better and more options are set when using the debug command line argument, FFmpeg now has adjustable logging level, It now saves a log to a log.txt file too so one can check the log of the last bot session

A new function checkloop was created which is called on skip and stop commands which checks if loop is enabled, disables It, issues either stop or skip and re-enables loop if skip was used

Many embeds had their looks improved, better error messages and overall verbosity has been improved.

While internally there were many more changes It's mostly minor and not visible outside of the code so that's more or less it for the music cog.

Angel6:

The main angel6-Rewrite file had many "under the hood" changes but I've mostly spent time implementing logging, making commands appear more visually pleasing when invoked, handling errors in moderation commands while also making sure one can't e.g. ban themselves, I've also introduced a couple new commands: giflist and gifsend, cat/anime image API, asbot (more about that later), other commands got improved significantly for a better UX, a lot of time was spent on profiling which API wrapper was the best and it seems that PyCord is still the best (I don't trust the original discord.py library since it may just go EOL again).

Changes:

On the Angel6 side I mostly focused on getting logging events working, currently I've implemented these events:

Logging:

on_message: Logs the messages to the terminal.

on_member_join and on_member_remove: Sends a message to a specified channel when someone joins or leaves the server.

on_message_delete: Sends a message to the logging channel with the contents of the deleted message and the name of the user who sent the message.

on_guild_channel_create and on_guild_channel_delete: Sends a message to the logging channel with the name of the channel, which category is in and who made/deleted the channel.

on_guild_channel_update: Sends a message to the logging channel with the name before and after the change e.g. (channel1->channel2)
it does the same if the category changed.

on_user_update: Sends a message when someone either changes their avatar or their username/display name.

on_guild_role_create, on_guild_role_delete, on_guild_role_update: Sends a message to the logging channel with the role name that was added/deleted/changed, by who it was changed, what permissions were changed.

Asbot:

That's how the function is called internally, It uses an asynchronous ainput from aioconsole to wait for an input/message in the terminal, which then gets relayed to the specified channel, no this is not self botting, it uses regular ctx.send.

Cat/Neko API:

I've added this because It wasn't hard to implement, internally I use 2 APIs: https://api.thecatapi.com/v1/images/search and https://api.nekosapi.com/v2/images/random?filter[ageRating]=sfw, the image gets embedded in a discord embed so its not just a raw image displayed, currently using search is not supported but I might implement this later.

giflist/gifsend:

The giflist command will list the gifs that are for now hard coded in a dict ("gifname":"gifurl"), It show an embed with a field for each gif and the command to send that gif

The gifsend command will send the gif and delete the authors message, it uses the name of the gif so if the name of the gif was gif1 the command argument would be ~gifsend gif1.

Other bot changes:

Like I've said earlier most of the under the hood changes went into PEP-8 compliance, codestyle, formatting, error handling and more

The bot currently has a code rating for about 9.95/10, codestyle is enforced with black, code has been extensively documented, verbosity of errors has been improved and now sends an error both to the terminal and to the channel (before it only sent it to the terminal which means that if a command fails to execute there will be no indication of that).

Just like in music.py I've streamlined the code, used f-strings instead of format and string concatenation since It's much shorter and looks cleaner, I've also updated some functions to use new python 3.11 code which is faster all in all.

On the UX side I updated a lot of embeds to look nicer/ more visually appealing, have color (not just blurple this time).

GitHub changes:

Possibly the most major update on the repo side is the much nicer Readme.md, take a look at the bot gallery.

We now have massively overhauled Github Actions, Linting, CodeQL and Security scanning using Bandit and DevSkim This should help anyone that want's to contribute

Moving forward:

I can see why writing changelogs was so hard; I didn't use branches or Pull Requests, this changelog/release notes could be done in 10 minutes, I guess I was just too lazy and changing that in the middle of the release would be pointless and probably even more confusing, from 2.4.0 on I'll be only using branching and pull requests to work on bigger changes, for stuff like actions and readme ill still just directly commit to master

Planned changes:

Basic logging was implemented in this release but there's a lot of events I still need to implement logging for while also improving already existing ones.

Update code to support the upcoming Python 3.12 which should be released soon

Slash commands more or less stabilized and are finally stable enough (yes I know other bots used it like a year ago but the code is horror), i may consider switching

Next major release will probably focused on stability, performance, scalability and fragmentation into Cogs

That's it for this changelog, get the latest release by cloning the project and make sure to do git pull once in a while

"Thanks for using my Bot or something" - Maj

[Opus, Cogs, Exceptions, New Contributor] [2.3-Rewrite]

22 Dec 18:46
Compare
Choose a tag to compare

Additions:

  • Added description to "~credits"
  • Error handling in "~unban"
  • "~ban" will only show reason if it's provided
  • Error handling and bot permission checks added to "~ban"
  • Added "~reload" (Reloads cogs without restarting the bot)
  • Opus instead of PCM in music.py

Removals:

  • Removed cpuinfo.py as its very slow
  • Removed old commented out code
  • Unused Imports Removed
  • "~volume" is removed since not supported by Opus

Fixes:

  • "~stats" now shows YT-DLP version

  • Fixed Variable shadowing in parse_duration()

  • Fixed duration in "~now"

  • More fixes by @Tini4

Enhancements:

  • Made music commands a cog

    • The cog is now in /cogs/music.py
  • "~queue" refactor

  • "~ping" now embeds

  • All embeds are now Blurple

  • Aliases added for a couple commands

  • "~restart" requires ban permissions now

  • Major improvements in first time bot setup

  • Some formats changed to f-strings

What's Changed

New Contributors

  • @Tini4 made their first contribution in #5
  • @maj113 made their first contribution in #9

And much more...

Full Changelog: 2.2.3...2.3-rewrite

[Fixes, Improvements, YT-DLP...] [2.2.3]

30 Nov 16:20
d484d83
Compare
Choose a tag to compare

Fixes:

  • Cog now loads correctly on Discord-Py / Py-Cord >= 2.0

  • Changing volume now works correctly

Enhancements:

  • Switched to YT-DLP since it's better maintained and possibly has better quality

  • Changed to non server specific status

  • Changed how imports are handled

  • "Muted" role now also prevents creating threads

  • Default logging level increased to INFO from ERROR

Additions:

  • Command "~clear" now works without arguments

  • Added basic debugging and a launch argument to enable it

  • Added reaction role for disabling loop/unlooping

  • More aliases

Removals:

  • Removed self. in bot.loop logic

  • Removed "~search" and its class/helper since it no longer works

  • Removed unused code in "~users"

  • Removed unused import/imports

Full Changelog: 2.X.X...2.2.3

[Security and bug fixes] [2.2.2]

24 Nov 19:49
Compare
Choose a tag to compare

Security overhaul, Reply instead of send, bugfixes and more

Bot will now reply to author in most cases instead of just sending a message

Tested against Py-Cord 2.3.0 dev and Python 3.11

"~role" no longer gives role higher than authors top role

"~rmrole" will no longer remove author's/command issuer's highest role as this can cause some... accidents

Improved YtDL syntax and disabled logging

"~restart" works better, still not working in VSC

Owner and Maintainer names were replaced with IDs so its dynamic

"~warn" no longer shows "Reason: none" if no reason specified

Full Changelog: 2.2.1-Rewrite...2.X.X

[Hotfix] [Rewrite] V2.2.1

22 Nov 18:53
Compare
Choose a tag to compare

Bot is now considered stable

-Changed file name to not include versioning

-Fixed self ban and warn

-Fixed indents in "~invites" and optimized last async

-Properly/reliably open the Ascii file

-Many command aliases added

-Some code refactoring, "logging" embed shows version now, spelling fixes, updated server link, removed import that's not used

Full Changelog: 2.2-Rewrite...2.2.1-Rewrite

[Rewrite] 2.2 RC1

21 Nov 20:01
Compare
Choose a tag to compare
[Rewrite] 2.2 RC1 Pre-release
Pre-release

SO MUCH STUFF ADDED:

  • Improved FFmpeg and YTDL quality (Also enabled Debugging so I can fix shit easier)

  • Support for PyCord versions never than 2.0.4b

  • Semi Automatic bot setup (no more hardcoded channels for join/leave, logging, general)

  • Fixed ~invites not working correctly [fixes #1]

  • Command "~skip" wont use voteskip if the one skipping has manage_messages now

  • Added a couple more aliases for some commands

  • If the General channel ID hasn't been Setup either manually or by the bot it will use a generic invite instead of a custom one

  • Unified embed color to Blurple for most embed commands now

  • Removed some deprecated functions that no longer work in latest PyCord

  • Now you can't Mute and kick yourself (Forgor to add checks for Ban, ill add tomorrow)

  • Fixed checks in "~roll"

  • Essential/barebones logging added (.env configured channels, API latency) currently

  • General Code refactoring

[PRE-REWRITE] [2.3] REVAMPED "~userinfo"

07 May 13:37
Compare
Choose a tag to compare

~infome was removed in favor of ~userinfo which can show info of anyone
~av now works and shows message authors pfp without needing to self ping

[PRE-REWRITE] [2.2] OLD!!!!

06 May 19:35
Compare
Choose a tag to compare

First public release.
clone the repo for the python file

Full Changelog: https://github.com/maj113/Angel6/commits/2.2