Skip to content

Commit

Permalink
Fix listening port.
Browse files Browse the repository at this point in the history
  • Loading branch information
mguaylam committed Jul 12, 2024
1 parent 7c016a9 commit 87750ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"context"
"fmt"
"log"
"net/http"
"os"
"strconv"
"strings"
"sync"
"time"
"net/http"

tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"github.com/joho/godotenv"
"github.com/mguaylam/communautofinder"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
)

// Possible states in conversation with the bot
Expand Down Expand Up @@ -63,7 +64,7 @@ func main() {
w.WriteHeader(http.StatusOK)
})

go http.ListenAndServe(":8080", nil)
go http.ListenAndServe(":8444", nil)

// Find TOKEN in .env file if exist
godotenv.Load()
Expand Down Expand Up @@ -152,7 +153,7 @@ func generateResponse(userCtx *UserContext, message *tgbotapi.Message) string {
userCtx.kmMargin = margin
userCtx.state = AskingPosition
log.Printf("Asking user " + strconv.FormatInt(userCtx.chatId, 10) + " location")
return "Veuillez partager votre position pour votre recherche."
return "Veuillez partager votre position pour votre recherche."
}
}

Expand Down Expand Up @@ -225,7 +226,7 @@ func generateMessageResearch(userCtx UserContext) string {
roundedKmMargin := int(userCtx.kmMargin)

message := fmt.Sprintf("🔍 Recherche d'un véhicule %s dans un rayon de %dkm autour de la position que vous avez entrée. Vous recevrez un message lorsque l'un sera trouvé.", typeSearch, roundedKmMargin)

if userCtx.searchType == Station {
message += fmt.Sprintf(" de %s a %s", userCtx.dateStart.Format(layoutDate), userCtx.dateEnd.Format(layoutDate))
}
Expand Down

0 comments on commit 87750ce

Please sign in to comment.