Closed demget closed 3 months ago
A module that handles /version command that sends the bot version to the user.
/version
mods: - import: plant/version repo: automatica-team/bots
func githubTags(repo string) ([]string, error) { resp, err := http.Get("https://api.github.com/repos/" + repo + "/tags") if err != nil { return nil, err } defer resp.Body.Close() var tags []struct { Name string `json:"name"` } if err := json.NewDecoder(resp.Body).Decode(&tags); err != nil { return nil, err } var names []string for _, tag := range tags { names = append(names, tag.Name) } return names, nil }
A module that handles
/version
command that sends the bot version to the user.