From a51b5ef9eabc2a1d11d2181288168caa295604bb Mon Sep 17 00:00:00 2001 From: Fl_GUI Date: Sat, 18 May 2024 17:22:27 +0200 Subject: [PATCH] rename module to include fl-gui.name --- go.mod | 4 +- twitch/core/auth.go | 7 ++-- twitch/core/capabilities.go | 3 +- twitch/core/clearchat/message.go | 3 +- twitch/core/clearmsg/message.go | 3 +- twitch/core/connection.go | 5 ++- twitch/core/globaluserstate/message.go | 2 +- twitch/core/hosttarget/message.go | 3 +- twitch/core/join.go | 5 ++- twitch/core/messages/auth.go | 5 ++- twitch/core/messages/capability.go | 4 +- twitch/core/messages/join.go | 5 ++- twitch/core/messages/messages.go | 2 +- twitch/core/messages/ping.go | 4 +- twitch/core/notice/message.go | 3 +- twitch/core/pingpong.go | 2 +- twitch/core/privmsg/message.go | 3 +- twitch/core/reconnect/message.go | 2 +- twitch/core/roomstate/message.go | 2 +- twitch/core/usernotice/message.go | 3 +- twitch/core/userstate/message.go | 2 +- twitch/core/whisper/message.go | 3 +- x/corechatclient/main.go | 7 ++-- x/generate/message/clearchat/message.go | 54 ------------------------- x/generate/message/generateMessage.go | 3 +- x/generate/message/main.go | 3 +- 26 files changed, 52 insertions(+), 90 deletions(-) delete mode 100644 x/generate/message/clearchat/message.go diff --git a/go.mod b/go.mod index 667ca6e..3e46365 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module twitchchat +module fl-gui.name/twitchchat go 1.22.3 -require golang.org/x/net v0.25.0 // indirect +require golang.org/x/net v0.25.0 diff --git a/twitch/core/auth.go b/twitch/core/auth.go index edde3ff..22b238b 100644 --- a/twitch/core/auth.go +++ b/twitch/core/auth.go @@ -2,9 +2,10 @@ package core import ( "errors" - "twitchchat/twitch/core/commands" - "twitchchat/twitch/core/messages" - "twitchchat/twitch/core/notice" + + "fl-gui.name/twitchchat/twitch/core/commands" + "fl-gui.name/twitchchat/twitch/core/messages" + "fl-gui.name/twitchchat/twitch/core/notice" ) // see https://dev.twitch.tv/docs/irc/authenticate-bot/#sending-the-pass-and-nick-messages. diff --git a/twitch/core/capabilities.go b/twitch/core/capabilities.go index 4d9b6b5..50d259c 100644 --- a/twitch/core/capabilities.go +++ b/twitch/core/capabilities.go @@ -3,7 +3,8 @@ package core import ( "fmt" "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) const ( diff --git a/twitch/core/clearchat/message.go b/twitch/core/clearchat/message.go index 1aac42c..37324ac 100644 --- a/twitch/core/clearchat/message.go +++ b/twitch/core/clearchat/message.go @@ -4,7 +4,8 @@ package clearchat import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Clearchat struct { diff --git a/twitch/core/clearmsg/message.go b/twitch/core/clearmsg/message.go index 2962967..bd6bee8 100644 --- a/twitch/core/clearmsg/message.go +++ b/twitch/core/clearmsg/message.go @@ -4,7 +4,8 @@ package clearmsg import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Clearmsg struct { diff --git a/twitch/core/connection.go b/twitch/core/connection.go index 149b680..be6f608 100644 --- a/twitch/core/connection.go +++ b/twitch/core/connection.go @@ -4,8 +4,9 @@ import ( "bufio" "fmt" "io" - "twitchchat/irc" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/irc" + "fl-gui.name/twitchchat/twitch/core/messages" "golang.org/x/net/websocket" ) diff --git a/twitch/core/globaluserstate/message.go b/twitch/core/globaluserstate/message.go index 8c985e4..6c5f5f9 100644 --- a/twitch/core/globaluserstate/message.go +++ b/twitch/core/globaluserstate/message.go @@ -2,7 +2,7 @@ package globaluserstate -import "twitchchat/twitch/core/messages" +import "fl-gui.name/twitchchat/twitch/core/messages" type Globaluserstate struct { messages.Message diff --git a/twitch/core/hosttarget/message.go b/twitch/core/hosttarget/message.go index a020ba7..83f85fb 100644 --- a/twitch/core/hosttarget/message.go +++ b/twitch/core/hosttarget/message.go @@ -4,7 +4,8 @@ package hosttarget import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Hosttarget struct { diff --git a/twitch/core/join.go b/twitch/core/join.go index 1edc257..22d7603 100644 --- a/twitch/core/join.go +++ b/twitch/core/join.go @@ -2,8 +2,9 @@ package core import ( "fmt" - "twitchchat/twitch/core/messages" - "twitchchat/twitch/core/notice" + + "fl-gui.name/twitchchat/twitch/core/messages" + "fl-gui.name/twitchchat/twitch/core/notice" ) type ChannelMembers map[string][]string diff --git a/twitch/core/messages/auth.go b/twitch/core/messages/auth.go index 775f938..43246d4 100644 --- a/twitch/core/messages/auth.go +++ b/twitch/core/messages/auth.go @@ -2,8 +2,9 @@ package messages import ( "fmt" - "twitchchat/irc" - "twitchchat/twitch/core/commands" + + "fl-gui.name/twitchchat/irc" + "fl-gui.name/twitchchat/twitch/core/commands" ) func Pass(nickname string) Message { diff --git a/twitch/core/messages/capability.go b/twitch/core/messages/capability.go index 7898fff..320b5c1 100644 --- a/twitch/core/messages/capability.go +++ b/twitch/core/messages/capability.go @@ -1,8 +1,8 @@ package messages import ( - "twitchchat/irc" - "twitchchat/twitch/core/commands" + "fl-gui.name/twitchchat/irc" + "fl-gui.name/twitchchat/twitch/core/commands" ) func Capability(capability string) Message { diff --git a/twitch/core/messages/join.go b/twitch/core/messages/join.go index bbc8165..3457adc 100644 --- a/twitch/core/messages/join.go +++ b/twitch/core/messages/join.go @@ -2,8 +2,9 @@ package messages import ( "strings" - "twitchchat/irc" - "twitchchat/twitch/core/commands" + + "fl-gui.name/twitchchat/irc" + "fl-gui.name/twitchchat/twitch/core/commands" ) func Join(channels ...string) Message { diff --git a/twitch/core/messages/messages.go b/twitch/core/messages/messages.go index cdfd06e..7853225 100644 --- a/twitch/core/messages/messages.go +++ b/twitch/core/messages/messages.go @@ -1,6 +1,6 @@ package messages -import "twitchchat/irc" +import "fl-gui.name/twitchchat/irc" type Message irc.Message diff --git a/twitch/core/messages/ping.go b/twitch/core/messages/ping.go index b48bc13..8b88a67 100644 --- a/twitch/core/messages/ping.go +++ b/twitch/core/messages/ping.go @@ -1,8 +1,8 @@ package messages import ( - "twitchchat/irc" - "twitchchat/twitch/core/commands" + "fl-gui.name/twitchchat/irc" + "fl-gui.name/twitchchat/twitch/core/commands" ) func IsPing(m Message) bool { diff --git a/twitch/core/notice/message.go b/twitch/core/notice/message.go index 7ae9435..c0a4f46 100644 --- a/twitch/core/notice/message.go +++ b/twitch/core/notice/message.go @@ -4,7 +4,8 @@ package notice import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Notice struct { diff --git a/twitch/core/pingpong.go b/twitch/core/pingpong.go index 3a4dde8..04427c9 100644 --- a/twitch/core/pingpong.go +++ b/twitch/core/pingpong.go @@ -1,6 +1,6 @@ package core -import "twitchchat/twitch/core/messages" +import "fl-gui.name/twitchchat/twitch/core/messages" // Intercept received ping messages and respond to them with an appropriate pong func (c *Conn) PingPong(msgs <-chan messages.Message) <-chan messages.Message { diff --git a/twitch/core/privmsg/message.go b/twitch/core/privmsg/message.go index 03d84c2..1cf0771 100644 --- a/twitch/core/privmsg/message.go +++ b/twitch/core/privmsg/message.go @@ -4,7 +4,8 @@ package privmsg import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Privmsg struct { diff --git a/twitch/core/reconnect/message.go b/twitch/core/reconnect/message.go index 632c90b..22fd7ea 100644 --- a/twitch/core/reconnect/message.go +++ b/twitch/core/reconnect/message.go @@ -2,7 +2,7 @@ package reconnect -import "twitchchat/twitch/core/messages" +import "fl-gui.name/twitchchat/twitch/core/messages" type Reconnect struct { messages.Message diff --git a/twitch/core/roomstate/message.go b/twitch/core/roomstate/message.go index 61997b4..e291e68 100644 --- a/twitch/core/roomstate/message.go +++ b/twitch/core/roomstate/message.go @@ -2,7 +2,7 @@ package roomstate -import "twitchchat/twitch/core/messages" +import "fl-gui.name/twitchchat/twitch/core/messages" type Roomstate struct { messages.Message diff --git a/twitch/core/usernotice/message.go b/twitch/core/usernotice/message.go index 0a981cb..784f112 100644 --- a/twitch/core/usernotice/message.go +++ b/twitch/core/usernotice/message.go @@ -4,7 +4,8 @@ package usernotice import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Usernotice struct { diff --git a/twitch/core/userstate/message.go b/twitch/core/userstate/message.go index 975ecab..6960910 100644 --- a/twitch/core/userstate/message.go +++ b/twitch/core/userstate/message.go @@ -2,7 +2,7 @@ package userstate -import "twitchchat/twitch/core/messages" +import "fl-gui.name/twitchchat/twitch/core/messages" type Userstate struct { messages.Message diff --git a/twitch/core/whisper/message.go b/twitch/core/whisper/message.go index 9ed16a5..7bb368a 100644 --- a/twitch/core/whisper/message.go +++ b/twitch/core/whisper/message.go @@ -4,7 +4,8 @@ package whisper import ( "strings" - "twitchchat/twitch/core/messages" + + "fl-gui.name/twitchchat/twitch/core/messages" ) type Whisper struct { diff --git a/x/corechatclient/main.go b/x/corechatclient/main.go index 56055e9..1160643 100644 --- a/x/corechatclient/main.go +++ b/x/corechatclient/main.go @@ -5,9 +5,10 @@ import ( "flag" "fmt" "strings" - "twitchchat/twitch/core" - "twitchchat/twitch/core/messages" - "twitchchat/twitch/core/privmsg" + + "fl-gui.name/twitchchat/twitch/core" + "fl-gui.name/twitchchat/twitch/core/messages" + "fl-gui.name/twitchchat/twitch/core/privmsg" ) var channel = flag.String("channel", "fl_gui", "channel to read") diff --git a/x/generate/message/clearchat/message.go b/x/generate/message/clearchat/message.go deleted file mode 100644 index 1856896..0000000 --- a/x/generate/message/clearchat/message.go +++ /dev/null @@ -1,54 +0,0 @@ -// generated by /tmp/go-build2868507172/b001/exe/message - -package clearchat - -import ( - "strings" - "twitchchat/irc" -) - -type Clearchat struct { - irc.Message -} - -func IsClearchat(m irc.Message) bool { return string(m.Command) == "CLEARCHAT" } - -func (m Clearchat) Channel() string { return m.Params.Params[0][1:] } - -func (m Clearchat) User() string { return strings.Split(m.Params.Trailing, " ")[0][0:] } - -func (m Clearchat) Duration() string { - for _, t := range m.Tags { - if t.Key == "ban-duration" { - return t.Value - } - } - return "" -} - -func (m Clearchat) RoomId() string { - for _, t := range m.Tags { - if t.Key == "room-id" { - return t.Value - } - } - return "" -} - -func (m Clearchat) UserId() string { - for _, t := range m.Tags { - if t.Key == "target-user-id" { - return t.Value - } - } - return "" -} - -func (m Clearchat) Timestamp() string { - for _, t := range m.Tags { - if t.Key == "tmi-sent-ts" { - return t.Value - } - } - return "" -} diff --git a/x/generate/message/generateMessage.go b/x/generate/message/generateMessage.go index 46500f8..bb99587 100644 --- a/x/generate/message/generateMessage.go +++ b/x/generate/message/generateMessage.go @@ -5,7 +5,8 @@ import ( "io" "os" "strings" - "twitchchat/irc" + + "fl-gui.name/twitchchat/irc" ) func generateMessage(msg irc.Message, w io.Writer) (n int, err error) { diff --git a/x/generate/message/main.go b/x/generate/message/main.go index 6c76020..eca2cad 100644 --- a/x/generate/message/main.go +++ b/x/generate/message/main.go @@ -7,7 +7,8 @@ import ( "io/fs" "os" "path" - "twitchchat/irc" + + "fl-gui.name/twitchchat/irc" ) var prototype = flag.String("proto", "", "The prototype of the tags + message as a valid IRC message") -- 2.47.1