Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ class UserCommunicationService(
private val version: String
) {
private companion object : KLogging() {

Choose a reason for hiding this comment

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

Btw, I don't think we need KLogging() here. It could be nice to remove it as well, hopefully it will not break sth unexpected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for mentioning that. After wanting to verify why it's there I've noticed that this dependency is very outdated (2.0.6 v.s. 7.0.14). I've created a Jira ticket for it for further investigation of why it's the case: WPB-22879

private const val WELCOME_TEXT =
"👋 Hi, I'm the Poll App. Thanks for adding me to the conversation.\n" +
"You can use me to create polls directly in Wire.\n" +
"I'm here to help make everyday work a little easier.\n"
const val USAGE = "To create poll please text: " +
"`/poll \"Question\" \"Option 1\" \"Option 2\"`. To display usage write `/poll help`"
val commands = """
Following commands are available:
`/poll "Question" "Option 1" "Option 2"` will create poll
`/poll help` to show help
""".trimIndent()

const val WELCOME_MESSAGE = WELCOME_TEXT + USAGE
}

/**
Expand All @@ -38,7 +39,7 @@ class UserCommunicationService(
manager: WireApplicationManager,
conversationId: QualifiedId
) {
manager.send(textMessage(conversationId, "Hello, I'm Poll App. $USAGE"))
manager.send(textMessage(conversationId, WELCOME_MESSAGE))
logger.info("App sent a welcome message. conversationId: $conversationId")
}

Expand Down Expand Up @@ -69,7 +70,7 @@ class UserCommunicationService(
manager: WireApplicationManager,
conversationId: QualifiedId
) {
manager.send(textMessage(conversationId, commands))
manager.send(textMessage(conversationId, USAGE))
}

/**
Expand Down