Skip to content

Commit

Permalink
fix: 🐛 event type use struct instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Aimerny committed May 31, 2024
1 parent 1fc0d1f commit bc42300
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 77 deletions.
3 changes: 1 addition & 2 deletions .release-please/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"app": "0.2.1",
".": "1.0.0"
"app": "1.0.0"
}
38 changes: 0 additions & 38 deletions app/common/config.go

This file was deleted.

27 changes: 0 additions & 27 deletions app/core/action/action_test.go

This file was deleted.

16 changes: 8 additions & 8 deletions app/core/model/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ const (
)

type UserExtra struct {
EventType int `json:"type" mapstructure:"event_type"`
GuildId string `json:"guild_id" mapstructure:"guild_id"`
ChannelName string `json:"channel_name" mapstructure:"channel_name"`
Mention []string `json:"mention" mapstructure:"mention"`
MentionAll bool `json:"mention_all" mapstructure:"mention_all"`
MentionRoles []any `json:"mention_roles" mapstructure:"mention_roles"`
MentionHere bool `json:"mention_here" mapstructure:"mention_here"`
Author User `json:"author" mapstructure:"author"`
EventType EventType `json:"type" mapstructure:"event_type"`
GuildId string `json:"guild_id" mapstructure:"guild_id"`
ChannelName string `json:"channel_name" mapstructure:"channel_name"`
Mention []string `json:"mention" mapstructure:"mention"`
MentionAll bool `json:"mention_all" mapstructure:"mention_all"`
MentionRoles []any `json:"mention_roles" mapstructure:"mention_roles"`
MentionHere bool `json:"mention_here" mapstructure:"mention_here"`
Author User `json:"author" mapstructure:"author"`
}

type SystemExtra struct {
Expand Down
3 changes: 1 addition & 2 deletions app/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import (
func main() {

common.InitLogger()
config := common.ReadConfig()

globalSession, err := session.CreateSession(config.BotToken, config.Compress)
globalSession, err := session.CreateSession("Your kook-go bot token", true)
if err != nil {
log.Errorf("%s", err)
}
Expand Down

0 comments on commit bc42300

Please sign in to comment.