mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 17:33:48 +01:00
Fix version command output
This commit is contained in:
parent
2742d90299
commit
dbdd3258b2
1 changed files with 5 additions and 4 deletions
|
@ -206,13 +206,13 @@ func (handler *CommandHandler) CommandDevTest(_ *CommandEvent) {
|
|||
const cmdVersionHelp = `version - View the bridge version`
|
||||
|
||||
func (handler *CommandHandler) CommandVersion(ce *CommandEvent) {
|
||||
version := fmt.Sprintf("v%s.unknown", Version)
|
||||
linkifiedVersion := fmt.Sprintf("v%s", Version)
|
||||
if Tag == Version {
|
||||
version = fmt.Sprintf("[v%s](%s/releases/v%s) (%s)", Version, URL, Tag, BuildTime)
|
||||
linkifiedVersion = fmt.Sprintf("[v%s](%s/releases/v%s)", Version, URL, Tag)
|
||||
} else if len(Commit) > 8 {
|
||||
version = fmt.Sprintf("v%s.[%s](%s/commit/%s) (%s)", Version, Commit[:8], URL, Commit, BuildTime)
|
||||
linkifiedVersion = strings.Replace(linkifiedVersion, Commit[:8], fmt.Sprintf("[%s](%s/commit/%s)", Commit[:8], URL, Commit), 1)
|
||||
}
|
||||
ce.Reply(fmt.Sprintf("[%s](%s) %s", Name, URL, version))
|
||||
ce.Reply(fmt.Sprintf("[%s](%s) %s (%s)", Name, URL, linkifiedVersion, BuildTime))
|
||||
}
|
||||
|
||||
const cmdInviteLinkHelp = `invite-link - Get an invite link to the current group chat.`
|
||||
|
@ -606,6 +606,7 @@ func (handler *CommandHandler) CommandHelp(ce *CommandEvent) {
|
|||
|
||||
ce.Reply("* " + strings.Join([]string{
|
||||
cmdPrefix + cmdHelpHelp,
|
||||
cmdPrefix + cmdVersionHelp,
|
||||
cmdPrefix + cmdLoginHelp,
|
||||
cmdPrefix + cmdLogoutHelp,
|
||||
cmdPrefix + cmdDeleteSessionHelp,
|
||||
|
|
Loading…
Reference in a new issue