aboutsummaryrefslogtreecommitdiffstats
path: root/bot (follow)
Commit message (Collapse)AuthorAgeLines
* Fix LoveCalculator 0% bugGravatar Darth Delay2019-02-15-3/+3
| | | | | | | | | | | | | | | | | | | Recently a test of the .love command revealed an unintentional reaction when 100% are reached. In previous versions this command had used a gigantic conditional block, checking for the current percentage given by the love_meter formula. When reaching 0 (meaning that the UserID's evenly divided with 100) it would automatically convert that 0 to 100. A big mistake from my side back then. This has been fixed with these changes. By quickly modifying the formula to use a mod 101 instead of a mod 100, we get an accurate percentage, ranging from 0-100% instead of 0-99%. love_matches.json has also been fixed to address these changes, meaning that the lowest entry now actually is 0 and the highest 100. TL;DR: -> Edited love_meter formula to calculate mod 101 instead of mod 100 -> Edited lowest and highest entry in love_matches.json to be 0 and 100
* Update LoveCalculator to address requested changesGravatar Darth Delay2019-02-12-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is addressing the new change requests on #100 Here's a list of what has been changed: -> Moved `LOVE_DATA` and `LOVE_LEVELS` out of the LoveCalculator class: This change has been made, so that the **love_matches.json** file does not have to be loaded every time someone uses `.love`. Now the file is loaded once when the cog is loaded. Requested by: Scragly -> Moved the Member converter to the function parameters: I didn't know that this works. It's good to learn something new. This also removes the `else` block, as it is no longer needed. Requested by: Scragly -> Removed the Roles instance: Before these changes, an instance of `Roles` has been created inside the if block: `ctx.guild.get_role(Roles().helpers).members`. This instance has now been removed as it is unnecessary Requested by: Scragly -> Adjusted the embed's description's string length: This project is aimed at 100 character lines in the future. The descrip- tion is way longer, so its string has been split up to fit that specifi- cation. Requested by: Scragly
* Update LoveCalculator as in #100Gravatar Darth Delay2019-02-11-90/+100
| | | | | | | | | | | | Updated the LoveCalculator cog due to changes being requested + Added love_matches.json for dialogue storage + Added docstrings to LoveCalculator and the love command + Added DRY code + Added 5 seconds of cooldown to the command per user + Can now be invoked without a second name - Removed error handler 'love_error'
* Add LoveCalculator as in #96Gravatar Darth Delay2019-02-05-2/+3
| | | | | | | This love calculator uses two user-IDs, adds them together and takes the modulus of 100 from it. Invocation: .love @user1#0000 @user2#0000
* Add LoveCalculator as in #96Gravatar Darth Delay2019-02-05-2/+2
| | | | | | | This love calculator uses two user-IDs, adds them together and takes the modulus of 100 from it. Invocation: .love @user1#0000 @user2#0000
* Added lovecalculator.py as described in #96:Gravatar Darth Delay2019-02-05-1/+1
| | | | | | - Includes LoveCalculator and somewhat of an error handler - Awaits two mentions like so: /love @user1#0000 @user2#0000 - Sends embed to the channel where /love has been called
* Added lovecalculator.py as described in #96:Gravatar Darth Delay2019-02-05-1/+1
| | | | | | - Includes LoveCalculator and somewhat of an error handler - Awaits two mentions like so: /love @user1#0000 @user2#0000 - Sends embed to the channel where /love has been called
* Added lovecalculator.py as described in #96:Gravatar Darth Delay2019-02-05-0/+118
| | | | | | - Includes LoveCalculator and somewhat of an error handler - Awaits two mentions like so: /love @user1#0000 @user2#0000 - Sends embed to the channel where /love has been called
* Add valentines seasonGravatar Joseph Banks2019-02-03-0/+20
|
* Fixing error in advent of code countdown by removing datetime prefixesGravatar Joseph Banks2018-12-26-2/+2
|
* Address flake8 complaintsGravatar Joseph Banks2018-12-26-1/+2
|
* Fix the grammar on the messageGravatar Joseph Banks2018-12-26-1/+1
|
* Address review commentsGravatar Joseph Banks2018-12-26-1/+4
|
* Add a notice to AoC countdown to find out if we are still in the advent of codeGravatar Joseph Banks2018-12-26-0/+4
|
* Fix is_in_advent() functionGravatar Joseph Banks2018-12-26-1/+2
|
* Merge pull request #88 from scragly/si_2Gravatar Leon Sandøy2018-12-06-8/+35
|\ | | | | Send devlog notification on season load.
| * Fix comment typoGravatar Johannes Christ2018-12-06-1/+1
| | | | | | Co-Authored-By: scragly <[email protected]>
| * Send devlog message on season load.Gravatar Scragly2018-12-05-8/+35
| |
* | Delete parenthesesGravatar sco12018-12-05-1/+1
| |
* | Fix leaderboard parsing regex to support twitter handlesGravatar sco12018-12-05-1/+1
| |
* | Add daily summary commandGravatar sco12018-12-05-6/+37
| |
* | Add daily summary statistics calculationGravatar sco12018-12-05-2/+40
|/ | | | Frame stats command Remove "stats" adjacent aliases for existing commands to avoid confusion
* Merge pull request #80 from scragly/season_improvementsGravatar Johannes Christ2018-12-04-92/+461
|\ | | | | Season Improvements
| * Use contextlib.suppress, remove unnecessary `u` prefix.Gravatar Scragly2018-12-04-11/+6
| |
| * Handle edit errors, tidy model and docsGravatar Scragly2018-12-03-65/+159
| |
| * Add season announcement supportGravatar scragly2018-12-03-17/+97
| |
| * Add season element set methods, add server icon change supportGravatar scragly2018-12-03-31/+118
| |
| * Allow Admin role env setting when debuggingGravatar scragly2018-12-03-1/+1
| |
| * Cleanup BaseclassGravatar scragly2018-12-03-57/+170
| |
* | Merge pull request #87 from python-discord/bytecommander-aoc2Gravatar Johannes Christ2018-12-04-8/+23
|\ \ | | | | | | Split .notifications toggle command into .subscribe and .unsubscribe
| * | Adapt code style according to reviewGravatar ByteCommander2018-12-03-3/+5
| | |
| * | Various fixes from review (squished)Gravatar ByteCommander2018-12-03-3/+4
| | |
| * | Split .notifications toggle command into .subscribe and .unsubscribeGravatar ByteCommander2018-12-03-8/+20
| |/
* / Improve countdown status (align to whole 5 minutes, better messages)Gravatar ByteCommander2018-12-03-15/+23
|/
* Add private board membership total to embed (#82)Gravatar sco12018-12-02-2/+6
| | | | | | * Add private board membership total to embed * Fix flake8, description typo
* AoC countdown (#81)Gravatar Joseph2018-12-02-1/+121
| | | | | | | | | | | | | | | | * Add countdown status and notifications * Remove debug print * flake8 my ass * Import order fixes * while is_in_advent() instead of while True * 2 * 60 => 120 * while is_in_advent() instead of while True in notifier
* Fix global lb display to respect ties (#79)Gravatar sco12018-12-01-3/+8
| | | | | Update member name regex to properly handle hyphens Remove session cookie from global leaderboard request
* Change name arg into name kwarg to match other usagesGravatar Joseph Banks2018-12-01-1/+1
|
* Add AoC Cog (#66)Gravatar sco12018-11-27-0/+541
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Advent of Code cog * Update leaderboard last updated time when updating the leaderboard Remove unnecessary test command * Shift leaderboard embed build into helper method * Frame global leaderboard command * Split leaderboard entries check into helper method * Refactor commands to support global board * Remove unused leaderboard update, wall off global leaderboard command Hide & short circuit global leaderboard command until implemented Fix faulty logic causing board to be reloaded regardless of the age of the cache * Add help shortstrings * Use command builtin to disable global lb command until implemented * Add AoC global leaderboard parsing * Update pipfile and lock Tweak global lb regex Tweak method names for clarity * Refactor for global leaderboard command Separate Global & Private leaderboards into distinct classes * Add missing header divider * Move token for Joseph * Phrasing We're still doing phrasing, right? * Clarify variable name
* Allows you to create Seasons. (#64)Gravatar Leon Sandøy2018-11-27-177/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allows you to create Season objects which change the bots behavior. For example, a season can determine things like the avatar, the nickname, and which cogs are loaded. Season automatically changes according to the date range you specify when you create it. * removing some hungarian notation. * Automatic season changes will now always happen at a minute past midnight, no matter when the bot started. * catching dunders in the glob. * Refine Season Creation behaviour and structure. * Added channel and role constants, refactored roles into NamedTuples, added role check decorators from the main bot, and added role checks for the season change feature. Yes this is duplicate code from our main bot, but it will just have to be like that for now until we get a bot core running. * replacing the or with an xor and switching out the assert for a UserWarning * New lockfile * changing discord.py to discord-py to prevent pip bug from putting two of them in our lockfile * fixing flake errors * flake8 * Cleaned everything up, but I seem to have introduced some sort of infinite load loop? o.O * Fixing up all bugs in the halloween cogs. This should be ready for merge now. * Add avatar_path baseclass method for consistency. While making it simpler to add avatar urls in new season extensions, it also allows the avatar resource path to be changed in a single place if needed in future. * Avoid shadowing builtin `object`. * Add debug mode, refine bot user editing on season load. The changing of a bot's username and avatar is heavily ratelimited. While testing, restarting the bot and changing seasons is required, and hitting these limits are typical. Instead, when in debug mode, the avatar isn't set and only the nickname is changed to prevent unnecessary account edit requests. In the case that the rate limit is hit when not in debug mode, there's an added fallback to use the nickname instead. * Add cancel load_seasons task on SeasonManager un/reload. Previously the load_seasons task was loaded and looping forever. Even if the cog was unloaded for some reason, it would still be running. On loading the SeasonManager again, it would create a new load_seasons task, while the old one still existed. Adding the cancellation allows the task to end when the cog is unloaded or reloaded, and will help assist with live code changes during development at a later time where it's possible to reload this extension (perhaps when the pending bot core is implemented). * get_season_class helper, season class attribs, fix admin id Changes `get_season`'s date check to not initialise unwanted classes (to avoid needless loading of tasks which would otherwise cause unexpected behaviour). To do this, defining attributes of season classes have been moved from `__init__` as an instance variable, to the class variable level. This also results in `__init__` not needing to be defined for the `SeasonBase` class, and `super().__init__()` not needing to be called in individual season classes, making things cleaner/simpler for them. Adds a helper function for retrieving a season class and combines two unnecessarily separate if statements. Credits to @MarkKoz for the suggestions. Reverts the admin ID mistakenly changed in a previous commit. * Update bot/seasons/halloween/hacktoberstats.py Co-Authored-By: heavysaturn <[email protected]> * Update bot/seasons/halloween/halloween_facts.py Co-Authored-By: heavysaturn <[email protected]> * No more property in halloweenfacts * Changed all aliases to tuples * Made tokens a seperate namedtuple * Update bot/seasons/halloween/spookyavatar.py Co-Authored-By: heavysaturn <[email protected]>
* Resolve Flake8Gravatar sco12018-11-20-6/+9
|
* Add typing context manager where appropriateGravatar sco12018-11-20-133/+166
| | | Some minor syntax & logic fixes where noticed
* Fixing flake8 errors, and making the gif post inside an embed.Gravatar Leon Sandøy2018-11-20-11/+43
|
* Merge branch 'gif' of https://github.com/markylon/hacktoberbot into markylon-gifGravatar Leon Sandøy2018-11-20-0/+32
|\
| * Refactoring.Gravatar Marko Kovačević2018-10-10-3/+6
| |
| * Add random spooky gif feature.Gravatar Marko Kovačević2018-10-09-0/+29
| |
* | fixing merge requests and preventing a race conditionGravatar Leon Sandøy2018-11-20-3/+92
|\ \
| * | * Update channel ID.Gravatar meooow252018-10-17-6/+12
| | | | | | | | | | | | | | | * Add class docstring. * Make `disconnect` a helper static method.
| * | Add cog to play spooky soundsGravatar meooow252018-10-14-0/+80
| | | | | | | | | | | | | | | | | | * Add SpookySound cog * Add sound files * Add PyNaCl to Pipfile (required for Discord voice)
* | | flake8Gravatar Leon Sandøy2018-11-20-10/+10
| | |