Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta42 #146

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions handlers/get_group_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ type GroupList struct {

func getGroupList(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.OpenAPI, message callapi.ActionMessage) {
//群还不支持,这里取得是频道的,如果后期支持了群,那都请求,一起返回
var groupList GroupList
actiontype := "guild"
if actiontype == "guild" {
// 初始化 groupList.Data 为一个空数组
groupList.Data = []Group{}
// 检查时间差异
if time.Since(lastCallTime) > 5*time.Minute {
// 如果超过5分钟,则重置分页状态
Expand Down Expand Up @@ -126,12 +129,12 @@ func getGroupList(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Open
groups = append(groups, channelGroup)
}
}
groupList := GroupList{
Data: groups,
Message: "",
RetCode: 0,
Status: "ok",
}

groupList.Data = groups
groupList.Message = ""
groupList.RetCode = 0
groupList.Status = "ok"

if message.Echo == "" {
groupList.Echo = "0"
} else {
Expand Down
2 changes: 1 addition & 1 deletion sys/restart_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewRestarter() *UnixRestarter {
func (r *UnixRestarter) Restart(executableName string) error {
scriptContent := "#!/bin/sh\n" +
"sleep 1\n" + // Sleep for a bit to allow the main application to exit
"." + executableName + "\n"
"exec " + executableName + "\n"

scriptName := "restart.sh"
if err := os.WriteFile(scriptName, []byte(scriptContent), 0755); err != nil {
Expand Down
Loading