Skip to content

Changelog

Mihai Stavila (stavilam) edited this page Nov 25, 2018 · 3 revisions

2018/11/20

Added Image Searching functions using the API of image boards such as [Konachan], [Danbooru] and [Yande.re]. The command searches for an image, either random (if no argument is given) or by tags on one of the different sites, depending on the command used. The Discord embed also has a small tags list of the picture, the direct image as well as website link, the rating etc. If no image is found for the given tags, try to help the user by returning a list of similar tags. Important: While the function has more filters in order to prevent NSFW content, such as checking the rating of the picture and also blocking it if the channel isn't marked as NSFW, sometimes posts can be rated wrongly. This is out of our control, and it's the user who has to take this risk when using the command. (Although it shouldn't happen, it is still possible.)

Added a Command Error Handler that filters which errors are important, and thus saved, or trivial and ignored, such as user input mistakes, commands invoked while on cooldown etc.

Added comments so that the code is easier to read and understand

Made styling + performance improvements: merged some code so that it takes less space and fixed many styling issues' also the bot should run smoother now

2018/11/10

Added functions using AIOHTTP (fetching web data) and JSON (formatting it): a weather command that shows detailed information about the weather in a selected city, as well as a time command. Because the time API requires premium for searching by the city, but is free for latitude/longitude search (which is provided by weather) we use both of them junction.

Created a MySQL database connector in main, we can use a database to store stats (e.g. Guess Game stats) and other statistics such as bot or user messages sent, deleted, times mentioned etc. to make UserStats/BotStats and UserLevel functions (user levels up gaining EXP for every message or reaction sent).

Added admin-only functions using discord.ext commands checks: a client (bot) IP info + location and asyncio sleep function

Added more basic functions such as mentioned user info, server info, multiple dice roll.

Fixed some errors, revised the code of old functions and many other small improvements.

2018/11/03

Updated the code to be compatible with the newly released discord.py v1.0 lib (rewrite)

Converted all commands from @client.event to @client.command by making a class for each module and calling the commands into main.py using cogs.

This should make the bot faster and more responsive, and also allows the use of special command features overall improving the code, performance and memory usage.

Thanks to this, the change was worth it. I will be posting links for cogs documentation and tutorial in the README. You can find info about classes in the Think Python book provided by the university.