discordhandler

package
v1.5.16 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Enable        = "enable"
	Disable       = "disable"
	Update        = "update"
	TagMe         = "tag me"
	SetReminder   = "set reminder"
	DelTag        = "del tag"
	MyTags        = "my tags"
	TagRoles      = "tag roles"
	RolesTags     = "roles info"
	DelRoles      = "del roles"
	RolesReminder = "roles reminder"
	ChannelState  = "channel state"
	VtuberData    = "vtuber data"
	Info          = "info"
	Upcoming      = "upcoming"
	Past          = "past"
	Live          = "live"
	ModuleInfo    = "module"
)

Prefix command

Variables

View Source
var (
	BotInfo *discordgo.User
)

Functions

func BiliBiliMessage

func BiliBiliMessage(s *discordgo.Session, m *discordgo.MessageCreate)

BiliBiliMessage message handler

func BiliBiliSpace

func BiliBiliSpace(s *discordgo.Session, m *discordgo.MessageCreate)

BiliBiliSpace message hadler

func CheckPermission

func CheckPermission(User, Channel string, bot *discordgo.Session) bool

CheckPermission Check user permission

func CheckReg

func CheckReg(GroupName, Reg string) bool

CheckReg Check available region

func EnableState

func EnableState(s *discordgo.Session, m *discordgo.MessageCreate)

EnableState Enable command message handler

func Fanart

Fanart discord message handler

func FindGropName

func FindGropName(GroupName string) (database.Group, error)

FindGropName Find a valid Vtuber Group from message handler

func Help

Help helmp command message handler

func Module

func RemovePic

func RemovePic(text string) string

RemovePic Remove twitter pic

func StartInit

func StartInit(path string) error

StartInit running the fe

func Status

Status command message handler

func SubsMessage

func SubsMessage(s *discordgo.Session, m *discordgo.MessageCreate)

SubsMessage subscriber message handler

func Tags

Tags command message handler

func YoutubeMessage

func YoutubeMessage(s *discordgo.Session, m *discordgo.MessageCreate)

YoutubeMessage Youtube message handler

Types

type DynamicSvr

type DynamicSvr struct {
	Code    int    `json:"code"`
	Msg     string `json:"msg"`
	Message string `json:"message"`
	Data    struct {
		Card struct {
			Desc struct {
				UID         int   `json:"uid"`
				Type        int   `json:"type"`
				Rid         int   `json:"rid"`
				ACL         int   `json:"acl"`
				View        int   `json:"view"`
				Repost      int   `json:"repost"`
				Comment     int   `json:"comment"`
				Like        int   `json:"like"`
				IsLiked     int   `json:"is_liked"`
				DynamicID   int64 `json:"dynamic_id"`
				Timestamp   int   `json:"timestamp"`
				PreDyID     int   `json:"pre_dy_id"`
				OrigDyID    int   `json:"orig_dy_id"`
				OrigType    int   `json:"orig_type"`
				UserProfile struct {
					Info struct {
						UID   int    `json:"uid"`
						Uname string `json:"uname"`
						Face  string `json:"face"`
					} `json:"info"`
					Card struct {
						OfficialVerify struct {
							Type int    `json:"type"`
							Desc string `json:"desc"`
						} `json:"official_verify"`
					} `json:"card"`
					Vip struct {
						VipType       int    `json:"vipType"`
						VipDueDate    int    `json:"vipDueDate"`
						DueRemark     string `json:"dueRemark"`
						AccessStatus  int    `json:"accessStatus"`
						VipStatus     int    `json:"vipStatus"`
						VipStatusWarn string `json:"vipStatusWarn"`
						ThemeType     int    `json:"themeType"`
						Label         struct {
							Path string `json:"path"`
						} `json:"label"`
					} `json:"vip"`
					Pendant struct {
						Pid          int    `json:"pid"`
						Name         string `json:"name"`
						Image        string `json:"image"`
						Expire       int    `json:"expire"`
						ImageEnhance string `json:"image_enhance"`
					} `json:"pendant"`
					Rank      string `json:"rank"`
					Sign      string `json:"sign"`
					LevelInfo struct {
						CurrentLevel int    `json:"current_level"`
						CurrentMin   int    `json:"current_min"`
						CurrentExp   int    `json:"current_exp"`
						NextExp      string `json:"next_exp"`
					} `json:"level_info"`
				} `json:"user_profile"`
				UIDType      int    `json:"uid_type"`
				Stype        int    `json:"stype"`
				RType        int    `json:"r_type"`
				InnerID      int    `json:"inner_id"`
				Status       int    `json:"status"`
				DynamicIDStr string `json:"dynamic_id_str"`
				PreDyIDStr   string `json:"pre_dy_id_str"`
				OrigDyIDStr  string `json:"orig_dy_id_str"`
				RidStr       string `json:"rid_str"`
			} `json:"desc"`
			Card       string `json:"card"`
			ExtendJSON string `json:"extend_json"`
			Display    struct {
				TopicInfo struct {
					TopicDetails []struct {
						TopicID    int    `json:"topic_id"`
						TopicName  string `json:"topic_name"`
						IsActivity int    `json:"is_activity"`
						TopicLink  string `json:"topic_link"`
					} `json:"topic_details"`
				} `json:"topic_info"`
				Relation struct {
					Status     int `json:"status"`
					IsFollow   int `json:"is_follow"`
					IsFollowed int `json:"is_followed"`
				} `json:"relation"`
				ShowTip struct {
					DelTip string `json:"del_tip"`
				} `json:"show_tip"`
			} `json:"display"`
		} `json:"card"`
		Result int `json:"result"`
		Gt     int `json:"_gt_"`
	} `json:"data"`
}

DynamicSvr for bilibili author

func (DynamicSvr) GetUserAvatar

func (Data DynamicSvr) GetUserAvatar() string

GetUserAvatar Get bilibili user avatar

type Memberst

type Memberst struct {
	ID         int64
	VTName     string
	YtChannel  string
	SpaceID    int
	BiliAvatar string
	YtData     database.YtDbData
	SpaceData  database.SpaceBiliDB
	LiveData   database.LiveBiliDB
	Msg        string
	Msg1       string
	Msg2       string
	Msg3       string
	View       string
	Length     string
}

Memberst Vtuber member struct

func ValidName

func ValidName(Name string) Memberst

ValidName Find a valid name from user input

type NameStruct

type NameStruct struct {
	GroupName  string
	GroupID    int64
	MemberName string
	MemberID   int64
}

NameStruct struct

func FindName

func FindName(MemberName string) NameStruct

FindName Find a valid Vtuber name from message handler

Jump to

Keyboard shortcuts

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