-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
266 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,131 @@ | ||
package config | ||
|
||
// GetConfig get current config | ||
func GetConfig() Config { | ||
return config | ||
} | ||
|
||
func GetApiId() string { | ||
// GetAPIID get API ID | ||
func GetAPIID() string { | ||
return config.ApiId | ||
} | ||
|
||
func GetApiHash() string { | ||
// GetAPIHash get API Hash | ||
func GetAPIHash() string { | ||
return config.ApiHash | ||
} | ||
|
||
// GetBotToken get bot token | ||
func GetBotToken() string { | ||
return config.BotToken | ||
} | ||
|
||
func GetChatId() int64 { | ||
// GetChatID get chat ID | ||
func GetChatID() int64 { | ||
return config.ChatId | ||
} | ||
|
||
func SetChatId(value int64) { | ||
// SetChatID update chat ID | ||
func SetChatID(value int64) { | ||
config.ChatId = value | ||
} | ||
|
||
// GetChatUsername get chat username | ||
func GetChatUsername() string { | ||
return config.ChatUsername | ||
} | ||
|
||
// GetPinnedMessage get pinned message ID | ||
func GetPinnedMessage() int64 { | ||
return config.PinnedMsg << 20 | ||
} | ||
|
||
// SetPinnedMessage update pinned message ID | ||
func SetPinnedMessage(value int64) { | ||
config.PinnedMsg = value >> 20 | ||
} | ||
|
||
// GetBeefWebPort get Beefweb port | ||
func GetBeefWebPort() int { | ||
return config.BeefWebPort | ||
return config.BeefwebPort | ||
} | ||
|
||
func GetPlaylistId() string { | ||
// GetPlaylistID get playlist ID | ||
func GetPlaylistID() string { | ||
return config.PlaylistId | ||
} | ||
|
||
// GetChatSelectLimit get select limit of group chat | ||
func GetChatSelectLimit() int { | ||
return config.LimitSetting.ChatSelectLimit | ||
} | ||
|
||
// GetPrivateChatSelectLimit get select limit of private chat | ||
func GetPrivateChatSelectLimit() int { | ||
return config.LimitSetting.PriSelectLimit | ||
} | ||
|
||
// GetRowLimit get row limit | ||
func GetRowLimit() int { | ||
return config.LimitSetting.RowLimit | ||
} | ||
|
||
// GetQueueLimit get queue song limit | ||
func GetQueueLimit() int { | ||
return config.LimitSetting.QueueLimit | ||
} | ||
|
||
// GetRecentLimit get recent song limit | ||
func GetRecentLimit() int { | ||
return config.LimitSetting.RecentLimit | ||
} | ||
|
||
// GetReqSongLimit get request song limit | ||
func GetReqSongLimit() int { | ||
return config.LimitSetting.ReqSongPerMin | ||
} | ||
|
||
// IsVoteEnabled return true if vote is enabled | ||
func IsVoteEnabled() bool { | ||
return config.VoteSetting.Enable | ||
} | ||
|
||
// GetSuccessRate get vote success rate | ||
func GetSuccessRate() float64 { | ||
return config.VoteSetting.PctOfSuccess | ||
} | ||
|
||
// IsPtcpsOnly return true if only participants which are in a voice chat can vote | ||
func IsPtcpsOnly() bool { | ||
return config.VoteSetting.PtcpsOnly | ||
} | ||
|
||
// GetVoteTime get vote time | ||
func GetVoteTime() int32 { | ||
return config.VoteSetting.VoteTime | ||
} | ||
|
||
// GetReleaseTime get lock the vote seconds after vote ended | ||
func GetReleaseTime() int64 { | ||
return config.VoteSetting.ReleaseTime | ||
} | ||
|
||
// GetUpdateTime get vote update time | ||
func GetUpdateTime() int32 { | ||
return config.VoteSetting.UpdateTime | ||
} | ||
|
||
// IsJoinNeeded return true if only users which are in the group can vote | ||
func IsJoinNeeded() bool { | ||
return config.VoteSetting.UserMustJoin | ||
} | ||
|
||
// IsWebEnabled return true if userbot mode is disabled | ||
func IsWebEnabled() bool { | ||
return config.WebSetting.Enable | ||
} | ||
|
||
// GetWebPort get web port | ||
func GetWebPort() int { | ||
return config.WebSetting.Port | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
package config | ||
|
||
// GetStatus get current status | ||
func GetStatus() Status { | ||
return status | ||
} | ||
|
||
// GetCurrent get current song | ||
func (s Status) GetCurrent() string { | ||
return s.Current | ||
} | ||
|
||
// SetCurrentSong set current song | ||
func SetCurrentSong(value string) { | ||
status.Current = value | ||
} | ||
|
||
// GetQueue get queue song list | ||
func (s Status) GetQueue() []int { | ||
return s.Queue | ||
} | ||
|
||
// SetQueueSong set queue song list | ||
func SetQueueSong(value []int) { | ||
status.Queue = value | ||
} | ||
|
||
// GetRecent get recent song list | ||
func (s Status) GetRecent() []int { | ||
return s.Recent | ||
} | ||
|
||
// SetRecentSong set recent song list | ||
func SetRecentSong(value []int) { | ||
status.Recent = value | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.