Coder Social home page Coder Social logo

jlmadurga / permabots Goto Github PK

View Code? Open in Web Editor NEW
81.0 2.0 24.0 2.62 MB

Connect instant messaging bots to your APIs.

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.25% Python 99.75%
python django bots chatbot telegram kikbot facebook-messenger-bot

permabots's People

Contributors

jlmadurga 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

Watchers

 avatar  avatar

permabots's Issues

Problem with run tests

I want to add support another bot type but faced problem with running tests.

My OS is Linux Mint 18.2, python version is 3.5.2

Steps to reproduce

  1. Clone the project:
$ git clone [email protected]:orehush/permabots.git
Cloning into 'permabots'...
remote: Enumerating objects: 2431, done.
remote: Total 2431 (delta 0), reused 0 (delta 0), pack-reused 2431
Receiving objects: 100% (2431/2431), 2.61 MiB | 2.21 MiB/s, done.
Resolving deltas: 100% (1760/1760), done.
Checking connectivity... done.

$ cd permabots/
  1. Create virtualenv:
$ mkvirtualenv permabots_dev -p /usr/bin/python3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/orehush/.virtualenvs/permabots_dev/bin/python3
Also creating executable in /home/orehush/.virtualenvs/permabots_dev/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
  1. Install requirements:
$ pip install -r requirements/test.txt 
...
Installing collected packages: pytz, django, djangorestframework, future, python-telegram-bot, MarkupSafe, Jinja2, six, python-dateutil, arrow, jinja2-time, requests, billiard, amqp, anyjson, kombu, celery, shortuuid, kik, messengerbot, coverage, pbr, mock, entrypoints, pycodestyle, mccabe, pyflakes, flake8, virtualenv, pluggy, toml, filelock, py, tox, fake-factory, factory-boy, django-filter
Successfully installed Jinja2-2.8 MarkupSafe-1.1.1 amqp-1.4.9 anyjson-0.3.3 arrow-0.13.1 billiard-3.3.0.23 celery-3.1.23 coverage-4.5.2 django-2.1.7 django-filter-0.13.0 djangorestframework-3.9.1 entrypoints-0.3 factory-boy-2.7.0 fake-factory-9999.9.9 filelock-3.0.10 flake8-3.7.7 future-0.17.1 jinja2-time-0.1.0 kik-1.0.7 kombu-3.0.37 mccabe-0.6.1 messengerbot-0.1.4 mock-2.0.0 pbr-5.1.2 pluggy-0.9.0 py-1.8.0 pycodestyle-2.5.0 pyflakes-2.1.0 python-dateutil-2.8.0 python-telegram-bot-4.2.0 pytz-2018.9 requests-2.10.0 shortuuid-0.4.3 six-1.10.0 toml-0.10.0 tox-3.7.0 virtualenv-16.4.1

  1. Run tests:
$ make test
python runtests.py tests
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "runtests.py", line 38, in <module>
    run_tests(*sys.argv[1:])
  File "runtests.py", line 31, in run_tests
    failures = test_runner.run_tests(test_args)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/runner.py", line 604, in run_tests
    old_config = self.setup_databases()
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/runner.py", line 551, in setup_databases
    self.parallel, **kwargs
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/utils.py", line 174, in setup_databases
    serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/backends/base/creation.py", line 68, in create_test_db
    run_syncdb=True,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/__init__.py", line 148, in call_command
    return command.execute(*args, **defaults)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 203, in handle
    fake_initial=fake_initial,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 330, in database_forwards
    new_model._meta.db_table,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/backends/sqlite3/schema.py", line 93, in alter_db_table
    ) % old_db_table)
django.db.utils.NotSupportedError: Renaming the 'permabots_bot' table while in a transaction is not supported on SQLite because it would break referential integrity. Try adding `atomic = False` to the Migration class.
Makefile:30: recipe for target 'test' failed
make: *** [test] Error 1

Have I missed some configurations ?

Self signed certificates

Please enable uploading of self signed certificates to telegram bots when setting web-hooks. The python telegram bot API already comes with it so you just need to add the parameter. It is very useful during development

Handlers not working

Hi, I've been trying to setup a telegram bot, but no luck so far.
At the moment I've got to get it receiving messages from the telegram servers but when I setup a handler to reply to all messages (.*) pattern, it doesn't work.
I've tried the same setup on www.permabots.com and it works properly there.

I've read all the docs available and tried to dig in the code, but no success.
If is there anything you can point me out would be great.

btw, thanks for the project.

Deploy to Heroku button is broken

The deploy fails on the step Run scripts & scale dynos with the following traceback:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
    self.check()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
    include_deployment_checks=include_deployment_checks,
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
    issues.extend(super(Command, self)._run_checks(**kwargs))
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
    return check_resolver(resolver)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
    return check_method()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
    for pattern in self.url_patterns:
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
    return import_module(self.urlconf_name)
  File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/permabots_demo/urls.py", line 22, in <module>
    url(r'^docs/', include('rest_framework_swagger.urls', namespace="swagger")),
  File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework_swagger/urls.py", line 2, in <module>
    from rest_framework_swagger.views import SwaggerResourcesView, SwaggerApiView, SwaggerUIView
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework_swagger/views.py", line 8, in <module>
    from django.shortcuts import render_to_response, RequestContext
ImportError: cannot import name RequestContext

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.