snaptraks / hatbot Goto Github PK
View Code? Open in Web Editor NEWRepository for HatBot on the Hatventures Community Discord server
Repository for HatBot on the Hatventures Community Discord server
Right now all stored data is handled in .pkl files (pickle
). While okay for moderately small guilds, it can get difficult to maintain if the number of members increases above a certain point. SQLite is a nice library that provides disk-based database storage so there is no need for an external database server. The aiosqlite
package provides an async implementation of the standard sqlite3
module for Python 3.5+.
Add the cooldowns information (bucket types, and uses per amount of time) to the help command. People keep asking me "how long is the cooldown on X command" ๐
The call to next
raises a StopIteration since there is no birthdays to iterate from.
Traceback (most recent call last):
File "/bot/cogs/Announcements/announcements.py", line 206, in birthday_next
next_birthday_date, next_birthdays = next(
^^^^^
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 827, in _do_call
return await self._callback(self.binding, interaction, **params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine raised StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/tree.py", line 1248, in _call
await command._invoke_with_namespace(interaction, namespace)
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/discord/app_commands/commands.py", line 846, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'next' raised an exception: RuntimeError: coroutine raised StopIteration
tl;dr something such as !feesh steal random
Basically don't know who to steal from anymore, and I think it would be entertaining if there was a command that picked someone at random.
The cog Feesh
, for example, uses the local time to send the periodic feesh. This causes duplicate feesh in the event of change in time (summer time for example). Using UTC would make the timezone consistent.
Some (if not most) commands do not have decent docstrings explaining what they do and how they work, or how they should be invoked (what arguments to give). These docstrings are what is used by the help
command.
There is a ratelimit that prevents the number of messages older than 1 hour to be edited. Instead of waiting for the rate limits to end we should simply prevent the number of giveaways to start in a period of time. There will need to be some testing but something like max 10 giveaways in 10 minutes might work.
The Birthday cog autofires the Birthday event at Midnight GMT the day after the person's Birthday. Even on the latest possible timezone (GMT+12) that still only causes the event to fire at midday on the day. The birthday cog should be reworked so that the event fires earlier. I would recommend standardising based on Midday GMT so the event guaranteed fires on the day in all timezones (there may be potential hiccups in IDL regions (GMT+-12), but it would significantly improve the timings).
Another option would be allowing users to set a timezone, though that would require a lot more work.
Have a cog for birthdays. Members could register their birthday on an opt-in basis and the bot would announce their birthday in #general (or whatever) and could give them a hoisted role for the day.
Some cogs use the package requests
, which is blocking. The use of aiohttp
should be preferred since it is asynchronous.
Use some APIs from https://api-ninjas.com/ to provide some nice features, such as random fact.
These can be entertaining, or informational, depending on what we want.
Find a way to display the number of entries in the giveaway message
Semi-hidden location to suggest Easter Eggs for hatbot-pond.
Add a subcommand to the /birthday command that checks for the next birthday. Maybe make it staff only?
Slow code is blocking the bot, making it unable to process events or commands while the code is running. We should use the asyncio method loop.run_in_executor
to run those asynchronously. See documentation.
Currently, when connect4 times out, the game ends in a tie. The game should end with the active player losing to prevent people from stalling the game out just to avoid losing.
Place for suggestions and discussions about the possible item shop.
Add a bit on how to run this code locally for e.g. local debugging. Would help others who want to add features without needing to dive too much into the code-base
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.