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

Minor telegram tweak (km_walked truncated to 2 decimals) #4979

Merged
merged 3 commits into from
Aug 31, 2016
Merged

Minor telegram tweak (km_walked truncated to 2 decimals) #4979

merged 3 commits into from
Aug 31, 2016

Conversation

Gobberwart
Copy link
Contributor

Short Description:

Minor tweaks to telegram

  • Truncate km_walked to 2 decimals
  • Issue with recognising "master"

Reduces file IO and eliminates chance of error
- Get stats from inventory instead of reading .json
- Issue with "master" id
- Truncated km_walked to 2 decimals for readability
@mention-bot
Copy link

@Gobberwart, thanks for your PR! By analyzing the annotation information on this pull request, we identified @askovpen, @DBa2016 and @pulgalipe to be potential reviewers

@@ -56,7 +56,7 @@ def run(self):
self.update_id = update.update_id+1
if update.message:
self.bot.logger.info("message from {} ({}): {}".format(update.message.from_user.username, update.message.from_user.id, update.message.text))
if self.master and self.master not in [update.message.from_user.id, "@{}".format(update.message.from_user.username)]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Original code has two way to config the master:
username or chat_id, you changed to only chat_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you're saying, but it wasn't responding to my /info at all with the way it was.. Will keep looking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Username not work. Master can be userid or @channelname.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just put this back the way it was. If the original isn't working, fix it and create a new PR

@DBa2016
Copy link
Contributor

DBa2016 commented Aug 31, 2016

Agreed with @solderzzc here, no need to remove username recognition. The piece which automatically recognized chat_id was removed in the PR which moved Telegram into thread, but will be re-added once #4969 is merged.

@Gobberwart
Copy link
Contributor Author

I removed it because the original didn't work.

@Gobberwart
Copy link
Contributor Author

Looks like I had a telegram api issue while testing this. Reverted to original because it's working fine.

The only change here is truncating km to 2 decimals. Should be a no-brainer.

@Gobberwart Gobberwart changed the title Dev telegram Minor telegram tweak (km_walked truncated to 2 decimals) Aug 31, 2016
@solderzzc
Copy link
Contributor

yep, easy to merge this one:)

@solderzzc
Copy link
Contributor

solderzzc commented Aug 31, 2016

👍

Approved with PullApprove

@solderzzc solderzzc merged commit 39b02b1 into PokemonGoF:dev Aug 31, 2016
@DBa2016
Copy link
Contributor

DBa2016 commented Aug 31, 2016

The recognition of non-numeric master is not working right now because #4951 has removed the relevant piece of code without replacement.

@Gobberwart Gobberwart deleted the dev_telegram branch September 1, 2016 22:25
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.

5 participants