mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
refactor
This commit is contained in:
parent
8e432a5ee0
commit
9377bcf897
|
@ -6,8 +6,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gempir/go-twitch-irc/v4"
|
"github.com/gempir/go-twitch-irc/v4"
|
||||||
"github.com/lyx0/nourybot/internal/commands"
|
"github.com/lyx0/nourybot/pkg/commands"
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
"github.com/lyx0/nourybot/pkg/ivr"
|
"github.com/lyx0/nourybot/pkg/ivr"
|
||||||
"github.com/lyx0/nourybot/pkg/lastfm"
|
"github.com/lyx0/nourybot/pkg/lastfm"
|
||||||
"github.com/lyx0/nourybot/pkg/owm"
|
"github.com/lyx0/nourybot/pkg/owm"
|
||||||
|
@ -99,11 +99,11 @@ func (app *application) handleCommand(message twitch.PrivateMessage) {
|
||||||
case "cf":
|
case "cf":
|
||||||
reply = commands.Coinflip()
|
reply = commands.Coinflip()
|
||||||
|
|
||||||
// ()currency <amount> <input currency> to <output currency>
|
|
||||||
case "currency":
|
case "currency":
|
||||||
if msgLen < 4 {
|
if msgLen < 4 {
|
||||||
reply = "Not enough arguments provided. Usage: ()currency 10 USD to EUR"
|
reply = "Not enough arguments provided. Usage: ()currency 10 USD to EUR"
|
||||||
} else {
|
} else {
|
||||||
|
// ()currency <amount> <input currency> to <output currency>
|
||||||
reply, _ = commands.Currency(cmdParams[1], cmdParams[2], cmdParams[4])
|
reply, _ = commands.Currency(cmdParams[1], cmdParams[2], cmdParams[4])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ import (
|
||||||
"github.com/jakecoffman/cron"
|
"github.com/jakecoffman/cron"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
|
||||||
"github.com/lyx0/nourybot/internal/data"
|
"github.com/lyx0/nourybot/internal/data"
|
||||||
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
"github.com/nicklaw5/helix/v2"
|
"github.com/nicklaw5/helix/v2"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
|
||||||
"github.com/lyx0/nourybot/internal/data"
|
"github.com/lyx0/nourybot/internal/data"
|
||||||
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
"github.com/lyx0/nourybot/pkg/ivr"
|
"github.com/lyx0/nourybot/pkg/ivr"
|
||||||
"github.com/nicklaw5/helix/v2"
|
"github.com/nicklaw5/helix/v2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Coinflip() string {
|
func Coinflip() string {
|
|
@ -3,7 +3,7 @@ package commands
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
"github.com/lyx0/nourybot/pkg/humanize"
|
"github.com/lyx0/nourybot/pkg/humanize"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package commands
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Preview(channel string) string {
|
func Preview(channel string) string {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/lyx0/nourybot/internal/common"
|
"github.com/lyx0/nourybot/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type xkcdResponse struct {
|
type xkcdResponse struct {
|
Loading…
Reference in a new issue