Skip to content

Instantly share code, notes, and snippets.

View anchetaWern's full-sized avatar
🏠
Working from home

Wern Ancheta anchetaWern

🏠
Working from home
View GitHub Profile
@anchetaWern
anchetaWern / basic_data_intent_sample.json
Created July 13, 2019 08:10
Pokedex Bot: sample Dialogflow response
{
"responseId":"xxxxx-xxx-xx-xxx-xxxxx-xxxxxxx",
"queryResult":{
"queryText":"Image of pikachu",
"parameters":{
"specs":"photo",
"pokemon":"Pikachu"
},
"allRequiredParamsPresent":true,
"fulfillmentText":"pikachu",
@anchetaWern
anchetaWern / get_type_effectiveness_intent_sample_request.json
Created July 13, 2019 08:07
Pokedex Bot: sample fulfillment server request body from Dialogflow
{
"responseId":"xxxx-xxx-xxx-xx-xxxxxx-xxxxx",
"queryResult":{
"queryText":"What is super effective against ice type?",
"parameters":{
"pokemon_types":"ice",
"type_effectiveness":"double_damage_from"
},
"allRequiredParamsPresent":true,
"fulfillmentMessages":[
@anchetaWern
anchetaWern / extract Dialogflow parameters in server.js
Last active July 13, 2019 07:43
Pokedex Bot: extract Dialogflow parameters in server.js
const { intent, parameters, outputContexts, queryText } = req.body.queryResult;
const pokemon = (parameters.pokemon) ? parameters.pokemon.toLowerCase().replace('.', '-').replace(' ', '').replace("'", "") : '';
const specs = parameters.specs;
const get_type_effectiveness = (parameters.type_effectiveness) ? true : false;
let response_obj = {};
@anchetaWern
anchetaWern / add Dialogflow webhook handler in server.js
Last active July 13, 2019 07:43
Pokedex Bot: Add Dialogflow webhook handler in server.js
const pokemon_endpoint = ['abilities', 'moves', 'photo'];
const pokemon_species_endpoint = ['description', 'evolution'];
app.post("/pokedex", async (req, res) => {
try {
const { intent, parameters, outputContexts, queryText } = req.body.queryResult;
const pokemon = (parameters.pokemon) ? parameters.pokemon.toLowerCase().replace('.', '-').replace(' ', '').replace("'", "") : '';
const specs = parameters.specs;
@anchetaWern
anchetaWern / type_effectiveness.csv
Last active July 13, 2019 05:09
Pokedex Bot: type_effectiveness entity
double_damage_from double damage from double_damage_from super effective against super effective to very effective against weakness of
double_damage_to double damage against double damage to double_damage_to strong against
half_damage_from half damage from half_damage_from not so effective against not very effective against not very effective to
half_damage_to half damage against half damage to half_damage_to
no_damage_from no damage against no damage from no effect against no_damage_from resistant against resistant to
no_damage_to has no damage to has zero damage to no effect to no_damage_to
@anchetaWern
anchetaWern / Bootstrapping the project
Last active July 12, 2019 06:03
Pokedex Bot: Bootstrapping the project
git clone https://github.com/anchetaWern/RNPokedexBot.git
cd RNPokedexBot
git checkout starter
yarn
react-native eject
react-native link react-native-dialogflow
react-native link react-native-voice
react-native run-android
react-native run-ios
@anchetaWern
anchetaWern / training phrases for get_type_effectiveness intent
Created July 12, 2019 05:40
Pokedex Bot: training phrases for get_type_effectiveness intent
what is strong against electric type?
what is weak against ground type?
what is rock type super effective against?
what is super effective against dragon type?
what is ground type no effect against?
what has no effect against ground type?
what has half damage against fire type?
what fire type has half damage to?
what bird type has double damage to?
what has double damage against fighting type?
@anchetaWern
anchetaWern / training phrases for evolution intent
Created July 12, 2019 05:27
Pokedex Bot: training phrases for evolution intent
what came before mew?
what's next after vulpix
what comes after machoke
tentacool evolves to
machamp evolves from
what does bayleef evolve from?
evolutions of charmander
third form of bulbasaur
second form of kabuto
first form of golem?
@anchetaWern
anchetaWern / pokemon.csv
Created July 12, 2019 03:37
Pokedex Bot: Pokemon entity
Abomasnow Abomasnow
Abra Abra
Absol Absol
Accelgor Accelgor
Aerodactyl Aerodactyl
Aggron Aggron
Aipom Aipom
Alakazam Alakazam
Alomomola Alomomola
Altaria Altaria
@anchetaWern
anchetaWern / pokemon_types.csv
Created July 12, 2019 03:37
Pokedex Bot: pokemon_types entity
bug bug
dark dark
dragon dragon
electric electric
fairy fairy
fighting fighting
fire fire
flying flying
ghost ghost
grass grass