Code Monkey home page Code Monkey logo

edstocktraderproject's People

Contributors

durzo avatar mvcircelli avatar tuggyboat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

durzo tuggyboat

edstocktraderproject's Issues

Consider signing up for Inara API as a substitute for cAPI

Inara's API tracks fleet carrier cargo using cAPI, and exposes it to its API, meaning that we could theoretically obtain a carrier's cargo with the same or similar reliability to directly using cAPI. Fleet Carrier Owners could pass their API keys to the bot as an extra field to the current enrolment system.

Downsides to this are that we need to sign up for the Inara API program, and the Inara API is significantly more complex to use.

Similarly, EDSM seems to have an API endpoint for commander cargo, though I suspect this is not as good of a substitute since it might include all cargo across all ships, as opposed to just FC cargo.

Bot doesn't return an embed sometimes

Occasionally, the bot will respond with a success message ("Fetching stock for..."), and then proceed not to post an embed. This happens most often with the xbox carriers and most notably the PTN Atlas. Current theory is that there is an issue when the data is too old, though even when a manual API check is verified, the system repsonds with the old data, so theoretically the bot should also be responding with that old data.

Something to verify is to ensure that the ship's marketID has not accidentally been edited somehow.

Mobile friendly stock embed

The current embed for ;stock is not mobile friendly due to how discord displays fields. The current responses on mobile do not give you any reasonable information about what the values pertain too

image

It would be great if we could refactor this somehow into a view that works for both mobile and native clients

Save active carriers in a .txt or other external file rather than in the .env

Saving the carriers in the .env proves rather problematic since we are unable to upload the .env to github, so having the carrier list be its own file that we can safely upload to github would make things much simpler, and provide a backup option so that we don't have to rebuild the list from scratch (again ;-;)

WMM Stock tracking not working

Originally, I was under the impression that the bot just couldn't see the wmm-stock channel, though I checked that it responds to a ;ping in the channel, so that must mean it can view and access it.

Seems like the on_ready() function responsible for initializing the wmm stock messages crashes on startup, so the wmm loop is never initialized. here's the included error:

Sep 24 15:06:15 ptnbots stockbot[1347]: _ClientEventTask exception was never retrieved
Sep 24 15:06:15 ptnbots stockbot[1347]: future: <ClientEventTask state=finished event=on_ready coro=<function on_ready at 0x7f7465db1598> 
Sep 24 15:06:15 ptnbots stockbot[1347]: Traceback (most recent call last):
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 348, in _run_event
Sep 24 15:06:15 ptnbots stockbot[1347]:     await self.on_error(event_name, *args, **kwargs)
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/usr/local/lib/python3.7/dist-packages/discord/client.py", line 343, in _run_event
Sep 24 15:06:15 ptnbots stockbot[1347]:     await coro(*args, **kwargs)
Sep 24 15:06:15 ptnbots stockbot[1347]:   File "/home/htcmatthewcircelli/EDStockTraderProject/bot.py", line 55, in on_ready
Sep 24 15:06:15 ptnbots stockbot[1347]:     f'{bot.user.name} is connected to \n'
Sep 24 15:06:15 ptnbots stockbot[1347]: AttributeError: 'NoneType' object has no attribute 'name'

At first glance seems like an easy fix, I'll poke around a bit and see what I can do while I have time this morning.

Consider 'one-time-signup' functionality with MAB

Carrier Owners would have a much easier user experience if they could sign up for both MAB and stockbot at the same time.

Current ideas for this are having a private text channel where MAB can message things to stockbot, who can then add the fleet carrier to the active list, or return an error message to MAB who will then relay it to the fleet carrier. A little bit involved, but its only an early suggestion.

Improve first time setup and run experience

I ran into some trouble setting this up in my dev because there was no documentation or format checks around the .env file

  1. With the way FC's are added, the code fails if there aren't enough lines in the .env and gives no explanation.
  2. Documentation does not mention required variables in .env file.
  3. Documentation does not mention required bot permissions on the discord application side - I still don't know what these are and therefore can't add them to the docs myself.

I have fixed 1-2 in my local dev. I'll make a merge request to fix these soon.

Epic carriers getting removed from stock channel after becoming empty

According to some users, their carrier is being removed from the public list after reaching a low stock level. This has happened to both the P.T.N. Intrepid (T3F-89K) and the P.T.N. Aurora Moraine (HHN-B6N), they are also not getting the low stock pm. Both are Epic carriers.

Carrier list and tracked carriers reverts to a list of 45 carriers upon bot restart

The bot is reverting to the same list of 45 carriers upon every restart. I noticed this while restarting the bot to apply the latest PR, though I don't think the new update is responsible, since Admins were reporting something similar at the last update.

The missing carriers are still in the local .carriers file, and the .carriers file in the repo has them as well (it includes the PTN garden and PTN bragur, which were very recently added, and proved to be working, though upon bot restart they no longer appear in ;list and cannot be tracked via ;stock)

There were no error messages when adding the carriers either, I checked back to the last 5 added carriers and the logs all show the "carrier saved" printout each time a new carrier was added.

For good measure, I've already tried changing the .carriers file permissions to readable and writeable by all using chmod, though that does not appear to have changed anything.

Add carrier removal and alias editing features

Title. Since we are starting to see more carrier removals, it is high time to provide functionality to remove a carrier from the known carriers list. While doing that, might as well add functionality to edit a carrier alias.

Adding carriers via code only

In order to easily rebuild the carrier list (and simplify the adding process), we should implement a way to add carriers using just their codes.

Current suggestion is to use the Inara API to find the carrier's system, and then using the code + system and the EDSM API to add the carrier marketID.

wmm-stock issue list

Some issues that have come up during deployment of wmm-stock feature:

  1. if a carrier jumps away from a WMM system, the new location will continue to be tracked. workaround: stop_wmm_tracking when refilling stock.
  2. if no carriers are being tracked, the message sent does not match the startup history purge - hotfixed on server, todo in code - FIXED
  3. editing someone's name into a post on discord doesn't send them a notification. possible fix - link to MAB?
  4. For notifying carrier owners about low stock or empty stock, the bot could DM them?
  5. change timestamp formats to use discord time formatting - FIXED!!

Regressions from last release:

  1. ;add_FC does not return an error if the carrier ID cannot be found in edsm/inara - FIXED

Add paging to active carrier list

The list of tracked carriers is getting quite long, it is only a matter of time before we exceed the allowed number of characters. Thus, it's time to add some paging functionality to the list, similar to how MisisonAlertBot's list functions.

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.