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

seen: Improve readability of information #1661

Merged
merged 2 commits into from
Sep 28, 2019
Merged

seen: Improve readability of information #1661

merged 2 commits into from
Sep 28, 2019

Conversation

kwaaak
Copy link
Contributor

@kwaaak kwaaak commented Jul 15, 2019

Now that #1560 has been merged, let's use it.

This changes the reply to "seen" commands:
before
nickname: I last saw other_nickname at 2019-05-29 - 23:04:13UTC in here, saying gotta go
after
nickname: I last saw other_nickname in here 45 days, 4 hours ago, saying: gotta go

I don't know if the timestamp should be included in the reply or not.

Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

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

Looks like a good improvement to me. 👍

sopel/modules/seen.py Outdated Show resolved Hide resolved
sopel/modules/seen.py Outdated Show resolved Hide resolved
sopel/modules/seen.py Outdated Show resolved Hide resolved
@Exirel Exirel added this to the 7.0.0 milestone Jul 15, 2019
Removed imports and logic for the timestamp
Cleaned up the construction of different reply strings
@kwaaak
Copy link
Contributor Author

kwaaak commented Aug 1, 2019

This change drastically simplifies the module.

Instead of doing
bot.db.set_nick_value(trigger.nick, 'seen_timestamp', time.time())
we can just do
bot.db.set_nick_value(trigger.nick, 'seen_timestamp', trigger.time)
and get rid of the datetime and time imports.

The code in this module runs a lot. The datetime object trigger.time would be twice as big as the float time.time().

@kwaaak kwaaak requested a review from Exirel August 9, 2019 22:24
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

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

🚢

@dgw dgw merged commit 07ba3ee into master Sep 28, 2019
@dgw dgw deleted the seen_timedelta branch September 28, 2019 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants