Skip to content

Commit 627f157

Browse files
Downgraded API to 1.1.0, still trying to find the version, where it will run on linux
1 parent 870a101 commit 627f157

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

NotifierBot/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
// Dependencies declare other packages that this package depends on.
1616
// .package(url: /* package url */, from: "1.0.0"),
17-
.package(url: "https://github.com/rapierorg/telegram-bot-swift.git", .exact("1.2.2"))
17+
.package(url: "https://github.com/rapierorg/telegram-bot-swift.git", .exact("1.1.0"))
1818
],
1919
targets: [
2020
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

NotifierBot/Sources/Notifier/Controllers/MainController.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ class MainController: Controller {
6767
if usage.hasSuffix("\n") {
6868
usage.removeLast()
6969
}
70-
context.respondAsync(usage, parseMode: .markdown)
70+
context.respondAsync(usage, parse_mode: .markdown)
7171
return true
7272
}
7373

7474
func onList(context: Context) throws -> Bool {
7575
let entries = try ConfigParser.getConfig().filter({ $0.chatID == context.chatId })
7676
let list = entryList(entries, listArea: true, listURLs: false)
77-
context.respondAsync(list, parseMode: .markdown)
77+
context.respondAsync(list, parse_mode: .markdown)
7878
return true
7979
}
8080

8181
func onListURLs(context: Context) throws -> Bool {
8282
let entries = try ConfigParser.getConfig().filter({ $0.chatID == context.chatId })
8383
let list = entryList(entries, listArea: false, listURLs: true)
84-
context.respondAsync(list, parseMode: .markdown)
84+
context.respondAsync(list, parse_mode: .markdown)
8585
return true
8686
}
8787

@@ -115,7 +115,7 @@ class MainController: Controller {
115115
if entries.isEmpty {
116116
list += "\n_None_"
117117
}
118-
context.respondAsync(list, parseMode: .markdown)
118+
context.respondAsync(list, parse_mode: .markdown)
119119
return true
120120
}
121121

@@ -362,7 +362,7 @@ class MainController: Controller {
362362
username = "\(id)"
363363
}
364364
let level = configParser.permissionGroup(user: userID)
365-
context.respondAsync("The permission level of \(username!) is *\(level.rawValue)*.", parseMode: .markdown)
365+
context.respondAsync("The permission level of \(username!) is *\(level.rawValue)*.", parse_mode: .markdown)
366366
return true
367367
}
368368

@@ -396,7 +396,7 @@ class MainController: Controller {
396396
return true
397397
}
398398
try configParser.setPermissionGroup(user: userID, level: level)
399-
context.respondAsync("Successfully set the permission level of \(username!) to *\(level.rawValue)*.", parseMode: .markdown)
399+
context.respondAsync("Successfully set the permission level of \(username!) to *\(level.rawValue)*.", parse_mode: .markdown)
400400
return true
401401
}
402402

@@ -405,7 +405,7 @@ class MainController: Controller {
405405
context.respondAsync("Error: Unable to retrieve ID.")
406406
return true
407407
}
408-
context.respondAsync("The user ID of \(context.message?.from?.username ?? "<Unknown>") is `\(id)`", parseMode: .markdown)
408+
context.respondAsync("The user ID of \(context.message?.from?.username ?? "<Unknown>") is `\(id)`", parse_mode: .markdown)
409409
return true
410410
}
411411

NotifierBot/Sources/Notifier/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ while let update = bot.nextUpdateSync() {
8585
print("Error: No chat ID associated with this chat")
8686
} catch BotError.noPermissions(let command) {
8787
if let chatID = update.message?.chat.id {
88-
bot.sendMessageAsync(chatId: chatID, parseMode: .markdownv2, text: "This action requires the permission level *\(command.permission.rawValue)*.")
88+
bot.sendMessageAsync(chatId: chatID, text: "This action requires the permission level *\(command.permission.rawValue)*.", parseMode: .markdown)
8989
}
9090
var name = "\(update.message?.from?.username ?? "Unknown User")"
9191
if let firstName = update.message?.from?.firstName, let lastName = update.message?.from?.lastName {

0 commit comments

Comments
 (0)