-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add api methods for setUserEmojiStatus
- Loading branch information
1 parent
27241fa
commit 696219d
Showing
4 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...tapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/set/SetUserEmojiStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package dev.inmo.tgbotapi.extensions.api.set | ||
|
||
import dev.inmo.tgbotapi.bot.TelegramBot | ||
import dev.inmo.tgbotapi.requests.set.SetUserEmojiStatus | ||
import dev.inmo.tgbotapi.types.* | ||
import dev.inmo.tgbotapi.types.chat.User | ||
import korlibs.time.DateTime | ||
|
||
public suspend fun TelegramBot.setUserEmojiStatus( | ||
userId: UserId, | ||
customEmojiId: CustomEmojiId, | ||
expirationDate: TelegramDate? = null | ||
): Boolean = execute( | ||
SetUserEmojiStatus( | ||
userId = userId, | ||
customEmojiId = customEmojiId, | ||
expirationDate = expirationDate | ||
) | ||
) | ||
|
||
public suspend fun TelegramBot.setUserEmojiStatus( | ||
user: User, | ||
customEmojiId: CustomEmojiId, | ||
expirationDate: TelegramDate? = null | ||
): Boolean = setUserEmojiStatus( | ||
user.id, | ||
customEmojiId, | ||
expirationDate | ||
) | ||
|
||
|
||
public suspend fun TelegramBot.setUserEmojiStatus( | ||
userId: UserId, | ||
customEmojiId: CustomEmojiId, | ||
expirationDate: DateTime | ||
): Boolean = setUserEmojiStatus( | ||
userId, | ||
customEmojiId, | ||
expirationDate.toTelegramDate() | ||
) | ||
|
||
public suspend fun TelegramBot.setUserEmojiStatus( | ||
user: User, | ||
customEmojiId: CustomEmojiId, | ||
expirationDate: DateTime | ||
): Boolean = setUserEmojiStatus( | ||
user.id, | ||
customEmojiId, | ||
expirationDate | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters