Skip to content
/ go-kik Public

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.

Notifications You must be signed in to change notification settings

4kelly/go-kik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Languages