Replacing the @santa my and @santa global commands is the @santa stats command.
Added Functionality
This feature changes or adds functionality to: report various statistics about gift-giving through the bot. Ideally I'd like these wrapped in an Embed to give them some snazz.
Commands would function as follows:
@santa stats: prints a message asking for me, a @mention, or global
@santa stats me: displays the following statistics for a user:
Current present count
Stolen present count
Gifted present count
Grinch visit count
Max owned presents at any time (already stored as max_present_count in santabot/db/models/user.py
Possibly more - leave your ideas in the comments
Affected Components
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Dependencies
My feature request does not add any external dependencies
What the title says. Move the data we're currently storing in config/config.json to environment variables so we can use .env files and easily deploy Docker images.
There is still some code in santabot/cogs/grinch.py that fetches the webhook avatar URL which was going to use data from config.json. See line #23. Shouldn't be missed when working on this issue.
Having channel stats/leaderboard in the #christmas channel topic seems like a good idea, then it can auto update on an interval rather than having to be summoned. Need to investigate how to edit a topic and how to implement recurring processes.
This feature changes or adds functionality to:
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Dependencies
My feature request does not add any external dependencies
Implement a help page for SantaBot. This could be achieved through customizing Discord.py's built in HelpCommand, or by writing a GitHub Gist, markdown file in this repo, GitHub Wiki page, custom web page, or any other method of effectively showing the user how to use the bot.
More user testing is also needed to figure out what the best way to display functionality is.
Added Functionality
The @santa help command should effectively communicate how to use SantaBot to users.
Affected Components
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Dependencies
My feature request does not add any external dependencies*
If you say, for example, @santa give me my own item, you get the response check... for my own item. A stretch goal is implementing changing perspective to second person, where we would see something like:
@santa give me my own item -> check... for your own item
Implementation with the wordfilter package would be very simple. We can use the default list and simply reject the present if it has a bad word in the name.
Added Functionality
This feature changes or adds functionality to:
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Dependencies
My feature request does not add any external dependencies
Adds wordfilter, which will speed up development time without adding too large a dependency.
docker build doesn't include the .git directory, so git rev-parse --short HEAD fails when trying to set the bot's status message. One possible solution is to move Docker builds to Travis, then use docker push so we can use Travis to set default environment variables for the image
Steps to Reproduce the Bug
Launch the bot using the Docker container (ralphorama/santabot)
The current implementation of santabot/cogs/grinch.py contains the class GrinchManager which caches a discord.Webhook object, but doesn't save the details for when the bot is restarted. This leads to a lot of webhooks getting created when testing the grinch commands that one needs to delete by hand.
Once database support is functional, we should cache these values in the db. See docs/DESIGN.md for more info.
The current algorithm for predicting the chance of the Grinch visiting the user seems to result in a very high visit rate (only tested at a lower number of gifts). See the current implementation here
My current implementation for the Grinch Visit algorithm is:
defcalc_steal_chance() ->bool:
# Generate a number between 0 and the # of presents the User currently ownsrand_int=random.randint(0, current_present_count)
# Take the cube root of the User's present countthreshold=int(present_count** (1/3))
# If the user said 'Please', give them a 5% better chance at not failing the checkthreshold=threshold*1.05ifpleaseelsethreshold# If rand_int > threshold, steal presentsreturnrand_int>threshold
The logic behind this was to use cube root falloff so as a user's present count gets higher, the threshold determined via cube root levels off (see graph).
However, this dropoff is way too fast. Gotta rewrite the algo.
Discord users can set arbitrary status messages. The bot should have one that, ideally, would rotate through several messages on a timer:
- ''Use @santa help for help"
- "Sent {0} presents to {1} users"
- "Christmas (EST) is in days_left days"
For now, a static message that just displays the first help message is fine.
Added Functionality
This feature changes or adds functionality to:
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Features
My feature request does not add any external dependencies
Adds leader boards, sorted by gift count. @santa top displays the users with the most presents in the server. @santa top all displays users with the most presents from all servers.
Added Functionality
This feature changes or adds functionality to:
The Discord Bot
The Database or API
Other program functionality (.env, scripts, etc.)
Documentation
Containerization
CI
Other:
New/Additional Dependencies
My feature request does not add any external dependencies