Code Monkey home page Code Monkey logo

turbot's People

Contributors

lexicalunit avatar shughes-uk avatar theastropath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

shughes-uk

turbot's Issues

User permissions

So that everyone can't just run the clear and reset commands.

Support for command line arguments

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...

Collectable bugs

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.

Weather Prediction

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.

Allow users to input their seed once they've figured it out

!pref seed 104308659

Add the seed preference to your user's info embed

Here's a terrible mock-up, but you get the idea.
Screen Shot 2020-06-18 at 11 39 47 AM

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.

Add a !weather command

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

Is this possible: Use the website's API so you don't even need to go to it?

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 🤷‍♀️

Music Tracking

Same as with all the other tracking we do, but this time for all the songs that are available.

!bestsell and !bestbuy time display improvements

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

Add a !want command

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.

Better fish command

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:

  • Fish that are available right now
  • Fish that are available this month, but not at the current time of day

Add notifications

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?

Collection congrats when not everything was collected

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.

Integrate with top.gg

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:

  • Hosting: We'd need somewhere to host the bot, possibly aws, with monitoring and all that jazz to ensure uptime.
  • Multi-server support: This depends on #124 being completed first.
  • Possibly move away from CSV files as backing storage. A SQL solution would reduce storage space required, allow simpler queries, and provide solutions to resource contention. It's possible we can keep the pandas interface even with a move to SQL.
  • Investigate sharding: Discord.py supports sharding apparently which might be necessary at some point.
  • Admin messaging to send messages to all servers hosting the bot for important notifications.
  • A status page so users can see if the bot is up or down.

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.

commands shouldn't be case sensitive

!NeEdEdFoSSiLs should work exactly the same as !neededfossils. We should convert the command name to lowercase before looking to see if it exists

Add a !rules command

!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

Smooth prediction graph

We may be able to generate a smooth nicer looking graph:

  1. Use turnips lib to generate the lines and collections.
  2. Iterate over those lines and collections to find the min and max for each day and time of day.
  3. Completely blank out the data on the plot.
  4. Put all the min and max points into a scatter on the plot.
  5. Draw a spline for the the line defined by the min points.
  6. Draw another spline for the line defined by the max points.
  7. Fill between the two splines.

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

Can we make users links in turbot responses?

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.

!fossilsearch doesn't tell you if you made a typo

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

Add a fish command

To tell you what fish are available and when based on the date/hemisphere.

Support flexible preference names

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?

Support bot token as env var

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.

Allow buy/sell at specific time

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

Clear out unnecessary commands

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:

  • !hello
  • !lookup

Allow per-user timezone configuration

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:

  • !history would all be their timezone
  • !bestsell would be a mix of timezones per person which would make it easier for people to see if the price is still valid or not (Ie. if it was before or after noon)
  • Graph would show the local timezone for the X-axis

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

!bestsell and !bestbuy filtering improvements

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.

Test coverage

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:

  • Loading existing users data.
  • Loading existing fossils data.
  • Tests for generated graphs, I think you can do a image-diff to ensure the graph looks right.
  • Maybe a test specifically for pagination edge cases would be good.
  • Do some kind of stronger verification on the help command's response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.