Giter Club home page Giter Club logo

greed's Introduction

greed's People

Contributors

bakx13 avatar darrenwestwood avatar dependabot[bot] avatar eufelipemateus avatar hybridvamp avatar mastersuv avatar netanelkoli avatar oleg20111511 avatar pzhuk avatar rashidkalwar avatar skrashevich avatar steffo99 avatar trentyn avatar valentino-sm avatar zhihuiyuze 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greed's Issues

La valuta del prezzo non cambia

Un'altra domanda, la valuta dei Prezzi rimane costantemente in euro, anche se il file config. ini è stato modificato come hai detto? Grazie

Logo Proposal for greed

Hello, I wish to cooperate with greed, for this reason I have decided to design a logo for it. If you like this proposal, I can send you the files.

You can suggest the changes you think are necessary.

PROPUESTA_DE_LOGO_GREED.jpg

TypeError: 'NoneType' object is not iterable

when I run :
$python3.6 -00 core.py
I get this error

Unauthorized to call get_me(), skipping.
greed-bot is now starting!
Unauthorized to call get_updates(), skipping.
Traceback (most recent call last):
File "core.py", line 123, in
main()
File "core.py", line 43, in main
for update in updates:
TypeError: 'NoneType' object is not iterable

How can I resolve this issue
Thanks

Add a way to categorize products

Ciao, aiuto , per favore, come fare l'aggiunta di un prodotto in diverse categorie separatamente (Pizza, Panini, Pasta), e non in un catalogo in una sola volta? Grazie


Translation by @Steffo99:

Hi, please help, how can I split products in different categories (Pizza, Bread, Pasta) and not group them in a single catalog? Thanks!

TelegramError: Invalid server response

https://sentry.io/stefano-pigozzi/greed/issues/529983887/

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  File "telegram/utils/request.py", line 150, in _parse
    data = json.loads(decoded_s)
  File "json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

TelegramError: Invalid server response
(2 additional frame(s) were not displayed)
...
  File "telegram/bot.py", line 60, in decorator
    result = func(self, *args, **kwargs)
  File "telegram/bot.py", line 1720, in get_updates
    result = self._request.post(url, data, timeout=float(read_latency) + float(timeout))
  File "telegram/utils/request.py", line 272, in post
    **urlopen_kwargs)
  File "telegram/utils/request.py", line 203, in _request_wrapper
    message = self._parse(resp.data)
  File "telegram/utils/request.py", line 152, in _parse
    raise TelegramError('Invalid server response')

TelegramError: Invalid server response

SQLite Error: no such table.

Steps to reproduce:

  1. Download current build
  2. Unpack and install dependencies
  3. Start the bot

When issuing /start in Telegram the bot produces with the following error:

