-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (35 loc) · 969 Bytes
/
main.go
File metadata and controls
43 lines (35 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
discord_bot "bot-ui/discord"
get_conf "bot-ui/func"
read_message "bot-ui/message"
telegram_bot "bot-ui/telegram"
"fmt"
"os"
)
func main() {
get_conf.Read()
if len(os.Args) < 2 {
fmt.Println("Usage: go run main.go <path_to_markdown_file>")
os.Exit(1)
}
// The file path is the second argument.
msgPath := os.Args[1]
imgPath := os.Args[2]
// --- 2. Read File Content into a String ---
// Call our new function to get the file content.
contentString, err := read_message.Read(msgPath)
if err != nil {
// If the function returns an error, print it and exit.
fmt.Println(err)
os.Exit(1)
}
// --- 3. Print the Entire String ---
// Print a header and then the entire file content.
fmt.Printf("--- Content of %s ---\n", msgPath)
fmt.Println(contentString)
fmt.Println("--- End of File ---")
// telegram_bot.Send(contentString)
discord_bot.Send(contentString, imgPath)
telegram_bot.Send(contentString, imgPath)
}