Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ybrin committed Sep 24, 2020
1 parent 8fe5a88 commit bccf350
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public extension TelegramSendApi {
*
* - parameter token: The telegram bot token to be used in requests.
*/
public convenience init(token: String) {
convenience init(token: String) {
let provider = TelegramApiHttpProvider(url: "https://api.telegram.org/bot\(token)")
self.init(token: token, provider: provider)
}
Expand Down
20 changes: 10 additions & 10 deletions Sources/TelegramBotPromiseKit/TelegramSendApi+PromiseKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,71 @@ import PromiseKit

public extension TelegramSendApi {

public func getMe() -> Promise<TelegramUser> {
func getMe() -> Promise<TelegramUser> {
return Promise { seal in
self.getMe { response in
response.sealPromise(seal: seal)
}
}
}

public func sendMessage(message: TelegramSendMessage) -> Promise<TelegramMessage> {
func sendMessage(message: TelegramSendMessage) -> Promise<TelegramMessage> {
return Promise { seal in
self.sendMessage(message: message) { response in
response.sealPromise(seal: seal)
}
}
}

public func forwardMessage(message: TelegramSendForwardMessage) -> Promise<TelegramMessage> {
func forwardMessage(message: TelegramSendForwardMessage) -> Promise<TelegramMessage> {
return Promise { seal in
self.forwardMessage(message: message) { response in
response.sealPromise(seal: seal)
}
}
}

public func sendPhoto(photo: TelegramSendPhoto) -> Promise<TelegramMessage> {
func sendPhoto(photo: TelegramSendPhoto) -> Promise<TelegramMessage> {
return Promise { seal in
self.sendPhoto(photo: photo) { response in
response.sealPromise(seal: seal)
}
}
}

public func getFile(fileId: String) -> Promise<TelegramFile> {
func getFile(fileId: String) -> Promise<TelegramFile> {
return Promise { seal in
self.getFile(fileId: fileId) { response in
response.sealPromise(seal: seal)
}
}
}

public func answerCallbackQuery(answerCallbackQuery: TelegramSendAnswerCallbackQuery) -> Promise<Bool> {
func answerCallbackQuery(answerCallbackQuery: TelegramSendAnswerCallbackQuery) -> Promise<Bool> {
return Promise { seal in
self.answerCallbackQuery(answerCallbackQuery: answerCallbackQuery) { response in
response.sealPromise(seal: seal)
}
}
}

public func editMessageReplyMarkup(editMessageReplyMarkup: TelegramSendEditMessageReplyMarkup) -> Promise<TelegramMessage> {
func editMessageReplyMarkup(editMessageReplyMarkup: TelegramSendEditMessageReplyMarkup) -> Promise<TelegramMessage> {
return Promise { seal in
self.editMessageReplyMarkup(editMessageReplyMarkup: editMessageReplyMarkup) { response in
response.sealPromise(seal: seal)
}
}
}

public func getChatMember(chatId: TelegramSendChatIdentifier, userId: Int) -> Promise<TelegramChatMember> {
func getChatMember(chatId: TelegramSendChatIdentifier, userId: Int) -> Promise<TelegramChatMember> {
return Promise { seal in
self.getChatMember(chatId: chatId, userId: userId) { response in
response.sealPromise(seal: seal)
}
}
}

public func deleteMessage(chatId: TelegramSendChatIdentifier, messageId: Int) -> Promise<Bool> {
func deleteMessage(chatId: TelegramSendChatIdentifier, messageId: Int) -> Promise<Bool> {
return Promise { seal in
self.deleteMessage(chatId: chatId, messageId: messageId) { response in
response.sealPromise(seal: seal)
Expand All @@ -79,7 +79,7 @@ public extension TelegramSendApi {

fileprivate extension TelegramResponse {

fileprivate func sealPromise(seal: Resolver<Result>) {
func sealPromise(seal: Resolver<Result>) {
seal.resolve(result, error)
}
}

0 comments on commit bccf350

Please sign in to comment.