Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajarakoto/ampalibe-extension
VSCode extension for Ampalibe framework 🥝
https://github.com/rajarakoto/ampalibe-extension
ampalibe bot chatbot extension messenger snippets vscode
Last synced: 19 days ago
JSON representation
VSCode extension for Ampalibe framework 🥝
- Host: GitHub
- URL: https://github.com/rajarakoto/ampalibe-extension
- Owner: RajaRakoto
- License: mit
- Created: 2022-08-31T13:30:13.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-10T08:55:35.000Z (3 months ago)
- Last Synced: 2024-10-08T21:06:52.724Z (about 1 month ago)
- Topics: ampalibe, bot, chatbot, extension, messenger, snippets, vscode
- Language: JavaScript
- Homepage:
- Size: 351 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ampalibe-extension 🥝
![Git](https://img.shields.io/badge/-Git-777?style=flat&logo=git&logoColor=F05032&labelColor=ffffff) ![Gitub](https://img.shields.io/badge/-Gitub-777?style=flat&logo=github&logoColor=777&labelColor=ffffff)
**[Ampalibe](https://github.com/iTeam-S/Ampalibe) is a lightweight Python framework for building Facebook Messenger bots faster. It provides a new concept, it manages webhooks, processes data sent by Facebook and provides [API Messenger](https://developers.facebook.com/docs/messenger-platform) with advanced functions such as payload management, item length, and more.**
**Ampalibe** simplifies its utilization through a dedicated [VSCode extension](https://github.com/RajaRakoto/ampalibe-extension), encompassing a variety of code snippets.
**Usage**: You can install it by typing "Ampalibe" in the extension tab of your IDE
prefix
body
descriptionamp-def
```python
def ${1:func_name}(sender_id, cmd, **extends):
${2:code...}
```> [basic]: Default function for ampalibe
amp-cmd
```python
@ampalibe.command(${1:'/route'})
def ${2:func_name}(sender_id, cmd, **extends):
${3:code...}
```> [basic]: Create ampalibe command
amp-act
```python
@ampalibe.action(${1:'/route'})
def ${2:func_name}(sender_id, cmd, **extends):
${3:code...}
```> [basic]: Create ampalibe action
amp-chat-sms
```python
chat.send_message(sender_id, ${1:sms})
```> [chat]: Sends an SMS to the specified recipient
amp-chat-sms-format
```python
chat.send_message(sender_id, f'${1:sms_format}')
```> [chat]: Sends an SMS to the specified recipient (format)
amp-chat-qckreply
```python
chat.send_quick_reply(sender_id, ${1:responses_buttons}, ${2:question})
```> [chat]: create quick reply submit
amp-chat-sendlocal
```python
chat.send_file(sender_id, ${1:local_path}, filetype=${2:audio|video|file})
```> [chat]: send local file to user
amp-chat-sendurl
```python
chat.send_file_url(sender_id, ${1:url}, filetype=${2:audio|video|file})
```> [chat]: send URL file to user
amp-chat-sendfb
```python
chat.send_media(sender_id, ${1:fb_url}, ${2:audio|video|file})
```> [chat]: send facebook file to user
amp-import-nat-latest
```python
import ampalibe
from ampalibe import Model, Messengerchat = Messenger()
query = Model()chat.get_started()
```> [deps]: version>=1.1.4 - Import the native module for ampalibe
amp-import-nat
```python
import ampalibe
from conf import Configurationbot = ampalibe.init(Configuration())
chat = bot.chat
query = bot.querychat.get_started()
```> [deps]: version<=1.0.7 - Import the native module for ampalibe
amp-import-config
```python
from conf import Configuration as config
```> [deps]: Import config
amp-import-quickreply
```python
from ampalibe.ui import QuickReply
```> [deps]: import quick reply deps
amp-import-button
```python
from ampalibe.ui import Button
```> [deps]: import button deps
amp-import-sendtemplate
```python
from ampalibe import Payload
from ampalibe.ui import Element, Button
```> [deps]: import send_template deps
amp-pattern-credentials
```python
@ampalibe.command(${1:'/route'})
def ${2:func_name}(sender_id, cmd, **ext):
chat.send_message(sender_id, ${3:'Enter your mail'})
query.set_action(sender_id, ${4:'/get_mail'})@ampalibe.action(${4:'/get_mail'})
def ${5:get_mail}(sender_id, cmd, **ext):
query.set_temp(sender_id, 'mail', cmd)
chat.send_message(sender_id, ${6:'Enter your password'})
query.set_action(sender_id, ${7:'/get_password'})@ampalibe.action(${7:'/get_password'})
def ${8:get_password}(sender_id, cmd, **ext):
query.set_action(sender_id, None)
${9:'mail'} = query.get_temp(sender_id, ${9:'mail'})
${10:'password'} = cmd
```> [pattern]: Generate credentials pattern
amp-query-setact
```python
query.set_action(sender_id, ${1:'/route'})
```> [query]: Points to a specific route according to the argument
amp-query-nullact
```python
query.set_action(sender_id, None)
```> [query]: Point action to null
amp-query-settemp
```python
query.set_temp(sender_id, ${1:'data_key'}, cmd)```
> [query]: Create/Modify temporary data
amp-query-gettemp
```python
query.get_temp(sender_id, ${1:'data_key'})```
> [query]: Get temporary data
amp-query-deltemp
```python
query.del_temp(sender_id, ${1:'data_key'},)```
> [query]: Delete temporary data
amp-ui-button
```python
${1:button_name} = [
Button(
type='postback',
title=${2:titleValue},
payload=${3:route}
)
]chat.send_button(sender_id, buttons, ${3:question})
```> [ui]: create button
amp-ui-persistent
```python
persistent_menu = [
Button(type='postback', title=${1:title_value}, payload=${2:route})
]chat.persistent_menu(sender_id, persistent_menu)
```> [ui]: create persistent menu
amp-ui-quickreply
```python
${1:quick_rep_name} = [
QuickReply(
title=${2:'Angela'},
payload=Payload(${3:'/route'}, name=${2:'Angela'}, ref=${4:'id'})
),
QuickReply(
title=${5:'Rivo'},
payload=Payload(${6:'/route'}, name=${5:'Rivo'}, ref=${7:'id'})
)
]
chat.send_quick_reply(sender_id, ${1:quick_rep_name}, ${8:'Question?'})
```> [ui]: create quickreply