mute

package
v0.0.0-...-74574b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MuteCmd = &cobra.Command{
	Use:   "mute",
	Short: "Show channel muting.",
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		client, err := internal.NewClient(common.Addr, common.Token)
		if err != nil {
			return err
		}

		settingsResponse, err := client.GetSettingsWithResponse(ctx)
		if err != nil {
			return err
		}

		log.WithFields(log.Fields{"settings": spew.Sdump(settingsResponse.JSON200)}).Debug("Got settings")

		if settingsResponse.JSON200.Channel != nil {
			for _, channel := range *settingsResponse.JSON200.Channel {
				log.WithFields(log.Fields{"channel": *channel.ChannelId, "muted": *channel.Dsp.Mute.Value}).Printf("Mute status")
			}
		}

		return nil
	},
}

MuteCmd is a quick and dirty placeholder showing how to interact with the REST API.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL