Skip to content

Commit

Permalink
my inatyear: Add help & brief note about updating your personal stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
synrg committed Dec 9, 2024
1 parent 08ffb50 commit 7aaa542
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions inatcog/commands/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,9 +1060,17 @@ async def user_inatyear(self, ctx, user: str = "me", year: int = None):
await ctx.send(err)
return

await ctx.send(
own_stats = member.id == ctx.author.id
msgs = []
if own_stats:
msgs.append(
"*Note: If your stats are incomplete, press "
"**Regenerate stats** at the bottom of your page:*"
)
msgs.append(
f"https://www.inaturalist.org/stats/{stats_year}/{inat_user.login}?{cache_busting_id()}"
)
await ctx.send("\n".join(msgs))

@commands.command()
async def iuser(self, ctx, *, login: str):
Expand Down Expand Up @@ -1120,7 +1128,16 @@ async def my(self, ctx, *, project: str): # pylint: disable=invalid-name
async def my_inatyear(self, ctx, year: int = None):
"""URL for your iNat year graphs.
Where *year* is a valid year on or after 1950."""
Where *year* is a valid year on or after 1950 (defaults to this year).
To update your personal stats:
- follow the URL for your stats page
- login to iNaturalist
- scroll to the page bottom
- press the **Regenerate stats** button
- wait for the page to fully update
- use this command again to show the updated stats
""" # noqa: E501
await self.user_inatyear(ctx, user="me", year=year)

@my.command(name="obs")
Expand Down

0 comments on commit 7aaa542

Please sign in to comment.