From 4dcef064b6a6796135fd3beefeae613d8ea9a5ef Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 23 Oct 2021 20:43:39 +0200 Subject: [PATCH] cleanup --- pkg/api/currency.go | 1 + pkg/handlers/command.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/api/currency.go b/pkg/api/currency.go index 6d47fad..372a487 100644 --- a/pkg/api/currency.go +++ b/pkg/api/currency.go @@ -39,6 +39,7 @@ type currencyResponse struct { // https://api.frankfurter.app/latest?amount=10&from=gbp&to=usd +// Currency returns the exchange rate for a given given amount to another. func Currency(currAmount string, currFrom string, currTo string) (string, error) { baseUrl := "https://api.frankfurter.app" currFromUpper := strings.ToUpper(currFrom) diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index d12e58a..c5ee13f 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -70,13 +70,14 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { commands.Color(message, nb) return - // ()currency 10 gbp to usd case "currency": if msgLen <= 4 { nb.Send(target, "Usage: ()currency 10 usd to eur, only 3 letter codes work.") return } commands.Currency(target, cmdParams[1], cmdParams[2], cmdParams[4], nb) + return + case "echo": commands.Echo(target, message.Message[7:len(message.Message)], nb) return