Gilda
A simple bot for the Bluegrass Developers guild .... Gilda. or should it be Guilda?
Please feel free to submit PRs for any issues, errors, and/or additional functionality. Before doing so see the code of conduct.
Libraries and tools we use
build new functions
fn init --runtime python --trigger http <function name>
fn list triggers gilda
should list the http trigger for the new event
Running locally
-
start the local server
fn start --log-level debug
-
Make sure you have a local app
fn list apps
- if not create one
fn create app gilda
- if not create one
-
set up environment variables
- if you don't want to use Slack or OCI endpoints (everything stays local)
fn cf a gilda is_local True
to deletefn cf a gilda is_local ""
- to use OCI local config
fn cf a gilda local_oci_config True
to deletefn cf a gilda local_oci_config ""
fn cf a gilda random_channel_id <some_id>
fn cf a gilda slack_bot_token <some token>
fn cf a gilda compartment_id <oracle OCID>
fn cf a gilda web_auth_token auth_1234
fn cf a gilda local_oci_config True
- if you don't want to use Slack or OCI endpoints (everything stays local)
-
deploy locally
fn --verbose deploy --app gilda --all --local --no-bump
-
List functions
fn list functions gilda
-
Grab local url
fn inspect function gilda events
Deploy
- create context
fn create context gilda --provider oracle --registry yyz.ocir.io/<id>/gilda --api-url https://functions.ca-toronto-1.oraclecloud.com
fn use context gilda
fn update context oracle.compartment-id
fn --verbose deploy --app Gilda --all
invoke
use the fn command echo -n '{"name":"Bob"}' | fn invoke gilda events
or simply good old fashioned curl, like your mother taught you:
curl -X "POST" -H "Content-Type: application/json" -d '{ "type": "url_verification","token": "JRoGaO6sIgohYqywBlT3Q0vz","challenge": "wnxwuwy1LjvmMB7HWTV3M2KRiYDhQgeLqlxhT2064MIvVFtOYTN1", "event": {"type": "member_joined_channel", "channel":"<some_id>", "user": "<some_url>"} }' http://localhost:8080/t/gilda/events
curl -X "POST" -H "Content-Type: application/json" -d '{"token": "auth_1234"}' http://localhost:8080/t/gilda/learning
Or use Insomnia Core and import the insomnia_export.json