permabots.views.hooks package¶
Submodules¶
permabots.views.hooks.kik_hook module¶
-
class
permabots.views.hooks.kik_hook.KikHookView(**kwargs)[source]¶ Bases:
rest_framework.views.APIViewView for Kik webhook.
-
post(request, hook_id)[source]¶ - Process Kik webhook:
- Get an enabled Kik bot
- Verify Kik signature
- Serialize each message
- For each message create
KikMessageandKikUser - Delay each message processing to a task
- Response provider
-
permabots.views.hooks.messenger_hook module¶
-
class
permabots.views.hooks.messenger_hook.MessengerEntry(page_id, time=None, messaging=None)[source]¶
-
class
permabots.views.hooks.messenger_hook.MessengerHookView(**kwargs)[source]¶ Bases:
rest_framework.views.APIViewView for Facebook Messenger webhook
-
get(request, hook_id)[source]¶ Verify token when configuring webhook from facebook dev.
MessengerBot.id is used for verification
-
post(request, hook_id)[source]¶ - Process Messenger webhook.
- 1. Get an enabled Messenger bot
3. For each message serialize
4. For each message create
MessengerMessage5. Delay processing of each message to a task 6. Response provider
-
-
class
permabots.views.hooks.messenger_hook.MessengerMessaging(sender=None, recipient=None, timestamp=None, type=None, message=None)[source]¶ Bases:
permabots.views.hooks.messenger_hook.Resource-
is_delivery¶
-
is_message¶
-
is_postback¶
-
-
exception
permabots.views.hooks.messenger_hook.OnlyTextMessages[source]¶ Bases:
exceptions.Exception
permabots.views.hooks.permabots_hook module¶
-
class
permabots.views.hooks.permabots_hook.PermabotsHookView(**kwargs)[source]¶ Bases:
rest_framework.views.APIViewView for Notification Hooks.
-
authentication_classes= (<class 'rest_framework.authentication.TokenAuthentication'>,)¶
-
permission_classes= (<class 'rest_framework.permissions.IsAuthenticated'>,)¶
-