Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JishoCmd = &framework.Command{ Name: "jisho", PermissionRequired: 0, OwnerOnly: false, Help: "Searches jisho and displays the first result", Exec: func(ctx *framework.Context) error { search := ctx.TakeRest()[1:] sr, err := j.SearchKeyword(search) if err != nil { return err } ctx.ReplyEmbed(JishoResponseAsEmbed(sr)) return nil }, Setup: nil, }
View Source
var KanjiCmd = &framework.Command{ Name: "kanji", PermissionRequired: 0, OwnerOnly: false, Help: "", Exec: func(ctx *framework.Context) error { kanjiStr, err := ctx.GetArgIndex(0) if err != nil { return err } if utf8.RuneCountInString(kanjiStr) > 1 { return errors.New("kanji are always one character") } k, err := j.SearchForKanji(kanjiStr) if err != nil { return err } _, err = ctx.ReplyEmbed(TransformKanjiToEmbed(k)) return err }, }
Functions ¶
func JishoResponseAsEmbed ¶
func JishoResponseAsEmbed(sr *jisho.SearchResp) *discordgo.MessageEmbed
func TransformKanjiToEmbed ¶
func TransformKanjiToEmbed(k *jisho.Kanji) *discordgo.MessageEmbed
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.