aboutsummaryrefslogtreecommitdiffstats
path: root/bot (follow)
Commit message (Collapse)AuthorAgeLines
* Line 114, 115 was cuasing error as a set was being sent to it instead ↵Gravatar Shivansh-0072021-01-30-2/+2
| | | | discord.member object
* Fix misleading game_over docstringGravatar Shivansh-0072021-01-30-1/+1
|
* Fix lint issuesGravatar Shivansh-0072021-01-24-7/+7
|
* Send a message on draw (was catching a error earlier) ; Improve send game ↵Gravatar Shivansh-0072021-01-24-27/+30
| | | | over (winner/loser) code ; add case_insensitive alias
* Fix user given emoji checkGravatar Shivansh-0072021-01-23-16/+17
|
* Check if the emoji given by user is availableGravatar Shivansh-0072021-01-21-4/+10
|
* Remove redundant codeGravatar Shivansh-0072021-01-21-10/+3
|
* Add ability to get custom tokens from the botGravatar Shivansh-0072021-01-21-23/+44
|
* Improve embeds and docstringsGravatar Shivansh-0072021-01-21-23/+35
|
* Add loading message before finishing all reactions and improve embed titleGravatar Shivansh-0072021-01-21-2/+8
|
* Change Ai to bot's user and add stop game functionality, remove redundant ↵Gravatar Shivansh-0072021-01-20-29/+39
| | | | code, and DRY
* COrrect annotations and improve docstrings ; make code more pythonicGravatar Shivansh-0072021-01-20-12/+21
|
* fix grammar and spacingGravatar Shivansh-0072021-01-20-30/+32
|
* Add connect four cog supporting player vs player and player vs aiGravatar Shivansh-0072021-01-19-0/+377
|
* Merge branch 'master' into IGDB-V4Gravatar ks1292021-01-17-37/+5
|\
| * Updates ConstantsGravatar Hassan Abouelela2021-01-15-2/+4
| | | | | | | | | | Updates the constants file with the new channel ID, and renames both channels to match the new names.
| * Remove sprint channels from the configuration.Gravatar Matteo Bertucci2021-01-15-34/+0
| | | | | | Now that the core dev sprint has ended, we can safely remove those. It caused the wrong channel message to be huge because of all the deleted channels.
| * Actually use 256 coloursGravatar Chris2021-01-09-1/+1
| |
* | Add OAuth response to warning.Gravatar Chris2021-01-08-1/+4
| |
* | Switch to post requests and start task at right time.Gravatar Chris2021-01-08-9/+10
| |
* | Use current token if we can't get a new oneGravatar Chris2021-01-08-12/+21
| |
* | Move renewal window to a constGravatar Chris2021-01-08-2/+5
| |
* | Un-comment out task startGravatar Chris2021-01-08-1/+1
| |
* | Revert change to trashcan emojiGravatar Chris2021-01-08-1/+1
| |
* | Get and renew V4 OAuth tokenGravatar Chris2021-01-08-8/+50
|/
* Merge branch 'master' into hackstatsGravatar ks1292021-01-06-867/+1108
|\
| * Remove unused importGravatar William Da Silva2020-12-29-1/+1
| |
| * Merge branch 'master' into omdb-to-tmdbGravatar William Da Silva2020-12-28-815/+1058
| |\
| | * Merge branch 'master' into prideavatar-urlGravatar ks1292020-12-28-780/+988
| | |\
| | | * Use sir-lancebot instead pydis-sir-lancebot for release nameGravatar ks1292020-12-19-1/+1
| | | | | | | | | | | | Co-authored-by: Joe Banks <[email protected]>
| | | * Remove aiohttp integration from SentryGravatar ks1292020-12-19-3/+1
| | | |
| | | * Add release tag to Sentry SDK initializationGravatar ks1292020-12-19-3/+4
| | | |
| | | * Add Git SHA as constantGravatar ks1292020-12-19-0/+2
| | | |
| | | * Add Redis and aiohttp integrations to SentryGravatar ks1292020-12-19-1/+7
| | | |
| | | * Clarify comment on AoC Status Task startup delayGravatar Sebastiaan Zeeff2020-12-13-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Advent of Code Status Countdown task needs to wait for two things to happen to prevent it from failing during the startup sequence: 1. The Websocket instance discord.py creates needs to be available as an attribute of the bot, otherwise discord.py fails internally: Traceback (most recent call last): File "discord/client.py", line 1049, in change_presence await self.ws.change_presence( activity=activity, status=status, afk=afk ) File "advent_of_code/_cog.py", line 52, in countdown_status await bot.change_presence(activity=discord.Game(playing)) AttributeError: 'NoneType' object has no attribute 'change_presence' 2. Allegedly, according to the discord.py community, trying to change the status too early in the sequence to establish a connection with Discord may result ub the Discord API aborting the connection. To solve this, I've added a `wait_until_guild_available` waiter, as it guarantees that the websocket is available and the connections is mature. Kaizen: I've changed the name `new_puzzle_announcement` to `new_puzzle_notification` to better reflect its function.
| | | * Merge branch 'master' into sebastiaan/advent-of-code/refactor-background-tasksGravatar Sebastiaan Zeeff2020-12-13-60/+154
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # bot/exts/christmas/advent_of_code/_cog.py # bot/exts/christmas/advent_of_code/_helpers.py
| | | | * Add callback to log errors in AoC background tasksGravatar Sebastiaan Zeeff2020-12-13-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, our Advent of Code background tasks fail without logging errors or printing error messages. This makes it difficult to debug the errors and means that they may fail silently. While we should ideally find the root cause that hides such errors, I've added a done_callback function in the meantime to help us debug the current issues with the Advent of Code Notification Task.
| | | | * Change AOC_WHITELIST names for clarityGravatar janine9vn2020-12-11-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AOC_WHITELIST was changed to AOC_WHITELIST_RESTRICTED because it is clearer that commands with this parameter in the `@override_in_channel()` decorator will be restricted to the aoc commands channel and not be allowed in the main aoc channel. In the same vein, AOC_WHITELIST_PLUS was changed to AOC_WHITELIST.
| | | | * Change Default AoC Commands ChannelGravatar janine9vn2020-12-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the default value of the advent_of_code_commands constant to be the same channel ID as sir-lancebot-commands. If no AoC commands channel is set in the .env file, it'll re-direct people to sir-lancebot-commands instead.
| | | | * Remove extra pleaseGravatar janine9vn2020-12-11-1/+1
| | | | | | | | | | | | | | | | | | | | Please -= 1
| | | | * Remove re-raising the errorGravatar janine9vn2020-12-11-2/+0
| | | | | | | | | | | | | | | | | | | | Per Mark's comment, re-raising the error isn't necessary.
| | | | * Change custom error handler to match new styleGravatar janine9vn2020-12-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I'm a bit ahead of the game and changing the error handler to match the new style that Iceman will PR shortly.
| | | | * Add cog-level error handler for Incorrect ChannelGravatar janine9vn2020-12-11-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If any of the "spammier" commands (stats, leaderboard) are used within the primary advent of code channel, rather than a non-specific embed we instead reply with the channel they should be using. This also adds a "AOC_WHITELIST_PLUS" constant that makes it easier to adjust what channels the non-spammier aoc commands can be used in.
| | | | * Disallow .aoc commands in primary aoc channelGravatar janine9vn2020-12-11-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commands like `.aoc leaderboard` and `.aoc stats` proved to be spammy in the main advent of code channel. An aoc_commands channel has been added for aoc commands and this update prohibits aoc commands from being used in the primary aoc channel and adds the comands channel to the whitelist. This also specifically allows the less spammier commands: join, subscribe, unsubscribe, and countdown in the primary channel to foster discussion though.
| | | | * Merge pull request #540 from RohanJnr/error_handler_changesGravatar Mark2020-12-11-21/+10
| | | | |\ | | | | | | | | | | | | Modify error handler check for locally handled errors.
| | | | | * Check if error.original is an instance of OSError.Gravatar Rohan2020-12-11-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also, remove error handler for get_command and video_command.
| | | | | * Modify snakes_cog error handler.Gravatar Rohan2020-12-07-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | local error handler no longer checks for BadArgument error and the attribute handled will be set to True on the error if an OSError occurs.
| | | | | * Check value of handled attribute on error in global error handler.Gravatar Rohan2020-12-04-1/+1
| | | | | |
| | | | | * Modify error handler check for locally handled errors.Gravatar Rohan2020-12-02-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handler now checks if the error has the attribute "handled" for locally handled errors.
| | | | * | Mitigate session expiry by using fallback sessionGravatar Sebastiaan Zeeff2020-12-05-17/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, an expired session cookie wreaked havoc to our Advent of Code commands: All commands that relied on leaderboard data failed because we couldn't refresh our data and the cache had expired. To mitigate an expired session, I've added a fallback session feature that enables us to try again with a different session. While it will issue an error message to inform us to refresh the expired session cookie, it does mean that the functionality should continue to work in the mean time. The fallback session cookie is currently set to my session cookie, using an environment variable, `AOC_FALLBACK_SESSION`. It is important that the user connected to the session is a member of all boards and that it's a fresh session: We don't want our fallback to expire! At the same time, while a single fallback session works, the AoC website also does not like too many requests from a single user. That's why we'll still use a multi-session model under normal circumstances. To check for expired sessions, I've added a URL check: The Advent of Code website will silently redirect people with an expired session, issuing an 200: OK status as usual. The only way to really check for it is by comparing the final URL in the response object to the URL we set out to GET. I've added a custom exception to signal such an unexpected redirect. Finally, instead of having the commands just break, I've added an Exception signal that propagates back to the caller. The solution, with try-except, is a bit hacky and could benefit from an actual error handler, but I wanted to get things fixed first; polish can be added later.