4kelly / go-kik

A Go client library for the Kik bot API. Unfortunately, I missed the bot craze by about 4 years on this one. I wrote it strictly to practise Go.

Home Page:https://bots.kik.com/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kikbot

A Go client library for the Kik bot API.

Example usage in here.

package main

import (
	"log"
	"net/http"
	"os"
	"time"

	"github.com/4kelly/go-kik/kik"
	"github.com/google/go-cmp/cmp"
)

var (
	kikClient *kik.Client
	err       error
)

func init() {
	username := os.Getenv("KIKBOT_USERNAME")
	key := os.Getenv("KIKBOT_API_KEY")
	webhook := os.Getenv("KIKBOT_WEBHOOK")

	client := &http.Client{
		Transport:     nil,
		CheckRedirect: nil,
		Jar:           nil,
		Timeout:       time.Duration(3) * time.Second,
	}

	kikClient, err = kik.NewKikClient(
		"https://api.kik.com/",
		username,
		key,
		client,
	)
	if err != nil {
		log.Fatalf("could not initiate client: %v ", err)
	}

	err = kikClient.SetConfiguration(&kik.Configuration{
		Webhook:        webhook,
		Features:       kik.Features{},
		StaticKeyboard: nil,
	})
	if err != nil {
		log.Fatalf("could not configure kik client: %v ", err)
	}
}

Testing

Run system tests to validate integrity of the Kik API.

go test ./...

About

A Go client library for the Kik bot API. Unfortunately, I missed the bot craze by about 4 years on this one. I wrote it strictly to practise Go.

https://bots.kik.com/#/


Languages

Language:Go 100.0%