Skip to content

Commit

Permalink
fixes for v1.0.2-alpha
Browse files Browse the repository at this point in the history
fixes for v1.0.2-alpha
  • Loading branch information
Millefeuille42 authored Apr 5, 2024
2 parents dfde0eb + 28518fc commit 28b1626
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-publish-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-publish-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions cmd/bot/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func handlePlanetLiberated(event []byte) error {
embed.Title = fmt.Sprintf("✅ %s liberated", embed.Title)
return streamComplex(&discordgo.MessageSend{
Components: components.BuildPlanetComponent(planet),
Embeds: []*discordgo.MessageEmbed{embeds.BuildPlanetEmbed(planet)},
Embeds: []*discordgo.MessageEmbed{embed},
})
}

Expand All @@ -104,6 +104,6 @@ func handlePlanetLost(event []byte) error {
embed.Title = fmt.Sprintf("❌ %s lost to the %s", embed.Title, embeds.NameMap[planet.Owner])
return streamComplex(&discordgo.MessageSend{
Components: components.BuildPlanetComponent(planet),
Embeds: []*discordgo.MessageEmbed{embeds.BuildPlanetEmbed(planet)},
Embeds: []*discordgo.MessageEmbed{embed},
})
}
2 changes: 1 addition & 1 deletion cmd/bot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

func setBotStatus(status string) error {
return globals.Bot.UpdateListeningStatus(status)
return globals.Bot.UpdateListeningStatus(utils.StripMarkup(status, ""))
}

func setUpBot() *discordgo.Session {
Expand Down
4 changes: 2 additions & 2 deletions pkg/bot/embeds/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func BuildFeedEmbed(news lib.NewsMessage, color int) *discordgo.MessageEmbed {
return &discordgo.MessageEmbed{
Type: "rich",
Color: color,
Title: "Incoming message: " + utils.StripMarkup(title),
Description: utils.StripMarkup(desc),
Title: "Incoming message: " + utils.StripMarkup(title, "**"),
Description: utils.StripMarkup(desc, "**"),
}
}
4 changes: 2 additions & 2 deletions pkg/shared/utils/stripMarkup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "regexp"

var re = regexp.MustCompile("<[^>]*>")

func StripMarkup(text string) string {
return re.ReplaceAllString(text, "**")
func StripMarkup(text, replacement string) string {
return re.ReplaceAllString(text, replacement)
}

0 comments on commit 28b1626

Please sign in to comment.