Skip to content

Commit

Permalink
adding emoji to message
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanSST committed Sep 29, 2023
1 parent a33466f commit 41add87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public String sendNotification(String message) {

// Build a request object
ChatPostMessageRequest request = ChatPostMessageRequest.builder().channel(channel)//
.text(":wave: " + message).build();
.text(message).build();

// Get a response as a Java object
ChatPostMessageResponse response = methods.chatPostMessage(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Message tare(@RequestParam(value = "uid") String uid) {

@GetMapping("/send")
public Message send(@RequestParam(value = "text") String text) {
String result = messengerService.sendNotification(text);
String result = messengerService.sendNotification(":wink:" + text);
return new Message(counter.incrementAndGet(), result);
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ch/stephan/chickenfarm/timer/ScaleObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ private void measureWeightOfScale(Box box) {
int weight = scaleService.measureWeight(box.getId());

if (weight > 1000) { // chicken in the box
String message = MessageFormatter
.format("Ein Huhn sitzt in der Legebox {} und ist {}g schwer.", box.getDescription(), weight)
.getMessage();
String message = MessageFormatter.format(":chicken: Ein Huhn sitzt in der Legebox {} und ist {}g schwer.",
box.getDescription(), weight).getMessage();
log.info(message);

if (box.getBoxState() == BoxState.EMPTY) {
Expand All @@ -53,7 +52,8 @@ private void measureWeightOfScale(Box box) {

} else if (weight > 50) { // egg in the box
String message = MessageFormatter
.format("Huhn in der Legebox {} hat ein Ei von {}g gelegt.", box.getId(), weight).getMessage();
.format(":nest_with_eggs: Huhn in der Legebox {} hat ein Ei von {}g gelegt.", box.getId(), weight)
.getMessage();
log.info(message);

if (box.getBoxState() == BoxState.CHICKEN_IN) {
Expand Down

0 comments on commit 41add87

Please sign in to comment.