Initial commit
This commit is contained in:
72
Makefile
72
Makefile
@@ -2,18 +2,82 @@
|
|||||||
|
|
||||||
GOOPTS=CGO_ENABLED=0
|
GOOPTS=CGO_ENABLED=0
|
||||||
BUILDOPTS=-ldflags="-s -w" -a -gcflags=all=-l -trimpath -buildvcs=false
|
BUILDOPTS=-ldflags="-s -w" -a -gcflags=all=-l -trimpath -buildvcs=false
|
||||||
|
MYNAME=bunny-bot
|
||||||
|
BINARY=$MYNAME
|
||||||
|
RMCMD=rm -rf
|
||||||
|
|
||||||
|
# На windows имя бинарника может зависеть не только от платформы, но и от выбранной цели, для linux-а суффикс .exe
|
||||||
|
# не нужен
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
ifdef GOOS
|
||||||
|
ifeq ($(GOOS),windows)
|
||||||
|
BINARY=${MYNAME}.exe
|
||||||
|
else # not ifeq ($(GOOS),windows)
|
||||||
|
BINARY=${MYNAME}
|
||||||
|
endif # ifeq ($(GOOS),windows)
|
||||||
|
else # not ifdef GOOS
|
||||||
|
BINARY=${MYNAME}.exe
|
||||||
|
endif # ifdef GOOS
|
||||||
|
ifeq ($(SHELL), sh.exe)
|
||||||
|
RMCMD=DEL /Q /F
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Явно определяем символ новой строки, чтобы избежать неоднозначности на windows
|
||||||
|
define IFS
|
||||||
|
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
all: clean build
|
all: clean build
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
${GOOPTS} go build ${BUILDOPTS} -o bunny-bot ./cmd/bunny-bot
|
ifeq ($(OS),Windows_NT)
|
||||||
|
# Looks like on windows gnu make explicitly set SHELL to sh.exe, if it was not set.
|
||||||
|
ifeq ($(SHELL), sh.exe)
|
||||||
|
# # Vanilla cmd.exe / powershell.
|
||||||
|
SET "CGO_ENABLED=0"
|
||||||
|
go build ${BUILDOPTS} -o ${BINARY} ./cmd/${MYNAME}
|
||||||
|
else ifeq (,$(findstring(Git/usr/bin/sh.exe, $(SHELL))))
|
||||||
|
# # git-bash
|
||||||
|
CGO_ENABLED=0 go build ${BUILDOPTS} -o ${BINARY} ./cmd/${MYNAME}
|
||||||
|
else # not ifeq (,$(findstring(Git/usr/bin/sh.exe, $(SHELL))))
|
||||||
|
# # Some other shell.
|
||||||
|
# # TODO: handle it.
|
||||||
|
$(info "-- Dunno how to handle this ${SHELL}")
|
||||||
|
endif # ifeq (,$(findstring(Git/usr/bin/sh.exe, $(SHELL))))
|
||||||
|
else # not ($(OS),Windows_NT)
|
||||||
|
CGO_ENABLED=0 go build ${BUILDOPTS} -o ${BINARY} ./cmd/${MYNAME}
|
||||||
|
endif # ifeq ($(OS),Windows_NT)
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf bunny-bot
|
ifeq ($(OS),Windows_NT)
|
||||||
|
ifeq ($(SHELL),sh.exe)
|
||||||
|
# # Vanilla cmd.exe / powershell.
|
||||||
|
if exist ${BINARY} ${RMCMD} ${BINARY}
|
||||||
|
else # not ifeq ($(SHELL),sh.exe)
|
||||||
|
${RMCMD} ./${BINARY}
|
||||||
|
endif # ifeq ($(SHELL),sh.exe)
|
||||||
|
else # not ifeq ($(OS),Windows_NT)
|
||||||
|
${RMCMD} ./${BINARY}
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
upgrade:
|
upgrade:
|
||||||
rm -rf vendor
|
ifeq ($(OS),Windows_NT)
|
||||||
go get -u -t -tool ./...
|
ifeq ($(SHELL),sh.exe)
|
||||||
|
# # Vanilla cmd.exe / powershell.
|
||||||
|
if exist vendor DEL /F /S /Q vendor >nul
|
||||||
|
else # not ifeq ($(SHELL),sh.exe)
|
||||||
|
# # git-bash
|
||||||
|
$(RM) -r vendor
|
||||||
|
endif # ifeq ($(SHELL),sh.exe)
|
||||||
|
else # not ifeq ($(OS),Windows_NT)
|
||||||
|
$(RM) -r vendor
|
||||||
|
endif
|
||||||
|
go get -d -u ./...
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go mod vendor
|
go mod vendor
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ import (
|
|||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: use https://dev.to/gholami1313/saving-log-messages-to-a-custom-log-file-in-golang-ce5 for
|
||||||
|
//
|
||||||
|
// chat messages.
|
||||||
func main() {
|
func main() {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
"name": "Bunny",
|
"name": "Bunny",
|
||||||
"token": "get_it_from_botfather",
|
"token": "get_it_from_botfather",
|
||||||
"loglevel": "debug",
|
"loglevel": "debug",
|
||||||
"logfile": "bunny-bot.log",
|
"logfile": "bunny-bot.log",
|
||||||
|
"logchats": false,
|
||||||
"csign": ".",
|
"csign": ".",
|
||||||
"datadir": "data"
|
"datadir": "data"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ package moon
|
|||||||
import "github.com/NicoNex/echotron/v3"
|
import "github.com/NicoNex/echotron/v3"
|
||||||
|
|
||||||
func animation(msg *echotron.Update) {
|
func animation(msg *echotron.Update) {
|
||||||
Log.Infof(
|
if Cfg.LogChats {
|
||||||
"User %s %s (username = %s, id = %d) sent animation to chat %s %s (%d)",
|
Log.Infof(
|
||||||
msg.Message.From.FirstName,
|
"User %s %s (username = %s, id = %d) sent animation to chat %s %s (%d)",
|
||||||
msg.Message.From.LastName,
|
msg.Message.From.FirstName,
|
||||||
msg.Message.From.Username,
|
msg.Message.From.LastName,
|
||||||
msg.Message.From.ID,
|
msg.Message.From.Username,
|
||||||
msg.Message.Chat.Type,
|
msg.Message.From.ID,
|
||||||
msg.Message.Chat.Title,
|
msg.Message.Chat.Type,
|
||||||
msg.Message.Chat.ID,
|
msg.Message.Chat.Title,
|
||||||
)
|
msg.Message.Chat.ID,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
|
|||||||
@@ -93,3 +93,5 @@ func CasCheckID(id int64) (bool, error) {
|
|||||||
|
|
||||||
return result, fmt.Errorf("unable to parse response from api.cas.chat: %s", string(body)) //nolint: err113
|
return result, fmt.Errorf("unable to parse response from api.cas.chat: %s", string(body)) //nolint: err113
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ func newChatMember(msg *echotron.Update) {
|
|||||||
msg.ChatMember.Chat.ID,
|
msg.ChatMember.Chat.ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
NewMembers[msg.Message.Chat.ID] = cache.New(1 * time.Minute)
|
NewMembers[msg.ChatMember.Chat.ID] = cache.New(1 * time.Minute)
|
||||||
AppearedMembers[msg.Message.Chat.ID] = cache.New(1 * time.Minute)
|
AppearedMembers[msg.ChatMember.Chat.ID] = cache.New(1 * time.Minute)
|
||||||
SquashedMembers[msg.Message.Chat.ID] = cache.New(60 * time.Minute)
|
SquashedMembers[msg.ChatMember.Chat.ID] = cache.New(60 * time.Minute)
|
||||||
|
|
||||||
Log.Debugf(
|
Log.Debugf(
|
||||||
"Add %s %s (%d) to list of known chats",
|
"Add %s %s (%d) to list of known chats",
|
||||||
|
|||||||
45
internal/moon/chatlog.go
Normal file
45
internal/moon/chatlog.go
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package moon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ChatLog(file, text string) {
|
||||||
|
var (
|
||||||
|
isOpened = false
|
||||||
|
)
|
||||||
|
|
||||||
|
for _, l := range chatlogs {
|
||||||
|
if l.Name == file {
|
||||||
|
isOpened = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !isOpened {
|
||||||
|
// open log file
|
||||||
|
logFile, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE, 0644)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Unable to open log file %s: %s", file, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
l := Chatlog{Name: file, File: logFile}
|
||||||
|
|
||||||
|
chatlogs = append(chatlogs, l)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, l := range chatlogs {
|
||||||
|
if l.Name == file {
|
||||||
|
log.SetOutput(l.File)
|
||||||
|
// optional: log date-time, filename, and line number
|
||||||
|
log.SetFlags(log.Lshortfile | log.LstdFlags)
|
||||||
|
log.Println(text)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
@@ -28,6 +28,8 @@ var (
|
|||||||
AppearedMembers map[int64]*cache.Cache
|
AppearedMembers map[int64]*cache.Cache
|
||||||
|
|
||||||
ChatList = make([]int64, 0)
|
ChatList = make([]int64, 0)
|
||||||
|
|
||||||
|
chatlogs []Chatlog
|
||||||
)
|
)
|
||||||
|
|
||||||
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ func leftChatMember(msg *echotron.Update) {
|
|||||||
msg.Message.Chat.ID,
|
msg.Message.Chat.ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Save people that left chat to pebbledb. To preserve their state.
|
||||||
|
// TODO: Remove items on chatMemberUpdated event.
|
||||||
if err := Cfg.SaveKeyValue(
|
if err := Cfg.SaveKeyValue(
|
||||||
"LeftMembers",
|
"LeftMembers",
|
||||||
fmt.Sprintf("%d", msg.Message.Chat.ID),
|
fmt.Sprintf("%d", msg.Message.Chat.ID),
|
||||||
|
|||||||
36
internal/moon/photo.go
Normal file
36
internal/moon/photo.go
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package moon
|
||||||
|
|
||||||
|
import "github.com/NicoNex/echotron/v3"
|
||||||
|
|
||||||
|
func photo(msg *echotron.Update) {
|
||||||
|
if Cfg.LogChats {
|
||||||
|
if msg.Message.Text != "" {
|
||||||
|
Log.Infof(
|
||||||
|
"User %s %s (username = %s, id = %d) sent %d photos to %s %s (%d) with text: %s",
|
||||||
|
msg.Message.From.FirstName,
|
||||||
|
msg.Message.From.LastName,
|
||||||
|
msg.Message.From.Username,
|
||||||
|
msg.Message.From.ID,
|
||||||
|
len(msg.Message.Photo),
|
||||||
|
msg.Message.Chat.Type,
|
||||||
|
msg.Message.Chat.Title,
|
||||||
|
msg.Message.Chat.ID,
|
||||||
|
msg.Message.Text,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Log.Infof(
|
||||||
|
"User %s %s (username = %s, id = %d) sent %d photos to %s %s (%d)",
|
||||||
|
msg.Message.From.FirstName,
|
||||||
|
msg.Message.From.LastName,
|
||||||
|
msg.Message.From.Username,
|
||||||
|
msg.Message.From.ID,
|
||||||
|
len(msg.Message.Photo),
|
||||||
|
msg.Message.Chat.Type,
|
||||||
|
msg.Message.Chat.Title,
|
||||||
|
msg.Message.Chat.ID,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
53
internal/moon/reaction.go
Normal file
53
internal/moon/reaction.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package moon
|
||||||
|
|
||||||
|
import "github.com/NicoNex/echotron/v3"
|
||||||
|
|
||||||
|
func reaction(msg *echotron.Update) {
|
||||||
|
if Cfg.LogChats {
|
||||||
|
var reactionString string
|
||||||
|
|
||||||
|
for _, item := range msg.MessageReaction.NewReaction {
|
||||||
|
if item.Type == "Emoji" {
|
||||||
|
reactionString += item.Emoji
|
||||||
|
} else if item.Type == "CustomEmoji" {
|
||||||
|
reactionString += item.CustomEmoji
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if reactionString != "" {
|
||||||
|
Log.Infof(
|
||||||
|
"User %s %s (username = %s, id = %d) set reaction %s to chat %s %s (%d)",
|
||||||
|
msg.MessageReaction.User.FirstName,
|
||||||
|
msg.MessageReaction.User.LastName,
|
||||||
|
msg.MessageReaction.User.Username,
|
||||||
|
msg.MessageReaction.User.ID,
|
||||||
|
reactionString,
|
||||||
|
msg.MessageReaction.Chat.Type,
|
||||||
|
msg.MessageReaction.Chat.Title,
|
||||||
|
msg.MessageReaction.Chat.ID,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
for _, item := range msg.MessageReaction.OldReaction {
|
||||||
|
if item.Type == "Emoji" {
|
||||||
|
reactionString += item.Emoji
|
||||||
|
} else if item.Type == "CustomEmoji" {
|
||||||
|
reactionString += item.CustomEmoji
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.Infof(
|
||||||
|
"User %s %s (username = %s, id = %d) removed reaction %s to chat %s %s (%d)",
|
||||||
|
msg.MessageReaction.User.FirstName,
|
||||||
|
msg.MessageReaction.User.LastName,
|
||||||
|
msg.MessageReaction.User.Username,
|
||||||
|
msg.MessageReaction.User.ID,
|
||||||
|
reactionString,
|
||||||
|
msg.MessageReaction.Chat.Type,
|
||||||
|
msg.MessageReaction.Chat.Title,
|
||||||
|
msg.MessageReaction.Chat.ID,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
18
internal/moon/reactionCount.go
Normal file
18
internal/moon/reactionCount.go
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package moon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/NicoNex/echotron/v3"
|
||||||
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
)
|
||||||
|
|
||||||
|
func reactionCount(msg *echotron.Update) {
|
||||||
|
Log.Infof(
|
||||||
|
"Reaction count event in %s %s (%d): %",
|
||||||
|
msg.MessageReaction.Chat.Type,
|
||||||
|
msg.MessageReaction.Chat.Title,
|
||||||
|
msg.MessageReaction.Chat.ID,
|
||||||
|
spew.Sdump(msg),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
@@ -91,3 +91,5 @@ func squash(chatid int64, chattype, chattitle string, userid int64, firstname, l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
|
|||||||
@@ -72,6 +72,24 @@ func telegramMsgParser(msg *echotron.Update) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if msg.MessageReaction != nil {
|
||||||
|
reaction(msg)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.MessageReactionCount != nil {
|
||||||
|
reactionCount(msg)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.Message != nil && msg.Message.Photo != nil {
|
||||||
|
photo(msg)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
Log.Debug(spew.Sdump(msg))
|
Log.Debug(spew.Sdump(msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,42 @@
|
|||||||
package moon
|
package moon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/NicoNex/echotron/v3"
|
"github.com/NicoNex/echotron/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func textMessage(msg *echotron.Update) {
|
func textMessage(msg *echotron.Update) {
|
||||||
if msg.Message.ReplyToMessage == nil {
|
if Cfg.LogChats {
|
||||||
// Just log it, it seems later here should be ban/mute command set.
|
if msg.Message.ReplyToMessage == nil {
|
||||||
Log.Infof(
|
// Just log it, it seems later here should be ban/mute command set.
|
||||||
"User %s %s (username = %s, id = %d) in %s %s (%d) says: %s",
|
Log.Infof(
|
||||||
msg.Message.From.FirstName,
|
"User %s %s (username = %s, id = %d) in %s %s (%d) says: %s",
|
||||||
msg.Message.From.LastName,
|
msg.Message.From.FirstName,
|
||||||
msg.Message.From.Username,
|
msg.Message.From.LastName,
|
||||||
msg.Message.From.ID,
|
msg.Message.From.Username,
|
||||||
msg.Message.Chat.Type,
|
msg.Message.From.ID,
|
||||||
msg.Message.Chat.Title,
|
msg.Message.Chat.Type,
|
||||||
msg.Message.Chat.ID,
|
msg.Message.Chat.Title,
|
||||||
msg.Message.Text,
|
msg.Message.Chat.ID,
|
||||||
)
|
msg.Message.Text,
|
||||||
} else {
|
)
|
||||||
// Just log it.
|
|
||||||
Log.Infof(
|
|
||||||
"User %s %s (username = %s, id = %d) in %s %s (%d) replies to message %d by %s %s (username = %s, id = %d): %s",
|
|
||||||
msg.Message.From.FirstName,
|
|
||||||
msg.Message.From.LastName,
|
|
||||||
msg.Message.From.Username,
|
|
||||||
msg.Message.From.ID,
|
|
||||||
msg.Message.Chat.Type,
|
|
||||||
msg.Message.Chat.Title,
|
|
||||||
msg.Message.Chat.ID,
|
|
||||||
msg.Message.ReplyToMessage.ID,
|
|
||||||
msg.Message.ReplyToMessage.From.FirstName,
|
|
||||||
msg.Message.ReplyToMessage.From.LastName,
|
|
||||||
msg.Message.ReplyToMessage.From.Username,
|
|
||||||
msg.Message.ReplyToMessage.From.ID,
|
|
||||||
msg.Message.Text,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update database of new members :)
|
|
||||||
// Try to get timestamp when this member joined to chat
|
|
||||||
if joinTimestampString := Cfg.GetValue(
|
|
||||||
"NewMembers",
|
|
||||||
fmt.Sprintf("%d", msg.Message.Chat.ID),
|
|
||||||
fmt.Sprintf("%d", msg.Message.From.ID),
|
|
||||||
); joinTimestampString == "" {
|
|
||||||
if err := Cfg.SaveKeyValue(
|
|
||||||
"NewMembers",
|
|
||||||
fmt.Sprintf("%d", msg.Message.Chat.ID),
|
|
||||||
fmt.Sprintf("%d", msg.Message.From.ID),
|
|
||||||
fmt.Sprintf("%d", time.Now().Unix()),
|
|
||||||
); err != nil {
|
|
||||||
Log.Error(err)
|
|
||||||
} else {
|
} else {
|
||||||
Log.Infof("Info about new userid %d saved to new users db", msg.Message.From.ID)
|
// Just log it.
|
||||||
|
Log.Infof(
|
||||||
|
"User %s %s (username = %s, id = %d) in %s %s (%d) replies to message %d by %s %s (username = %s, id = %d): %s",
|
||||||
|
msg.Message.From.FirstName,
|
||||||
|
msg.Message.From.LastName,
|
||||||
|
msg.Message.From.Username,
|
||||||
|
msg.Message.From.ID,
|
||||||
|
msg.Message.Chat.Type,
|
||||||
|
msg.Message.Chat.Title,
|
||||||
|
msg.Message.Chat.ID,
|
||||||
|
msg.Message.ReplyToMessage.ID,
|
||||||
|
msg.Message.ReplyToMessage.From.FirstName,
|
||||||
|
msg.Message.ReplyToMessage.From.LastName,
|
||||||
|
msg.Message.ReplyToMessage.From.Username,
|
||||||
|
msg.Message.ReplyToMessage.From.ID,
|
||||||
|
msg.Message.Text,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package moon
|
package moon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ type MyConfig struct {
|
|||||||
Token string `json:"token,omitempty"`
|
Token string `json:"token,omitempty"`
|
||||||
LogLevel string `json:"loglevel,omitempty"`
|
LogLevel string `json:"loglevel,omitempty"`
|
||||||
LogFile string `json:"logfile,omitempty"`
|
LogFile string `json:"logfile,omitempty"`
|
||||||
|
LogChats bool `json:"logchats,omitempty"`
|
||||||
CSign string `json:"csign,omitempty"`
|
CSign string `json:"csign,omitempty"`
|
||||||
DataDir string `json:"datadir,omitempty"`
|
DataDir string `json:"datadir,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -30,4 +32,9 @@ type CasTrue struct {
|
|||||||
} `json:"result"`
|
} `json:"result"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Chatlog struct {
|
||||||
|
Name string
|
||||||
|
File *os.File
|
||||||
|
}
|
||||||
|
|
||||||
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||||
|
|||||||
Reference in New Issue
Block a user