<repo><f p="cmd\bot\main.go"><![CDATA[package main
import (
 "context"
 "os"
 "os/signal"
 "github.com/go-telegram/bot"
 "github.com/rakett1337/tg_assistant_bot/internal/config"
 "github.com/rakett1337/tg_assistant_bot/internal/handler"
 "github.com/rakett1337/tg_assistant_bot/pkg/logger"
)
func init() {
 logger.Init()
 config.LoadConfig()
}
func main() {
 ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
 defer cancel()
 opts := []bot.Option{
 bot.WithDefaultHandler(handler.Default),
 }
 b, err := bot.New(config.AppConfig.TelegramAPIKey, opts...)
 if err != nil {
 logger.Log.Fatalf("Failed to create bot: %v", err)
 }
 b.Start(ctx)
}]]></f><f p="internal\audio\audio.go"><![CDATA[package audio
import (
 "fmt"
 "os/exec"
 "github.com/rakett1337/tg_assistant_bot/pkg/logger"
)
func ConvertAudio(inputPath, outputPath string) error {
 cmd := exec.Command("ffmpeg", "-i", inputPath, outputPath)
 output, err := cmd.CombinedOutput()
 if err != nil {
 logger.Log.Errorf("FFmpeg conversion error: %v\nOutput: %s", err, string(output))
 return fmt.Errorf("FFmpeg conversion error: %v\nOutput: %s", err, string(output))
 }
 logger.Log.Infof("Audio converted from %s to %s", inputPath, outputPath)
 return nil
}]]></f><f p="internal\config\config.go"><![CDATA[package config
import (
 "os"
 "github.com/joho/godotenv"
 "github.com/kelseyhightower/envconfig"
 l "github.com/rakett1337/tg_assistant_bot/pkg/logger"
)
type Config struct {
 TelegramAPIKey string `envconfig:"TELEGRAM_API_KEY" required:"true"`
 GoogleAPIKey string `envconfig:"GOOGLE_API_KEY" required:"true"`
}
var AppConfig Config
func LoadConfig() {
 if err := godotenv.Load(); err != nil && !os.IsNotExist(err) {
 l.Log.Fatalf("Error loading .env file: %v", err)
 }
 err := envconfig.Process("", &AppConfig)
 if err != nil {
 l.Log.Fatalf("Error loading config: %v", err)
 }
 l.Log.Info("Configuration loaded successfully")
}]]></f><f p="internal\handler\handler.go"><![CDATA[package handler
import (
 "context"
 "io"
 "net/http"
 "os"
 "strings"
 "github.com/go-telegram/bot"
 "github.com/go-telegram/bot/models"
 "github.com/rakett1337/tg_assistant_bot/internal/audio"
 "github.com/rakett1337/tg_assistant_bot/pkg/logger"
)
func Default(ctx context.Context, b *bot.Bot, update *models.Update) {
 if update.Message == nil {
 return
 }
 if update.Message.Text != "" {
 }
 if update.Message.Voice != nil {
 handleVoiceMessage(ctx, b, update)
 return
 }
 if update.Message.Audio != nil {
 }
}
func handleVoiceMessage(ctx context.Context, b *bot.Bot, update *models.Update) error {
 logger.Log.Infof("Handling voice message from user %s", update.Message.From.Username)
 file, err := b.GetFile(ctx, &bot.GetFileParams{
 FileID: update.Message.Voice.FileID,
 })
 if err != nil {
 logger.Log.Errorf("Error getting file: %v", err)
 return err
 }
 downloadURL := b.FileDownloadLink(file)
 resp, err := http.Get(downloadURL)
 if err != nil {
 logger.Log.Errorf("Error downloading file: %v", err)
 return err
 }
 defer resp.Body.Close()
 fileData, err := io.ReadAll(resp.Body)
 if err != nil {
 logger.Log.Errorf("Error reading file data: %v", err)
 return err
 }
 inputFileName := file.FileUniqueID + ".oga"
 err = os.WriteFile(inputFileName, fileData, 0644)
 if err != nil {
 logger.Log.Errorf("Error saving file: %v", err)
 return err
 }
 defer os.Remove(inputFileName) 
 outputFileName := strings.TrimSuffix(inputFileName, ".oga") + ".wav"
 err = audio.ConvertAudio(inputFileName, outputFileName)
 if err != nil {
 logger.Log.Errorf("Error converting audio: %v", err)
 return err
 }
 defer os.Remove(outputFileName)
 finalFile, err := os.ReadFile(outputFileName)
 if err != nil {
 logger.Log.Errorf("Error reading converted audio file: %v", err)
 return err
 }
 response, err := llm.ProcessAudio(ctx, finalFile)
 if err != nil {
 logger.Log.Errorf("Error processing audio with LLM: %v", err)
 return err
 }
 _, err = b.SendMessage(ctx, &bot.SendMessageParams{
 ChatID: update.Message.Chat.ID,
 Text: response,
 })
 if err != nil {
 logger.Log.Errorf("Error sending message: %v", err)
 return err
 }
 return nil
}]]></f><f p="internal\llm\processor.go"><![CDATA[package llm]]></f><f p="pkg\logger\logger.go"><![CDATA[package logger
import (
 "io"
 "os"
 "github.com/sirupsen/logrus"
)
var Log *logrus.Logger
func Init() {
 Log = logrus.New()
 Log.SetOutput(os.Stdout)
 Log.SetLevel(logrus.InfoLevel)
 Log.SetFormatter(&logrus.TextFormatter{
 FullTimestamp: true,
 })
}
func SetOutput(w io.Writer) {
 Log.SetOutput(w)
}]]></f></repo>

my processor will need to make use of api key from config. I dont want to reload the config, I want somehow the config passed to the processor from when we initialize the app. approaches?