-
-
Notifications
You must be signed in to change notification settings - Fork 1
Multi-team & Slack App support #130
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
base: master
Are you sure you want to change the base?
Conversation
src/index.ts
Outdated
| } | ||
|
|
||
| if (!config.updateWeekends && isWeekend(currentTime)) { | ||
| if (isWeekend(currentTime) && config.app.update_weekends) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad logic, should be:
if (isWeekend(currentTime) && !config.app.update_weekends) { }
src/index.ts
Outdated
| await writeTrackJSON(track) | ||
| // Compute new status and duration | ||
| // --- | ||
| const trackDuration = track?.duration ?? 60 * (10 * 1000) // 10 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to:
const trackDuration = track?.duration ?? 600000 // 10 minutes
src/index.ts
Outdated
| for (const client of clients) { | ||
| const [presence, profile] = await Promise.all([ | ||
| client.getPresence(), | ||
| client.getProfile() | ||
| ]) | ||
|
|
||
| if (presence !== 'active') return | ||
| if (!profile.status_text.includes(config.app.separator)) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary to batch these requests, we can avoid the profile request if the presence is away.
| .then(main) | ||
| .then(loop) | ||
| .catch(handleError) | ||
| .catch(console.error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.exit(1) and schedule.stop() here?
e475759 to
4da0956
Compare
41e9795 to
b2aabbc
Compare
b2aabbc to
d19b9a9
Compare
Rewrites the core application to better support updating statuses across multiple teams and be installed as a Slack App.
Todo