Skip to content

Commit

Permalink
Add notice in case argument is empty for !afterstream command (fixed #26
Browse files Browse the repository at this point in the history
)
  • Loading branch information
udoprog committed Apr 6, 2019
1 parent 4436ac1 commit 05cb454
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- `!promo` now uses hangout detection determined by the `irc/idle-detection/threshold` setting.
- `!afterstream` command without argument now prints a help message ([#26]).

### Changed
- Fixed bug where `Settings` frontend would make the value into a string before sending it to backend.

[#26]: https://github.com/udoprog/setmod/issues/26

[Unreleased]: https://github.com/udoprog/setmod/compare/0.2.4...HEAD

## [0.2.4]
Expand Down
8 changes: 8 additions & 0 deletions bot/src/irc/after_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ impl command::Handler for AfterStream {
return Ok(());
}

if ctx.rest().trim().is_empty() {
ctx.respond(
"You add a reminder by calling !afterstream <reminder>, \
like \"!afterstream remember that you are awesome <3\"",
);
return Ok(());
}

self.after_streams
.push(ctx.user.target, ctx.user.name, ctx.rest())?;
ctx.respond("Reminder added.");
Expand Down

0 comments on commit 05cb454

Please sign in to comment.