Exception in thread Worker 661051424:
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: users

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/ubuntu/greed-master/worker.py", line 64, in run
    self.user = self.session.query(db.User).filter(db.User.user_id == self.chat.id).one_or_none()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2924, in one_or_none
    ret = list(self)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__
    return self._execute_and_instances(context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
    raise value.with_traceback(tb)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: users [SQL: 'SELECT users.user_id AS users_user_id, users.first_name AS users_first_name, users.last_name AS users_last_name, users.username AS users_username, users.credit AS users_credit \nFROM users \nWHERE users.user_id = ?'] [parameters: (661051424,)] (Background on this error at: http://sqlalche.me/e/e3q8)

Tried running the database generation script and then running the bot, the error persists.

[ubuntu@apollo greed-master]$ python3.6 -OO database.py
[ubuntu@apollo greed-master]$ python3.6 -OO core.py
greed-bot is now starting!
Timed out while calling get_updates(), retrying in 1 secs...
Timed out while calling get_updates(), retrying in 1 secs...
Exception in thread Worker 661051424:
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: users

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/ubuntu/greed-master/worker.py", line 64, in run
    self.user = self.session.query(db.User).filter(db.User.user_id == self.chat.id).one_or_none()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2924, in one_or_none
    ret = list(self)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__
    return self._execute_and_instances(context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 248, in reraise
    raise value.with_traceback(tb)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: users [SQL: 'SELECT users.user_id AS users_user_id, users.first_name AS users_first_name, users.last_name AS users_last_name, users.username AS users_username, users.credit AS users_credit \nFROM users \nWHERE users.user_id = ?'] [parameters: (661051424,)] (Background on this error at: http://sqlalche.me/e/e3q8)

[ubuntu@apollo greed-master]$ python -V
Python 2.7.15rc1
[ubuntu@apollo greed-master]$ python3 -V
Python 3.6.6

Traceback (most recent call last):

Traceback (most recent call last):
File "core.py", line 169, in
main()
File "core.py", line 111, in main
if update.message.text == receiving_worker.loc.get("menu_cancel"):
AttributeError: 'NoneType' object has no attribute 'get'

Crash if under minimum deposit [via email]

Hello, Steffo! I am very interested in your Greed telegram bot, it’s really cool! But I have a bug, and don’t know how to fix. If I set minimum deposit, for example 100$, everything under this value crashing the bot.

Best regards,
Yaroslav Khaliullin.

AttributeError: 'CancelSignal' object has no attribute 'message'

https://sentry.io/stefano-pigozzi/greed/issues/526391945/

AttributeError: 'CancelSignal' object has no attribute 'message'
  File "greed/worker.py", line 76, in run
    self.__user_menu()
  File "greed/worker.py", line 250, in __user_menu
    strings.menu_add_credit, strings.menu_bot_info])
  File "greed/worker.py", line 132, in __wait_for_specific_message
    if update.message is None:

AttributeError: 'CancelSignal' object has no attribute 'message'

Timed out while calling get_updates()

$ sudo python3 -OO core.py

greed-bot is now starting!
Timed out while calling get_updates(), retrying in 1 secs...
Exception in thread Worker 411164928:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: users

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/ubuntu/tlgrm_shop/worker.py", line 64, in run
self.user = self.session.query(db.User).filter(db.User.user_id == self.chat.id).one_or_none()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/orm/query.py", line 2917, in one_or_none
ret = list(self)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/orm/query.py", line 2988, in iter
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/orm/query.py", line 3011, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 948, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/compat.py", line 248, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/default.py", line 509, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: users [SQL: 'SELECT users.user_id AS users_user_id, users.first_name AS users_first_name, users.last_name AS users_last_name, users.username AS users_username, users.credit AS users_credit \nFROM users \nWHERE users.user_id = ?'] [parameters: (411164928,)] (Background on this error at: http://sqlalche.me/e/e3q8)

Timed out while calling get_updates(), retrying in 1 secs...
Timed out while calling get_updates(), retrying in 1 secs...

Support keyboards with more than 100 keys

Right now, keyboards with more than 100 keys are not displayed correctly.

Previous page and Next page buttons should be implemented to display all keys correctly.

This issue is a generalization of #10.

Error when cancelling the edit managers panel

I went into the admin panel to edit managers and then clicked Cancel

Traceback (most recent call last):
 File "/home/codeofhonor/greed/worker.py", line 106, in run
    self.__admin_menu()
  File "/home/codeofhonor/greed/worker.py", line 739, in __admin_menu
    self.__add_admin()
  File "/home/codeofhonor/greed/worker.py", line 1211, in __add_admin
    if callback.data == "toggle_edit_products":
AttributeError: 'CancelSignal' object has no attribute 'data'

-- @glookatme

Probably requires the same fix as #37 :)

Wrong keyboard layout in admin Orders menu

How to reproduce:

  1. Enter admin Orders menu
  2. Try to Complete or Refund any order
  3. Only way to exit this menu is to find Stop button somewhere in the chat history.
    Try to open a keyboard layout - main menu keyboard is displayed, but no any actions are possible, because the only expected command to return the menu selection is Stop command

SQLite threading problems

2020-04-29 01:02:53 | Worker 525147055 | sqlalchemy.pool.impl.NullPool | Exception during reset or similar
Traceback (most recent call last):
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\pool\base.py", line 693, in _finalize_fairy
    fairy._reset(pool)
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\pool\base.py", line 880, in _reset
    pool._dialect.do_rollback(self)
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\engine\default.py", line 540, in do_rollback
    dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 8780 and this is thread id 21508.
2020-04-29 01:02:53 | Worker 525147055 | sqlalchemy.pool.impl.NullPool | Exception closing connection <sqlite3.Connection object at 0x0000028D5F544D50>
Traceback (most recent call last):
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\pool\base.py", line 693, in _finalize_fairy
    fairy._reset(pool)
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\pool\base.py", line 880, in _reset
    pool._dialect.do_rollback(self)
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\engine\default.py", line 540, in do_rollback
    dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 8780 and this is thread id 21508.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\pool\base.py", line 270, in _close_connection
    self._dialect.do_close(connection)
  File "C:\Users\stepi\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\engine\default.py", line 546, in do_close
    dbapi_connection.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 8780 and this is thread id 21508.

error when i press /start

when i press start on bot i catching this error:

C:\tg_bot1\greed-master>python -OO core.py
greed-bot is now starting!
Traceback (most recent call last):
  File "core.py", line 131, in <module>
    main()
  File "core.py", line 63, in main
    new_worker = worker.ChatWorker(bot, update.message.chat)
  File "C:\tg_bot1\greed-master\worker.py", line 57, in __init__
    release=raven.fetch_git_sha(os.path.dirname(__file__)),
  File "D:\Python\lib\site-packages\raven\versioning.py", line 19, in fetch_git_
sha
    'Cannot identify HEAD for git repository at %s' % (path,))
raven.exceptions.InvalidGitRepository: Cannot identify HEAD for git repository a
t C:\tg_bot1\greed-master

C:\tg_bot1\greed-master>

Suggestions

Suggestions to improve functionality:

  • Improve the location of the Stop button in the admin order list. The admin user is required to scroll to the top of the order list to see the Stop button.
  • Add a new way for the user to check their credit balance apart from /start or My Orders.

Global localization variables

Add some global substitutions to the localization files.

For example:

  • {username} in any localization file would get replaced by the user's username
  • {today} would get replaced by today's date
  • etc

Suggested by @glookatme on Telegram

InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: 'UPDATE pro...

https://sentry.io/stefano-pigozzi/greed/issues/559774026/

InterfaceError: Error binding parameter 0 - probably unsupported type.
  File "sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)

InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: 'UPDATE products SET price=? WHERE products.id = ?'] [parameters: (<Price of value 360>, 1)] (Background on this error at: http://sqlalche.me/e/rvf5)
(20 additional frame(s) were not displayed)
...
  File "sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)

InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: 'UPDATE products SET price=? WHERE products.id = ?'] [parameters: (<Price of value 360>, 1)] (Background on this error at: http://sqlalche.me/e/rvf5)

Bot can not receive commands from telegram

After setting config file and run the bot, /start command not working

log is:

Network error while calling get_updates(), retrying in 5 secs...

I can't find out why this is happening

Support MySQL

I want to use MySQL instead of SQLite.
But an error occurs after switching engine.

Cannot view transaction list

The Transaction list from the admin menu does not load transactions if any are present. The error can be replicated on a new installation from the master branch.

Steps to replicate:
Create transactions manually from admin panel > Transaction list
Full error: Can't parse entities: unsupported start tag "transaction" at byte offset 16

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.