Documentation ¶
Index ¶
- Variables
- func CheckChannelEnable(ChannelID, VtuberName string, GroupID int64) bool
- func CheckUser(DiscordID string, MemberID int64, ChannelChannelID int) bool
- func GetChannelID(DiscordChannelID string, GroupID int64) int
- func GetGuildsCount() int
- func GetModule() []string
- func GetRanChannel() string
- func GetTBiliBili(DynamicID string) bool
- func GetTwitch()
- func GetUserList(ChannelIDDiscord int64, Member int64) []string
- func GetUserReminderList(ChannelIDDiscord int, Member int64, Reminder int) []string
- func ModuleInfo(Name string)
- func SetRoomToLive(MemberID int64)
- func Start(dbsession *sql.DB)
- func UserStatus(UserID, Channel string) [][]string
- type DataFanart
- type DiscordChannel
- func (Data *DiscordChannel) AddChannel() error
- func (Data *DiscordChannel) ChannelCheck() bool
- func (Data *DiscordChannel) DelChannel(errmsg string) error
- func (ac DiscordChannel) MarshalBinary() ([]byte, error)
- func (Data *DiscordChannel) PushReddis()
- func (Data *DiscordChannel) SetDynamic(new bool) *DiscordChannel
- func (Data *DiscordChannel) SetLiveOnly(new bool) *DiscordChannel
- func (Data *DiscordChannel) SetMsgEmbedID(new string) *DiscordChannel
- func (Data *DiscordChannel) SetMsgTextID(new string) *DiscordChannel
- func (Data *DiscordChannel) SetNewUpcoming(new bool) *DiscordChannel
- func (Data *DiscordChannel) SetTypeTag(new int) *DiscordChannel
- func (Data *DiscordChannel) SetVtuberGroupID(new int64) *DiscordChannel
- func (Data *DiscordChannel) SetYoutubeVideoID(new string) *DiscordChannel
- func (Data *DiscordChannel) UpdateChannel(UpdateType string) error
- type Group
- type Guild
- type InputBiliBili
- type InputTBiliBili
- type InputTW
- type LiveBiliDB
- type Member
- func (Member Member) CheckMemberFanart(Data *twitterscraper.Result) (bool, error)
- func (Member Member) CheckYtVideo(VideoID string) (*YtDbData, error)
- func (Member Member) GetSubsCount() (*MemberSubs, error)
- func (Data Member) GetTwitterFollow() (twitterscraper.Profile, error)
- func (ac Member) MarshalBinary() ([]byte, error)
- type MemberSubs
- func (ac MemberSubs) MarshalBinary() ([]byte, error)
- func (Member *MemberSubs) UpBiliFollow(new int) *MemberSubs
- func (Member *MemberSubs) UpBiliVideo(new int) *MemberSubs
- func (Member *MemberSubs) UpBiliViews(new int) *MemberSubs
- func (Member *MemberSubs) UpYtSubs(new int) *MemberSubs
- func (Member *MemberSubs) UpYtVideo(new int) *MemberSubs
- func (Member *MemberSubs) UpYtViews(new int) *MemberSubs
- func (Member *MemberSubs) UpdateSubs(State string)
- func (Member *MemberSubs) UptwFollow(new int) *MemberSubs
- type SpaceBiliDB
- type TwitterUser
- type UserStruct
- func (Data UserStruct) Adduser(MemberID int64) error
- func (Data UserStruct) Deluser(MemberID int64) error
- func (Data *UserStruct) SetDiscordChannelID(new string) *UserStruct
- func (Data *UserStruct) SetDiscordID(new string) *UserStruct
- func (Data *UserStruct) SetDiscordUserName(new string) *UserStruct
- func (Data *UserStruct) SetGroupID(new int64) *UserStruct
- func (Data *UserStruct) SetHuman(new bool) *UserStruct
- func (Data *UserStruct) SetReminder(new int) *UserStruct
- func (Data UserStruct) UpdateReminder(MemberID int64) error
- type YtDbData
Constants ¶
This section is empty.
Variables ¶
var ( DB *sql.DB FanartCache *redis.Client LiveCache *redis.Client GeneralCache *redis.Client )
Public variable
Functions ¶
func CheckChannelEnable ¶
Check enable or disable discord channel from `tag,del` command
func GetChannelID ¶
GetChannelID Get Channel id from Discord ChannelID and VtuberGroupID
func GetGuildsCount ¶
func GetGuildsCount() int
func GetTBiliBili ¶
GetTBiliBili Check new post on TBiliBili
func GetUserList ¶
GetUserList GetUser tags
func GetUserReminderList ¶
get Reminder tags
func ModuleInfo ¶
func ModuleInfo(Name string)
func SetRoomToLive ¶
func SetRoomToLive(MemberID int64)
func UserStatus ¶
Get userinfo(tags) from discord channel
Types ¶
type DataFanart ¶
type DataFanart struct { ID int64 EnName string JpName string PermanentURL string Author string Photos []string Videos string Text string Likes int Dynamic_id string State string }
func GetFanart ¶
func GetFanart(GroupID, MemberID int64) DataFanart
GetFanart Get Member fanart URL from TBiliBili and Twitter
func (DataFanart) DeleteFanart ¶
func (Data DataFanart) DeleteFanart() error
type DiscordChannel ¶
type DiscordChannel struct { ID int64 ChannelID string TypeTag int LiveOnly bool NewUpcoming bool Dynamic bool Group Group YoutubeVideoID string EmbedMessageID string TextMessageID string }
func ChannelStatus ¶
func ChannelStatus(ChannelID string) []DiscordChannel
Get Discord channel status
func ChannelTag ¶
func ChannelTag(MemberID int64, typetag int, Options string) []DiscordChannel
ChannelTag get channel tags from `channel tags` command
func GetLiveNotifMsg ¶
func GetLiveNotifMsg(Key string) []DiscordChannel
func (*DiscordChannel) AddChannel ¶
func (Data *DiscordChannel) AddChannel() error
Add new discord channel from `enable` command
func (*DiscordChannel) ChannelCheck ¶
func (Data *DiscordChannel) ChannelCheck() bool
Check Discord Channel from VtuberGroup
func (*DiscordChannel) DelChannel ¶
func (Data *DiscordChannel) DelChannel(errmsg string) error
delete discord channel from `disable` command
func (DiscordChannel) MarshalBinary ¶
func (ac DiscordChannel) MarshalBinary() ([]byte, error)
func (*DiscordChannel) PushReddis ¶
func (Data *DiscordChannel) PushReddis()
func (*DiscordChannel) SetDynamic ¶
func (Data *DiscordChannel) SetDynamic(new bool) *DiscordChannel
func (*DiscordChannel) SetLiveOnly ¶
func (Data *DiscordChannel) SetLiveOnly(new bool) *DiscordChannel
func (*DiscordChannel) SetMsgEmbedID ¶
func (Data *DiscordChannel) SetMsgEmbedID(new string) *DiscordChannel
func (*DiscordChannel) SetMsgTextID ¶
func (Data *DiscordChannel) SetMsgTextID(new string) *DiscordChannel
func (*DiscordChannel) SetNewUpcoming ¶
func (Data *DiscordChannel) SetNewUpcoming(new bool) *DiscordChannel
func (*DiscordChannel) SetTypeTag ¶
func (Data *DiscordChannel) SetTypeTag(new int) *DiscordChannel
func (*DiscordChannel) SetVtuberGroupID ¶
func (Data *DiscordChannel) SetVtuberGroupID(new int64) *DiscordChannel
func (*DiscordChannel) SetYoutubeVideoID ¶
func (Data *DiscordChannel) SetYoutubeVideoID(new string) *DiscordChannel
func (*DiscordChannel) UpdateChannel ¶
func (Data *DiscordChannel) UpdateChannel(UpdateType string) error
update discord channel type from `update` command
type Group ¶
func (Group) GetChannelByGroup ¶
func (Data Group) GetChannelByGroup() []DiscordChannel
Get DiscordChannelID from VtuberGroup
type InputBiliBili ¶
type InputBiliBili struct { VideoID string Type string Title string Thum string Desc string Update time.Time Viewers int MemberID int64 Length string }
func (InputBiliBili) CheckVideo ¶
func (Data InputBiliBili) CheckVideo() (bool, int)
CheckVideo Check New video from SpaceBiliBili
func (InputBiliBili) InputSpaceVideo ¶
func (Data InputBiliBili) InputSpaceVideo()
InputSpaceVideo Input data to SpaceBiliBili
func (InputBiliBili) UpdateView ¶
func (Data InputBiliBili) UpdateView(id int)
UpdateView Update SpaceBiliBili data
type InputTBiliBili ¶
type InputTBiliBili struct { URL string Author string Avatar string Like int Photos string Videos string Text string Dynamic_id string }
func (InputTBiliBili) InputTBiliBili ¶
func (Data InputTBiliBili) InputTBiliBili(MemberID int64)
InputTBiliBili Input TBiliBili data
type LiveBiliDB ¶
type LiveBiliDB struct {
LiveRoomID, Online, ID int
Status, Title, Thumbnail, Description, EnName, JpName, Avatar string
ScheduledStart, PublishedAt time.Time
}
func BilGet ¶
func BilGet(GroupID int64, MemberID int64, Status string) []LiveBiliDB
BilGet Get LiveBiliBili by Status (live,past)
func GetRoomData ¶
func GetRoomData(MemberID int64, RoomID int) (*LiveBiliDB, error)
GetRoomData get RoomData from LiveBiliBili
func (*LiveBiliDB) UpdateLiveBili ¶
func (Data *LiveBiliDB) UpdateLiveBili(MemberID int64)
UpdateLiveBili Update LiveBiliBili Data
type Member ¶
type Member struct { ID int64 Name string EnName string JpName string YoutubeID string YoutubeAvatar string BiliBiliID int BiliRoomID int TwitterName string BiliBiliAvatar string TwitchUserName string Region string GroupID int64 }
func (Member) CheckMemberFanart ¶
func (Member Member) CheckMemberFanart(Data *twitterscraper.Result) (bool, error)
func (Member) CheckYtVideo ¶
Check new video or not
func (Member) GetSubsCount ¶
func (Member Member) GetSubsCount() (*MemberSubs, error)
GetSubsCount Get subs,follow,view,like data from Subscriber
func (Member) GetTwitterFollow ¶
func (Data Member) GetTwitterFollow() (twitterscraper.Profile, error)
Scrapping twitter followers
func (Member) MarshalBinary ¶
type MemberSubs ¶
type MemberSubs struct {
YtSubs, YtVideos, YtViews int
BiliFollow, BiliVideos, BiliViews int
ID, TwFollow int
MemberID int64
}
func (MemberSubs) MarshalBinary ¶
func (ac MemberSubs) MarshalBinary() ([]byte, error)
func (*MemberSubs) UpBiliFollow ¶
func (Member *MemberSubs) UpBiliFollow(new int) *MemberSubs
UpBiliFollow update bilibili state
func (*MemberSubs) UpBiliVideo ¶
func (Member *MemberSubs) UpBiliVideo(new int) *MemberSubs
UpBiliVideo Add bilibili Videos
func (*MemberSubs) UpBiliViews ¶
func (Member *MemberSubs) UpBiliViews(new int) *MemberSubs
UpBiliViews Add views
func (*MemberSubs) UpYtSubs ¶
func (Member *MemberSubs) UpYtSubs(new int) *MemberSubs
UpYtSubs update youtube state
func (*MemberSubs) UpYtVideo ¶
func (Member *MemberSubs) UpYtVideo(new int) *MemberSubs
UpYtVideo Update youtube videos
func (*MemberSubs) UpYtViews ¶
func (Member *MemberSubs) UpYtViews(new int) *MemberSubs
UpYtViews Update youtube views
func (*MemberSubs) UpdateSubs ¶
func (Member *MemberSubs) UpdateSubs(State string)
UpdateSubs Update Subscriber data
func (*MemberSubs) UptwFollow ¶
func (Member *MemberSubs) UptwFollow(new int) *MemberSubs
UptwFollow Update twitter state
type SpaceBiliDB ¶
type SpaceBiliDB struct { Viewers int VideoID, Title, Thumbnail, Description, EnName, JpName, Avatar, Type, Length string UploadDate time.Time }
func SpaceGet ¶
func SpaceGet(GroupID int64, MemberID int64) []SpaceBiliDB
SpaceGet Get SpaceBiliBili Data
type TwitterUser ¶
type TwitterUser struct { ID int `json:"id"` IDStr string `json:"id_str"` Name string `json:"name"` ScreenName string `json:"screen_name"` Location string `json:"location"` ProfileLocation interface{} `json:"profile_location"` Description string `json:"description"` URL string `json:"url"` Entities struct { URL struct { Urls []struct { URL string `json:"url"` ExpandedURL string `json:"expanded_url"` DisplayURL string `json:"display_url"` Indices []int `json:"indices"` } `json:"urls"` } `json:"url"` Description struct { Urls []struct { URL string `json:"url"` ExpandedURL string `json:"expanded_url"` DisplayURL string `json:"display_url"` Indices []int `json:"indices"` } `json:"urls"` } `json:"description"` } `json:"entities"` Protected bool `json:"protected"` FollowersCount int `json:"followers_count"` FriendsCount int `json:"friends_count"` ListedCount int `json:"listed_count"` CreatedAt string `json:"created_at"` FavouritesCount int `json:"favourites_count"` UtcOffset interface{} `json:"utc_offset"` TimeZone interface{} `json:"time_zone"` GeoEnabled bool `json:"geo_enabled"` Verified bool `json:"verified"` StatusesCount int `json:"statuses_count"` Lang interface{} `json:"lang"` Status struct { CreatedAt string `json:"created_at"` ID int64 `json:"id"` IDStr string `json:"id_str"` Text string `json:"text"` Truncated bool `json:"truncated"` Entities struct { Hashtags []interface{} `json:"hashtags"` Symbols []interface{} `json:"symbols"` UserMentions []struct { ScreenName string `json:"screen_name"` Name string `json:"name"` ID int `json:"id"` IDStr string `json:"id_str"` Indices []int `json:"indices"` } `json:"user_mentions"` Urls []interface{} `json:"urls"` } `json:"entities"` Source string `json:"source"` InReplyToStatusID int64 `json:"in_reply_to_status_id"` InReplyToStatusIDStr string `json:"in_reply_to_status_id_str"` InReplyToUserID int `json:"in_reply_to_user_id"` InReplyToUserIDStr string `json:"in_reply_to_user_id_str"` InReplyToScreenName string `json:"in_reply_to_screen_name"` Geo interface{} `json:"geo"` Coordinates interface{} `json:"coordinates"` Place interface{} `json:"place"` Contributors interface{} `json:"contributors"` IsQuoteStatus bool `json:"is_quote_status"` RetweetCount int `json:"retweet_count"` FavoriteCount int `json:"favorite_count"` Favorited bool `json:"favorited"` Retweeted bool `json:"retweeted"` Lang string `json:"lang"` } `json:"status"` ContributorsEnabled bool `json:"contributors_enabled"` IsTranslator bool `json:"is_translator"` IsTranslationEnabled bool `json:"is_translation_enabled"` ProfileBackgroundColor string `json:"profile_background_color"` ProfileBackgroundImageURL string `json:"profile_background_image_url"` ProfileBackgroundImageURLHTTPS string `json:"profile_background_image_url_https"` ProfileBackgroundTile bool `json:"profile_background_tile"` ProfileImageURL string `json:"profile_image_url"` ProfileImageURLHTTPS string `json:"profile_image_url_https"` ProfileBannerURL string `json:"profile_banner_url"` ProfileLinkColor string `json:"profile_link_color"` ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` ProfileTextColor string `json:"profile_text_color"` ProfileUseBackgroundImage bool `json:"profile_use_background_image"` HasExtendedProfile bool `json:"has_extended_profile"` DefaultProfile bool `json:"default_profile"` DefaultProfileImage bool `json:"default_profile_image"` Following bool `json:"following"` FollowRequestSent bool `json:"follow_request_sent"` Notifications bool `json:"notifications"` TranslatorType string `json:"translator_type"` }
type UserStruct ¶
type UserStruct struct {
DiscordID, DiscordUserName, Channel_ID string
GroupID int64
Reminder int
Human bool
}
func (UserStruct) Adduser ¶
func (Data UserStruct) Adduser(MemberID int64) error
Adduser form `tag me command`
func (UserStruct) Deluser ¶
func (Data UserStruct) Deluser(MemberID int64) error
Deluser Delete user from `del` command
func (*UserStruct) SetDiscordChannelID ¶
func (Data *UserStruct) SetDiscordChannelID(new string) *UserStruct
func (*UserStruct) SetDiscordID ¶
func (Data *UserStruct) SetDiscordID(new string) *UserStruct
func (*UserStruct) SetDiscordUserName ¶
func (Data *UserStruct) SetDiscordUserName(new string) *UserStruct
func (*UserStruct) SetGroupID ¶
func (Data *UserStruct) SetGroupID(new int64) *UserStruct
func (*UserStruct) SetHuman ¶
func (Data *UserStruct) SetHuman(new bool) *UserStruct
func (*UserStruct) SetReminder ¶
func (Data *UserStruct) SetReminder(new int) *UserStruct
func (UserStruct) UpdateReminder ¶
func (Data UserStruct) UpdateReminder(MemberID int64) error
UpdateReminder Update reminder time
type YtDbData ¶
type YtDbData struct { ID int64 ChannelID string Group string Status string NameEN string NameJP string VideoID string Title string Thumb string Desc string YoutubeAvatar string Schedul time.Time End time.Time Published time.Time Type string Region string Viewers string Length string MemberID int64 GroupID int64 }
func YtGetStatus ¶
Get Youtube data from status