johnbocook
9/28/2017 - 6:50 AM

LunchBot is a little slack integration that randomly chooses where to have lunch.

LunchBot is a little slack integration that randomly chooses where to have lunch.

<cfoutput>
    <cfif #StructKeyExists(FORM, "token")#>
    
        <cfif #FORM.token# NEQ '#PUBLICKEY##'>
            Sorry, Authentication Failed
            <cfelse>
                <cfset resturants = "BW3, Roosters, Wendys, Gibbys, Tuscan Table, El Palmor, Goodwins Family 
                Resturant, Cardo's Pizza, Zanzy's Pizza, High Court Cafe, Arby's, Grand Buffett, McDonalds, KFC, Richie's New York Corner Deli, ">

                <cfset objRandomReport=ArrayNew(1)>

                <cfset objRandomReport=ListToArray(resturants)>

                <cfset ArraySort(objRandomReport,"textnocase","ASC")>

                <!--- random number b/n 1 and length of list/array --->
                <cfset resturant=objRandomReport[RandRange(1,ArrayLen(objRandomReport))]>

                <cfoutput>Team, Lunch Roulette has spoken: *#resturant#* is the spot.</cfoutput>
                                
                
        </cfif>
    </cfif>
</cfoutput>