Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kotlin telegram bot issue #160: #248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martin-petersen
Copy link
Contributor

  • Add possibility to specify the horizontal accuracy of a location

   - Add possibility to specify the horizontal accuracy of a location
Copy link
Member

@seik seik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Martin! Thank you for your contribution. I merged some other PRs and there is conflicts, so if you could resolve them that would be cool!

I also left some other comments, all related to variable naming and styling so no biggie, if you change those + the conflicts this is ready to merge :D

@@ -976,7 +976,8 @@ class Bot private constructor(
disableNotification: Boolean? = null,
replyToMessageId: Long? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: ReplyMarkup? = null
replyMarkup: ReplyMarkup? = null,
horizontal_accuracy: Float? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

@@ -985,7 +986,8 @@ class Bot private constructor(
disableNotification,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
replyMarkup,
horizontal_accuracy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

@@ -1066,14 +1068,16 @@ class Bot private constructor(
inlineMessageId: String? = null,
latitude: Float,
longitude: Float,
replyMarkup: ReplyMarkup? = null
replyMarkup: ReplyMarkup? = null,
horizontal_accuracy: Float? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

) = apiClient.editMessageLiveLocation(
chatId,
messageId,
inlineMessageId,
latitude,
longitude,
replyMarkup
replyMarkup,
horizontal_accuracy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

@@ -2,5 +2,6 @@ package com.github.kotlintelegrambot.entities

data class Location(
val longitude: Float,
val latitude: Float
val latitude: Float,
val horizontal_accuracy: Float?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables. In case you need to convert the field there is an example here https://github.com/kotlin-telegram-bot/kotlin-telegram-bot/pull/246/files#diff-a2f2723c9a12ea5c753ed62dc6c8c7f17869bd7e1c949b298ee726daa43ca9e7R8

@@ -640,7 +642,8 @@ internal class ApiClient(
inlineMessageId: String?,
latitude: Float,
longitude: Float,
replyMarkup: ReplyMarkup?
replyMarkup: ReplyMarkup?,
horizontal_accuracy: Float?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

@@ -649,7 +652,8 @@ internal class ApiClient(
inlineMessageId,
latitude,
longitude,
replyMarkup
replyMarkup,
horizontal_accuracy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

@@ -373,7 +374,8 @@ internal interface ApiService {
@Field("inline_message_id") inlineMessageId: String?,
@Field("latitude") latitude: Float,
@Field("longitude") longitude: Float,
@Field(ApiConstants.REPLY_MARKUP) replyMarkup: ReplyMarkup? = null
@Field(ApiConstants.REPLY_MARKUP) replyMarkup: ReplyMarkup? = null,
@Field("horizontal_accuracy") horizontal_accuracy: Float? = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

): Location = Location(
longitude = longitude,
latitude = latitude
latitude = latitude,
horizontalAccuracy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assign the variable like with the others

Suggested change
horizontalAccuracy
horizontalAccuracy = horizontalAccuracy

@@ -48,6 +48,7 @@ class GetChatIT : ApiClientIT() {
location = Location(
latitude = 20.425537f,
longitude = -3.604971f,
horizontal_accuracy = 2.3f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case like in other variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants