Merge pull request #314 from miaowware/fixgl

Addded a "nonce" to the greyline URL to force discord to reload the c…
This commit is contained in:
0x5c 2020-12-10 17:40:06 -05:00 committed by GitHub
commit 2ae11058b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- The result of `?greyline` was cached by discord and would get out of date.
## [2.5.0] - 2020-10-31

View File

@ -86,7 +86,9 @@ class ImageCog(commands.Cog):
embed = cmn.embed_factory(ctx)
embed.title = "Current Greyline Conditions"
embed.colour = cmn.colours.good
embed.set_image(url=self.gl_url)
# Generate a nonce to force discord to recache this
cachenonce = (ctx.message.id >> 22) // 1000 // 600 # nonce will stay the same for ~10min
embed.set_image(url=self.gl_url + f"&cachenonce={cachenonce}")
await ctx.send(embed=embed)