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 @@ -14,7 +14,7 @@ class KillUserTool(
private val cachedContextService: CachedContextService,
) : AITool {
@Tool(description = "Kill a user in current thread by their ID, warning: will cause serious harm and health issues to the user, use with caution")
fun killUser(userId: String, context: ToolContext): String {
fun killUser(userId: String, reason: String, context: ToolContext): String {
val event = checkNotNull(context.context["messageEvent"] as? MessageEvent)
val user = runBlocking {
cachedContextService.getThread(event.connectorInfo.connectorType, event.threadId)
Expand All @@ -23,13 +23,13 @@ class KillUserTool(
} ?: return "Thread or user not found."

runBlocking {
val base = "Zabiłem użytkownika "
val base = "Zabiłem "
val mention = '@' + user.customizedName.ifEmpty { user.name }

contextHolder[event.connectorInfo.connectorType].send(
Response(
event,
text = base + mention,
text = "$base$mention z powodu: $reason",
mentions = listOf(
mention {
threadId = userId
Expand Down
Loading