Skip to content

Commit

Permalink
Automatically inform of expansion change after jump call
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperManifolds committed Jul 21, 2022
1 parent 5604e6d commit 90ee706
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Sources/mechasqueak/Modules/AccountCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,17 @@ class AccountCommands: IRCBotModule {
command.message.reply(key: "useodyssey.odyssey", fromCommand: command, map: [
"name": currentRat.attributes.name.value
])

for rescue in await board.rescues {
if let jumpCall = rescue.value.jumpCalls.first(where: { $0.0 == currentRat && rescue.value.odyssey }) {
rescue.value.channel?.send(key: "jumpcall.change.odyssey", map: [
"caseId": rescue.key,
"name": command.message.user.nickname,
"jumps": jumpCall.1
])
break
}
}
} catch {
command.error(error)
}
Expand All @@ -392,6 +403,17 @@ class AccountCommands: IRCBotModule {
"name": currentRat.attributes.name.value
])
command.message.user.flush()

for rescue in await board.rescues {
if let jumpCall = rescue.value.jumpCalls.first(where: { $0.0 == currentRat && rescue.value.odyssey }) {
rescue.value.channel?.send(key: "jumpcall.change.horizons", map: [
"caseId": rescue.key,
"name": command.message.user.nickname,
"jumps": jumpCall.1
])
break
}
}
} catch {
command.error(error)
}
Expand Down
4 changes: 3 additions & 1 deletion localisation/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"jumpcall.publicpermit": "CAUTION: %{nick} does not have the %{permit} permit required by case #%{caseId}.",
"jumpcall.clientodyssey": "CAUTION: %{nick} called jumps for case #%{caseId} which is using Odyssey, but the rat is not marked as being an Odyssey user",
"jumpcall.ratodyssey": "CAUTION: %{nick} called jumps for case #%{caseId} which is NOT using Odyssey, but the rat is marked as being an Odyssey user",
"jumpcall.change.odyssey": "%{nick} has switched from Horizons to Odyssey (Called %{jumps} for Case #%{caseId})",
"jumpcall.change.horizons": "%{nick} has switched from Odyssey to Horizons (Called %{jumps} for Case #%{caseId})",

"systemsearch.noresults": "No results were found for this system.",
"systemsearch.nearestmatches": "Nearest matches for %{system} are %{results}.",
Expand Down Expand Up @@ -72,7 +74,7 @@
"board.nickcorrected": "Caution: Nickname of case #%{caseId} (%{client}) has been automatically corrected to %{newNick}",
"board.synced": "Successfully synced board with %{api}. %{updates}",
"board.sync.error": "\u0002Alert:\u0002 I am having trouble updating case #%{caseId} on the server, the dispatch board is no longer up to date. I will keep trying and let you know when the issue has been resolved.",
"board.sync.errorsolved": "The problems with syncing case #%{caseId} has been resolved.",
"board.sync.errorsolved": "The problems with syncing case #%{caseId} have been resolved.",
"board.synced.downstreamNew": {
"one": "%{count} new rescue was downloaded from the server",
"other": "%{count} new rescues were downloaded from the server"
Expand Down

0 comments on commit 90ee706

Please sign in to comment.