示例#1
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())
               ]
示例#2
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())]
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())]