Example #1
0
from .bot_views import StartCommandView, UnknownCommandView, QuestionCommandView, VoteCommandView, HelpCommandView

from telegrambot.handlers import command, unknown_command
from telegrambot.bot_views.decorators import login_required

urlpatterns = [command('start', StartCommandView.as_command_view()),
               command('question', QuestionCommandView.as_command_view()),
               command('vote', login_required(VoteCommandView.as_command_view())),
               command('help', HelpCommandView.as_command_view()),
               unknown_command(UnknownCommandView.as_command_view())]
Example #2
0
from oscar_telegrambot.commands_views import StartView, HelpView, UnknownView, \
    CategoryListDetailView, ProductListDetailView, OrdersCommandView
from telegrambot.handlers import command, unknown_command
from telegrambot.bot_views.decorators import login_required

urlpatterns = [command('start', StartView.as_command_view()),
               command('help', HelpView.as_command_view()),
               command('categories', CategoryListDetailView.as_command_view()),
               command('products', ProductListDetailView.as_command_view()),
               command('orders', login_required(OrdersCommandView.as_command_view())),
               unknown_command(UnknownView.as_command_view())
               ]
from telegrambot.commands_views import StartView, AuthorCommandView, AuthorInverseListView, AuthorCommandQueryView, \
    UnknownView, AuthorName, MessageView
from telegrambot.handlers import command, unknown_command, regex, message
from telegrambot.bot_views.decorators import login_required

urlpatterns = [
    command('start', StartView.as_command_view()),
    command('author_inverse', AuthorInverseListView.as_command_view()),
    command('author_query', AuthorCommandQueryView.as_command_view()),
    regex(r'^author_(?P<name>\w+)', AuthorName.as_command_view()),
    command('author_auth', login_required(AuthorCommandView.as_command_view())),
    command('author', AuthorCommandView.as_command_view()),
    unknown_command(UnknownView.as_command_view()),
    message(MessageView.as_command_view())
]
from telegrambot.commands_views import StartView, AuthorCommandView, AuthorInverseListView, AuthorCommandQueryView, \
    UnknownView, AuthorName, MessageView
from telegrambot.handlers import command, unknown_command, regex, message
from telegrambot.bot_views.decorators import login_required

urlpatterns = [
    command('start', StartView.as_command_view()),
    command('author_inverse', AuthorInverseListView.as_command_view()),
    command('author_query', AuthorCommandQueryView.as_command_view()),
    regex(r'^author_(?P<name>\w+)', AuthorName.as_command_view()),
    command('author_auth',
            login_required(AuthorCommandView.as_command_view())),
    command('author', AuthorCommandView.as_command_view()),
    unknown_command(UnknownView.as_command_view()),
    message(MessageView.as_command_view())
]
from polls.bot_views import StartCommandView, UnknownCommandView, \
    QuestionCommandView, VoteCommandView, HelpCommandView

from telegrambot.handlers import command, unknown_command
from telegrambot.bot_views.decorators import login_required

urlpatterns = [command('start', StartCommandView.as_command_view()),
               command('question', QuestionCommandView.as_command_view()),
               command('vote', login_required(VoteCommandView.as_command_view())),
               command('help', HelpCommandView.as_command_view()),
               unknown_command(UnknownCommandView.as_command_view())]