theastropath / turbot Goto Github PK
View Code? Open in Web Editor NEWA Discord bot for tracking Animal Crossing: New Horizons turnip prices and fossil collections
License: MIT License
A Discord bot for tracking Animal Crossing: New Horizons turnip prices and fossil collections
License: MIT License
I think there's some way to have github do a test code coverage report for Python, maybe... look into that.
Meanwhile, there's parts of the codebase that don't have specific tests yet. For example until recently there were no tests specifically for loading prices data from an existing file. We should add similar tests for other db data. Just tossing out other random ideas:
For security reasons on a remote server you'd want to have the token passed in by a credentials manager via an environment variable rather than have the token be uploaded to the remote server. Perhaps the bot could first look in the env for a variable like TURBOT_TOKEN
and use that if it exists, falling back to a file if it doesn't.
Now that we have timezone awareness, the !bestsell and !bestbuy commands can actually check to see if the logged price is still valid instead of just using the prices logged in the last 12 hours.
We can check to see if it is still the same morning or afternoon as the last logged price in the users marked timezone and only show it if it is.
Command descriptions that are more than one line don't stay in the Discord quote block. I think they can safely be concatenated to be one line and automatically wrapped by discord itself.
Maybe they could get a csv of their prices and txt list of their fossils by request?
Following #146 we can now tailor the output of the fish command to show only the fish that you have yet to catch.
We cab also look at what times those fish are available and show:
Same as with all the other tracking we do, but this time for all the songs that are available.
The site top.gg allows people to invite bots to their own servers very easily via a link like:
https://discordapp.com/api/oauth2/authorize?client_id={client_id}&permissions=379968&scope=bot
Requirements:
pandas
interface even with a move to SQL.This is a pie in the sky feature that could require a lot of work and ongoing dedicated resources. For dedicated resources we might think of adding a donation link too.
There are a few commands that have lingered since initial versions of the bot that were just used for testing/debug purposes. I don't think they have much purpose anymore. I think the following can be removed:
To set a user's switch friend code
We may be able to generate a smooth nicer looking graph:
As for how to calculate the spline, it's something that scipy could do but that's a huge dependency. An alternative is to directly implement it wth numpy as shown here: https://stackoverflow.com/questions/31543775/how-to-perform-cubic-spline-interpolation-in-python/48085583#48085583
Too often someone tries to do:
!pref friendcode blah
and gets the error that friendcode
isn't a valid preference name.
We should make friendcode
map to friend
at least. Perhaps also code
? Also they should be case insensitive.
Maybe we could even somehow detect things like: !pref Native Fruit orange
and make that work. Like if the user uses the preference name as it appears in the !info
embed then maybe it can detect that and work correctly?
To let people clearly see how long that sell price is available before it's gone. Would only work if the seller has a timezone preference set.
This may actually work fine as the code is now, but it's never been tested.
To set a user's island name.
Not sure what causes it but sometimes I say "monday morning" and I get tuesday.
If you make a typo or enter a fossil name that turbot doesn't recognize, it doesn't tell you that it didn't recognize it - it just ignores it.
It should tell you the names that it doesn't recognize so that you can correct your typo or whatever was going through your head
Eastern, Central, Pacific, maybe Mountain could be automatically handled somehow.
Placeholder
I think we need to make it so that users can configure their timezone in order to make some logic about morning/afternoon prices easier to work with, since we have users across multiple timezones sharing info.
I think there should be a new command that would allow users to configure their own timezone.
Preferably this would be specified using something like the names from the tz database for formatted ones such as America/Toronto or America/Los_Angeles. Using these names means we wouldn't need to think about DST (and whether it applies) as I believe there are libraries to handle conversions from those names to the appropriate timezones.
If a user has a timezone configured, we would display all their logged information using their local timezone:
Some commands could also be updated to use the new timezone information. For example, !bestsell and !bestbuy could know to not show the prices if logged in the morning and it is now the afternoon in the loggers timezone
Just throwing some ideas out there:
--log-level LEVEL
/ --verbose
/ -v
/ --quiet
/ -q
--token-file FILE
/ -t FILE
--channels=list,of,authorized,channels
--channel-file FILE
--prices-file
--fossils-file
etc...
Example !best sell
response:
**Best Selling Prices in the Last 12 Hours**
> @User2: 5 hours ago for 144 bells
> @User1: 5 hours ago for 108 bells
Where you could click on the @User1
name and it'd go to that user, like you could @ them or DM them.
Having all the users and all their prices on a single graph is a bit hard to parse and just looks like really colorful spaghetti.
It might be more useful to try and get something like this working so you could see a gallery of users' graphs: https://python-graph-gallery.com/125-small-multiples-for-line-chart/
Also if we could do whatever https://turnipprophet.io/ is doing that would be really amazing.
It'd be nice if we had more metrics on various parts of turbot as well as monitoring of postgresql database usage.
Need to add info about what permissions the bot needs when being invited to a server (Send Messages, Embed Links, Attach Files are the ones needed for now)
For this data: https://turnipprophet.io/?prices=102.93.87.86.79..69 the graph generated is "ERROR". At the very least we can detect when this is the case and not attach the graph.
Someone could opt-in to having turbot email/sms them whenever someone has really high turnip sell price. Maybe they could configured the price necessary to trigger a notification?
!rules set "my rules"
> Rules set for {author}.
!rules get username
__**usernam's island rules**--
> these are my rules.
An example of what rules might look like based off of anonymized data I found in the wild:
Animal Crossing - IslandName Island Information
Player: PlayerName
Nickname: Nick1 / Nick2 / Nick3
SW-1111-1111-1111
Gate is open - 249WH
Rules:
Please do NOT shake or chop trees
Feel free to shop and buy anything at Nook’s or Able Sister’s
Enclosed gardens - DO NOT PLUCK OR DIG
Hedge area to left of airport
Gardens / flowers - free! Dig / take / pluck
Recipes and dropped items - free! Take if you need
Island Information:
Native fruit: Cherry
Sister Fruit: Orange
Native Flower: Mum
Sister Flower: Pansies
I just got a "Congratulations, you've collected all bugs!" b/c I had collected all the bugs that were currently available this month. That's different than having collected ALL the bugs that exist in the game. Congrats should only be for collecting everything in the game.
So that everyone can't just run the clear and reset commands.
Allow users to optionally set the time of buy/sell prices.
!buy 95 2020-04-19 09:56:15.999344-07:00
!sell 200 2020-04-27 12:49:25.987158-07:00
Similar to #45 but for bugs.
So user's can indicate things they are looking for. If it's a fossil or an art it should show up in the relevant fossil/art commands, but not as needed, only as wanted.
For clarity, the timestamps in those two commands should show the timezone name (Eg. EST/CST/PST) instead of just the offset. Should also get rid of the fractional seconds (and maybe even the actual seconds as well? No one needs that level of detail for this).
Could also add some bolding to the usernames for further clarity
To tell you what fish are available and when based on the date/hemisphere.
!NeEdEdFoSSiLs should work exactly the same as !neededfossils. We should convert the command name to lowercase before looking to see if it exists
Flowers follow real life genetics: https://docs.google.com/document/d/1ARIQCUc5YVEd01D7jtJT9EEJF45m07NXhAm4fOpNvCs/preview
If they ever add more fossils we could automatically update from https://animalcrossing.fandom.com/wiki/Fossils_(New_Horizons) via a script 🤷♀️
When you run the !reset command (Which will be admin only soon...), it should save a backup of the files that are going to be deleted JUST IN CASE IT WAS A MISTAKE.
One backed up copy is probably sufficient.
Using https://wuffs.org/acnh/weather/ you can predict weather. There's some work you have to do by visiting the site and going to the seed tab to get your island's seed before you can do this.
!pref seed 104308659
Here's a terrible mock-up, but you get the idea.
Maybe clicking on the seed number takes you to your data, for example the URL for me with this seed would be: https://wuffs.org/acnh/weather/?v1&Ix&979478571&N
.
By default this could provide the weather for the current day starting from the current user's time of day and going forward.
Just some ideas of features that could exist as part of the !weather
command:
!weather month - get a summary of the weather for the current month
!weather week - get a summary of the weather for the current week
!weather 2020-11-11 - details of a particular day
!weather next meteor - when's my next meteor shower?
!weather next rain - when will it rain again?
!weather url - would return something like https://wuffs.org/acnh/weather/?v1&Ix&979478571&N
Not sure if this is even possible but maybe there's a way you could do something like:
!weather log sunny
And it'd append that data entry to your island's data so you could work towards getting your seed without ever needing to go to the site and do it manually. I don't know how it would handle running the seed search in this case and there's a hell of a lot of details and stuff so maybe this is just a bad idea... but I thought I'd float the idea 🤷♀️
Just an idea but maybe something like:
!forsale skeleton, golden axe, etc...
And then someone else could maybe search for stuff that was on offer? 🤷♀️
This command would create a list of all the fossils that are needed by anyone. Essentially get the list of fossils remaining for everybody and combine them into one list.
Following the pattern of #146, make bugs collectable too.
Also, is there a way to refactor the code so that there's less duplication of "collectables" code? Fish, art, bugs, and fossils all support the same basic operations... there should be a way to simplify things a bit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.