Skip to content

Commit c632c67

Browse files
committed
fix(discord): embed title
1 parent 529125c commit c632c67

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

acarshub.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ func ReadACARSHubVDLM2Messages() {
161161
}
162162
}
163163

164-
// Returns if the string is empty or if it only contains nonprintable characters
165-
func AircraftOrTower(s string) (r string) {
166-
if b, _ := regexp.MatchString("\\S+", s); b {
164+
// Returns Tower if the flightNumber has any text
165+
func AircraftOrTower(fightNumber string) string {
166+
if b, _ := regexp.MatchString("\\S+", fightNumber); b {
167167
return "Aircraft"
168168
}
169169
return "Tower"

config_all_options.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ Steps:
157157
TailCode: N999AP
158158
# Only process messages that have one of these labels
159159
Labels:
160-
- 87
161-
- 85
162-
- 81
160+
- H1
163161
# Only process messages that have this flight number.
164162
FlightNumber: N999AP
165163
# Only process messages that have ASS Status.

filter_builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type BuiltinFilter struct {
5959
// Only process messages that have this tail code.
6060
TailCode string `json:",omitempty" default:"N999AP"`
6161
// Only process messages that have one of these labels
62-
Labels []string `json:",omitempty" default:"[87,85,81]"`
62+
Labels []string `json:",omitempty" default:"[H1]"`
6363
// Only process messages that have this flight number.
6464
FlightNumber string `json:",omitempty" default:"N999AP"`
6565
// Only process messages that have ASS Status.

receiver_discord.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (d DiscordReceiver) Send(m APMessage) error {
153153

154154
for _, key := range keys {
155155
v := fmt.Sprintf("%v", m[key])
156-
if ts, _ := regexp.Compile(".*[Tt]ail[Cc]ode"); ts.Match([]byte(key)) {
156+
if ts, _ := regexp.Compile(".*[Ff]light[Nn]umber"); ts.Match([]byte(key)) {
157157
transmitter = " from " + AircraftOrTower(v)
158158
}
159159
if ts, _ := regexp.Compile(".*[Tt]humbnail[Ll]ink"); ts.Match([]byte(key)) {

0 commit comments

Comments
 (0)