 Hello, this is Wapu. Wapu came into being in 2009 in Japan as a way to help market wordpress to people in Japan. And if you want to find out the history of Wapu and see all the different Wapus, you can go to Wapu.us, one of the sponsors here. They've got all the info there. And all the different word camps around the world created, well, most of them have created their own version of Wapu with their own cultural flavor. So back in 2016, we got our own Wapu for Miami. And Cafecito Wapu was designed by Michelle Shoup. She's the girl with the purple hair. You've seen her around. She's here at WordCamp. And all the Wapus hold something, so like a ball or something like that. So our Wapu holds a little shot of Cuban coffee. You can see, rather than just the dots, he's got like these crazy caffeinated eyes. He's shaking. And where's the guayabera? So in 2016, when our Wapu was created, I thought this is just amazing. This is the most awesome thing. So I decided, as one of the organizers, I would create a Twitter account as a personality for Wapu, Cafecito Wapu. And so I live tweeted WordCamp as Cafecito Wapu. And I thought, you know what? I'll take the opportunity to introduce people to stuff about Miami, Spanglish, all sorts of different things. And so he kind of got a personality. And then the next year, we decided to create this Slack bot. So he would just interact with the personality in Slack. And WordCamp had started to adopt Slack as the main method, main way of communication. So we thought, I mean, there might be a benefit because it could respond to some questions that people have. But just make it fun as well. So as far as the actual how does a bot work or how does this bot work, you've got Slack. And Slack is, you know, an application that you create messages on. And when you create an app for Slack, you can send and receive messages back and forth between that app. So Wapu is the app. By the way, he's got like these Spanglish kind of sayings here. This is a typical Cuban thing. It's like, it's not easy, man. So that's the app in the middle. And it's a javascript node app running on a web server some place. And you just tell Slack whenever you get a message, you know, based on certain parameters, you send it to the app. And the app does stuff with it and responds back. Well, this particular app that I wrote, one of the helpful things It does is allow people to search the schedule. So if you in Slack, if you say at Wapu, find, just type, you Know, part of somebody's name or maybe javascript and it'll Find you a session or like a speaker, you know, with that name. The way that he does that is that I pull, I pull the word Camp schedule from our website, which is a WordPress site Using the WordPress json api. And then I save that, all the schedule information in a MongoDB Database, kind of as a local cache. Or cache actually on another server. And then when he gets a request to like do a search, He searches the database. See, I'm already talking about using anthropomorphic language For the bot. It's a javascript app. It's not a he, but you know, it makes it more fun to talk about it As he does this, you know. So that's basically the app. So a couple of helpful links. Pardon me, I'm getting over a cold. I mean, I'm over it, but just got a cough. Slack has an api and you can find all about it here at api.slack.com And you can create what's called a bot user. You can do other stuff like slash commands. I'm sure you've seen those in Slack, where you can just like do Something like create a to-do item or something like that, Depending on the app. But you can also create a bot app, A bot user app, which basically integrates in as if it were Another user. So it can create messages, Respond to messages. So that's what this app does. And you can either mention at wapoo or you can Just say anything to somebody else on the channel. And all those messages get sent to the app. A useful service you might have with it is like maybe you want To do some kind of content filtering. I'm sure you all, if you've ever used Slack, you've seen the Like if you say hey, guys, the Slack bot by default will Say, well, don't you mean to say hey, team instead of Hey, guys? Because you're using mail language. Well, in san francisco, that's the way things are done. But in miami, rightly or wrongly, when you say guys, girls Say guys to each other, too. The girls will say hey, guys, And there's four girls there. And let's go to the mall. Or let's go write some code. And the girls say guys as well. So the bot in Slack is intercepting that message and Putting up something else that you want to do. So that's the Slack api. Now, this bot app that I wrote, Any bot app is basically a web service that responds to HTTP requests. So with this particular one, It's Node.js. And I found a project on github. It's called botkit. There's a company named howdy.ai. I got all the links at this later on in the slides. And so this botkit is set up as a framework to allow you to Just put in the hooks to respond to the different messages And also then receive and send back. So it handles all the Plumbing. One of the difficult things about Writing a bot app is determining the intent of somebody. If you've been watching on the channel, i'm sure you've Seen some embarrassing responses that wapu does. Like for instance, i had it set up that if anybody says Anything about registration, he replies with, you know, The registration desk, blah, blah, you know, bring it. And so later on this afternoon, people were saying, Hey, we set up a lost and found at the registration desk. Somebody left their keys at the registration desk. And then the bot is replying, in order to register, Go to the, you know, it's just kind of inappropriate. So that's one of the tricky things with writing a bot like This, like a chat bot, is that if you write it simply like i Did, which was just to have like a dictionary of key words, Then you're going to get into that kind of thing where Sometimes it's not appropriate. So to fix it, i just turned Off the registration. We're already past registration, So i just kind of turned off that listening. But last year, i used a service which is a natural Language processing service. And this is where people are Actually using what they call ai nowadays. It's, you know, machine learning or whatever. And so there's different services. There's louis.ai, which is Built by microsoft. There's wit.ai, which is built by Facebook. And you can actually configure different Phrases to determine what somebody is trying to get at. So i used that last year. And it worked pretty well. But then i started having to do exceptions. So i ended up having to do my own little, you know, put in Keyword searches and stuff like that anyway. So i just ditched the natural language processing this Here. And what it did was in the JavaScript app, i just built like a bunch of keywords. And then, you know, respond with this or respond with Some kind of random gif image or something. So, but that's one of the more difficult things about Writing a bot just in case you ever decide to. So in order to get the word camp schedule data, like i said, I used the word press api. And this was really helpful Because word camp central, which is run by the word Camp foundation, provides all the hosting for the Word camp websites. So they've been doing this For years. In the past we'd have to get Our own domain. It was a mess. And so they provide all the hosting on wordpress.com for All the word camps around the world. But it's locked down. I can't go in and edit functions.php. I can't put in a new page template. I can't touch any of that stuff. All i can do, when we do Our website, everything's got to be customized through css. It's a nightmare. But i've learned a lot about how Into, you know, so basically like if there's some stuff Displayed about the schedule and the logic, in css i have to Put in rules to say hide this or add this content, that Kind of thing, all through css rules. They haven't locked down. But they did thankfully provide at least the basic Feed for the sessions from the schedule. So the app that i wrote pulls down that feed using the json API. I can't customize it by saying, You know, include this or transform this. Like put, you know, look up this like if i get a category ID, you know, give me the actual name of the category. I have to get, kind of map that myself in the app. But at least i was able to get that. And i think it's a good example of just how wordpress Is becoming, it has become, but even more just a content Repository sometimes without really being a website. So this was a website that's out there. But my app is integrating through slack and showing data That's managed on the wordpress website. If you caught the talk earlier by jorigo from brazil, He like did a demo with raspberry pi, you know, Posting to a wordpress site. So it's kind of cool how wordpress Is becoming like that. Also in the app, i used mongo db, Like i said, to kind of cache and format the data in a nicer Format that i could easily search. And i came across this nifty little mongo db library. First time i ever touched mongo db in my life was with this project about a month ago. And i found this little library called monk. And it turns out it was developed by automatic. So i used monk as a kind of little library to run my mongo Queries and also save the data. So here's an example of what wapu with the app does. Like for instance, i have some key words that are just Kind of easter eggs. If you mention swag, you'll get Like a random gift that i made, you know, for swag. If you compliment wapu or say something to him, you know, he'll Respond with different, you know, try to come up with different Kinds of miami, caribbean, or cuban, hasian, jamaican, Kind of sayings from miami. You can search like find mat, And that shows you like it shows you the different, the two Sessions where somebody named mat is mentioned. Don't miss mat mullaby later today. I've got some easter eggs where he just like comments on, you know, Just says something like a deep thought, you know. Also mentioned coffee. He loves coffee. And he'll serve up some coffee. Now here's interesting. We had the whole tragedy on thursday. And all the stuff i had planned, i had to kind of modify Because we had new information. So what i did was i went in And i put like in a few places, like if somebody asked about Directions or so on, i modified to put in like a little Update about going to our website, you know, with the latest News about the update. So this is actually something useful That a bot, you know, could do. Like say you don't have a person Who's manning your slack channel, or facebook, or even text Messaging, whatever it is. You know, you can have a bot That can at least give people information or give a number to Call or a website to go to. So all the source code for What i did is in this repository. I didn't write a whole lot of code. All i had to do was take That bot kit demo app or sort, you know, starter app. And i had to put in the definition for the different Controllers and also then my data for what i was going to Use for what messages and so on. I think that you could Take this and go ahead, like if you wanted to do something With it, you know, you could try it out just to see what I did for another word camp. There's a lot of things in it that are special just for word Camp miami, but hopefully it could be a starter. Here's some links to the resources and services i used. So slack bot kit, the wordpress rest api. This is one interesting thing and i've got one minute left Right. I am a c sharp dot net Sequel server developer. I'm 52 years old. I learned javascript and node j s on the side. It wasn't part of my job. I'm not one of those young kids Taking, like, a code camp thing and trying to get a node job. But i've got experience and you've got to always keep Learning. One of the hardest things about Developing with javascript and node is that barrier for How to get in, right, and manage all that command line Crap you've got to do on the front end. There's this service called glitch where you can put up a node App and you just put in the packages that you want to use And it installs them and deploys to a container. And you kind of just edit it right on the web. And i'm going to show it right here and stop my talk because I'm out of time. But here is the actual app I've got. All my files. Here's the code for some of those controllers. When i go in and edit, i don't even have to save. Every type i make once it detects that it compiles, it deploys It to a container and the app is new and fresh out there. It's an awesome way to learn javascript. So glitch.com. That was another one of the Resources i had. You can get the github repository. Link from there or on my website, popasoft.com. So i think i didn't have any time for questions but if you Want to hit me up afterwards i'll be happy to answer some questions. I think you will be on the happiness ride too after this. Beware.