Skip to content

feat: add original message formatting helpers with tests#461

Open
fluffur wants to merge 3 commits into
gotd:mainfrom
fluffur:add-get-html-and-md-message-methods
Open

feat: add original message formatting helpers with tests#461
fluffur wants to merge 3 commits into
gotd:mainfrom
fluffur:add-get-html-and-md-message-methods

Conversation

@fluffur

@fluffur fluffur commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Example

msg := &botapi.Message{
	Text: "Hello world",
	Entities: []botapi.MessageEntity{
		{
			Type:   botapi.EntityBold,
			Offset: 6,
			Length: 5,
		},
	},
}

fmt.Println(msg.OriginalMD())    // Hello *world*
fmt.Println(msg.OriginalMDV2())  // Hello *world*
fmt.Println(msg.OriginalHTML())  // Hello <b>world</b>

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.82927% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.63%. Comparing base (ec97c6a) to head (f1e6929).

Files with missing lines Patch % Lines
formatting.go 66.82% 57 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #461      +/-   ##
==========================================
- Coverage   78.89%   78.63%   -0.27%     
==========================================
  Files         118      119       +1     
  Lines        8359     8564     +205     
==========================================
+ Hits         6595     6734     +139     
- Misses       1237     1293      +56     
- Partials      527      537      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant