Git Product home page Git Product logo

image-bot's People

Contributors

catzoo avatar

Stargazers

 avatar

Watchers

 avatar

image-bot's Issues

Keep track of claimed images

Keep track of which images belongs to which users.
Allow users to:

  • Give images to other users
  • Give images back

Change the images database to:
[ ] [img_id] [url] [name] [claim_user]

  • see next comment

This should allow users to see which images they have and allow them to give their claimed images to other users / back.

Info incorrect time

I forgot on_ready runs more than once so the been up for time is incorrect

time_loop - changing interval, total seconds cannot be less than zero

01-13-2020, 22:46:00.3, INFO, image.py, root | Sending next image at 2020-01-13 22:47:00
01-13-2020, 22:47:00.3, INFO, image.py, root | Sending image
01-13-2020, 22:47:00.4, INFO, image.py, root | Sending next image at 2020-01-13 22:48:00
01-13-2020, 22:47:59.999, INFO, image.py, root | Sending next image at 2020-01-13 22:48:00
01-13-2020, 22:48:00.0, ERROR, __init__.py, discord.ext.tasks | Internal background task failed.
Traceback (most recent call last):
  File "C:\Users\catzoo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\tasks\__init__.py", line 68, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\catzoo\Desktop\github\image-bot\cog\image.py", line 251, in image_before_loop
    self.image_before_loop.change_interval(seconds=get_date().total_seconds())
  File "C:\Users\catzoo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\tasks\__init__.py", line 342, in change_interval
    raise ValueError('Total number of seconds cannot be less than zero.')
ValueError: Total number of seconds cannot be less than zero.
# waiting until the next image send
add_time()
logging.info(f'Sending next image at {self.time}')
self.image_before_loop.change_interval(seconds=get_date().total_seconds())

It adds the time and it still "before" self.time but when it gets done and use get_date it becomes after. Somehow its running it at :59.999. Dang it gets exactly on point.

Idea 1: Add a try, except ValueError and have it run the function again so it'll send the image when this happens

idea 2: move change_interval to the top.

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.