Giter VIP home page Giter VIP logo

dotaupdatesbot's People

Contributors

aadithpm avatar benhargreaves avatar double-a-92 avatar hizkifw avatar timjentzsch avatar yalanyali avatar yusdacra avatar zachkont avatar zkontprogramize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dotaupdatesbot's Issues

Add a GitHub pages page

It would be cool to have one, with fun graphics etc. Not sure what would be on it but sky's the limit I guess

Updater memory issues

The updater.py script ends up using way too much memory after running for days.
Investigation is required to pinpoint the cause (current suspect is the log file).

Fix /dotablog text preview

The preview text of the /dotablog command doesn't display properly.


  • Special characters are displayed as their Unicode code,
  • Links are displayed as their HTML tag.

The entire preview text is surrounded by

[u' _TEXT_  ' , u'; <_HTML_LINK_ >']...

so probably a text to Unicode parsing error in python?

Add pro matches history

Add a new command to request (5?) recent pro matches from the OpenDota API

It would be good to also add an argument in the command to filter a specific tournament or team

Improve reddit post display

Currently, everything gets previewed twice, first as code text preview and then as link preview.
The link one looks a bit better in my opinion, but doesn't remove the formatting strings, the code text preview contains unimportant information from reddit, such as
submitted by /u/SirBelvedere to r/DotA2 [link] [comments].

So one of them should be removed and improved accordingly.

Screenshots:
Sir Belvedere

wykrhm

Create required .json files on startup

The utils.py module should probably create the grouplist.json, userlist.json, previousblogposts.json, previousmagesunite.json, previouscyborgmatt.json, previousbelvedere.json and previouswykrhm .json and initialize them as json files.

This is a temporary enhancement until #15 is addressed

Filter out Artifact announcements

Currently, some posts (e.g. from Wyk) are not restricted to Dota and also show Artifact announcements.
Those should probably be filtered out eventually, especially when we have a seperate bot for Artifact.

Remove invalid subscribers

When a user has blocked the bot or a group has removed it without unsubscribing, the telegram API returns:
2017-11-08 14:52:30,194 (updater.py:82 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 403 Forbidden. Response body: [{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}]"
and:
2017-11-08 14:52:31,062 (updater.py:90 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 403 Forbidden. Response body: [{"ok":false,"error_code":403,"description":"Forbidden: bot was kicked from the group chat"}]"
respectively.
It would be best if in such cases the corresponding users/groups where removed from the subscribers list

Migrate to a proper database system

JSON files are easy to use but far from ideal. Migrating to MongoDB is the obvious choice, but I would prefer something more... editable, for testing purposes and future usage of the saved links in other projects. Or at least some accompanying scripts for basic CRUD and display on the DB.

Suggestions are welcome

Improve README.md

The README file is underwhelming at the moment. There is room for a lot of improvement, from improving the installation guide to improving the general layout. If anyone has any suggestions, I'm all ears.

Add /help

The README.md suggests that there is a /help command, but it doesn't get suggested when typing / and when writing /help it only displays the welcoming message.

Improve /match usability

  1. Currently, when writing /match, without any match ID, the bot doesn't respond at all.
    It should do one of these things instead:
    1.a) Notify the user that he has to use the following format: /match ID, or
    1.b) Ask the user for a match ID and process it directly.
  2. The K/D/A should be formatted with tabs or similar to align it for easier readablity.

Screenshot of the current output:

Current Output

Add option to wait for patch analysis

Inspired by the poll, it would be cool to have an option to only be notified when the patch analysis is complete.
First, a simple delay should suffice, later we can expand by analyising the threads, looking for the Analysis Status: Done keyword.
Of course, for blog posts / updates without the Analysis Status segment the bot would notify the user immediately.

Crash in main.py

Error Log

Traceback (most recent call last):
  File "./main.py", line 191, in <module>
    bot.polling(none_stop=True, interval=0)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/__init__.py", line 174, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/__init__.py", line 197, in __threaded_polling
    polling_thread.raise_exceptions()
  File "/home/user/.local/lib/python2.7/site-packages/telebot/util.py", line 72, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "/home/user/.local/lib/python2.7/site-packages/telebot/util.py", line 53, in run
    task(*args, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/__init__.py", line 120, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/__init__.py", line 90, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/apihelper.py", line 131, in get_updates
    return _make_request(token, method_url, params=payload)
  File "/home/user/.local/lib/python2.7/site-packages/telebot/apihelper.py", line 26, in _make_request
    result = requests.request(method, request_url, params=params, files=files)
  File "/home/user/.local/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/user/.local/lib/python2.7/site-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
Exception in thread WorkerThread2 (most likely raised during interpreter shutdown):Exception in thread WorkerThread1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
  File "/home/user/.local/lib/python2.7/site-packages/telebot/util.py", line 56, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'

Fix commands not working

When typing /start, the bot spams the welcoming message 16 times, the other commands don't work at all for me anymore.

Edit: Now /start doesn't do anything anymore, too.

Screenshot:

Commands Bug

Add /info

Add a command like /info, that provides information about this project and points the user to this GitHub page.

utils.py cleanup

utils.py is currently a port from a different repo and therefore contains unused code. It would be best if it is stripped down of anything not useful for this application.

Use logger module

Logging is kind of messy right now, using the logger module is a more appropriate approach.
Any new modules should also be included in the dockerfile dependencies.

Replace try-except with proper checks

Right now every call to the telegram API is within try-except blocks that just catch everything. Further investigation is required to either remove or refine those checks

Add latest patch analysis

Add a command (/dotaupdate or similar) that displays the latest patch analysis from /u/SirBelvedere or /u/Magesunite

Crash in updater.py

Traceback (most recent call last):
  File "./updater.py", line 148, in <module>
    check_for_updates_and_notify()
  File "./updater.py", line 143, in check_for_updates_and_notify
    posts = get_dota2blog_posts()
  File "./updater.py", line 34, in get_dota2blog_posts
    return get_rss_posts("http://blog.dota2.com/feed/", "Dota 2 blog feed not accessible.")
  File "./updater.py", line 24, in get_rss_posts
    if feed and feed.status:
  File "/home/user/.local/lib/python2.7/site-packages/feedparser.py", line 400, in __getattr__
    raise AttributeError, "object has no attribute '%s'" % key
AttributeError: object has no attribute 'status'
Exception in thread WorkerThread1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
  File "/home/user/.local/lib/python2.7/site-packages/telebot/util.py", line 56, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'

Improve /dotanews display

As of now, the text is formatted as code. Probably a normal text formatting would be better suited for the news.

Either way, these things should get fixed:

  1. Add proper word wrapping.
    Currently, the sentences are just cut off mid-word.
  2. Remove empty space.
    Currently, the parsing leaves a lot of empty space at the beginning of the news.

Link to the current Steam News
Screenshot of the current output:

Current Output

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.