Skip to content

dogegarden/dogehousego

Repository files navigation

DogeGarden logo

A wrapper for DogeHouse made in Go 💨

discord - users online


Need help or support?
Join our Discord.

Done:

  • Websocket connection
  • Api key authentication
  • Event subscription
  • Query ws events
  • About 50% of mutations

TODO:

  • The rest of mutations
  • Whole audio module
  • Docs

Example usage:

package main

import (
	"fmt"
	"github.com/dogegarden/dogehousego"
)

func main() {
	retval, err := dogehousego.Auth("your-api-key")
	if err != nil {
		fmt.Println(err.Error())
		return;
	}

	con := dogehousego.Connection{
		AccessToken:  retval.AccessToken,
		RefreshToken: retval.RefreshToken,
	}

	con.OnNewChatMessage(func(event dogehousego.OnNewMessageEvent, err error) {
		if err != nil {
			fmt.Println("New chat message error! " + err.Error());
			return;
		}

		message := dogehousego.TokensToString(event.Msg.Tokens)

		fmt.Println(message)
	});

	con.OnReady(func(event dogehousego.OnReadyEvent, err error) {

		if err != nil {
			fmt.Println("Error while logging in!: " + err.Error())
		}

		fmt.Println("Logged in as: " + event.User.Username)
		rooms, err := con.GetTopPublicRooms(0)
		if err != nil {
			fmt.Println(err.Error())
			return
		}

		info, err := con.JoinRoomAndGetInfo(rooms.Rooms[0].Id)

		if err != nil {
			fmt.Println("Error while joining the room! " + err.Error())
			return
		}

		fmt.Printf("Joined room: %s | User count: %d\n", info.Room.Name, len(info.Users));
	});

	fmt.Println(con.Start())
}

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages