We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0ffe15 commit d7cbc60Copy full SHA for d7cbc60
NotifierBot/Sources/Notifier/main.swift
@@ -51,12 +51,14 @@ let bot: Bot!
51
52
do {
53
54
- if let t = Enviroment.get("TELEGRAM_BOT_TOKEN") {
+ if let t = try? String(contentsOfFile: "BOT_TOKEN") {
55
+ // Read the token from a the file
56
+ token = t
57
+ } else if let t = Enviroment.get("TELEGRAM_BOT_TOKEN") {
58
// Read the token from the environment, if it exists
59
token = t
60
} else {
- // Read the token from a the file
- token = try String(contentsOfFile: "BOT_TOKEN")
61
+ exit(1)
62
}
63
bot = try Bot(token: token)
64
0 commit comments