-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow unmuting proposals (#94)
* feat: allow unmuting proposals * chore: add OTLP tracing configuration
- Loading branch information
1 parent
96ce288
commit 5cb4556
Showing
9 changed files
with
158 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package telegram | ||
|
||
import ( | ||
tele "gopkg.in/telebot.v3" | ||
) | ||
|
||
func (reporter *Reporter) HandleDeleteMute(c tele.Context) error { | ||
reporter.Logger.Info(). | ||
Str("sender", c.Sender().Username). | ||
Str("text", c.Text()). | ||
Msg("Got delete mute query") | ||
|
||
mute, err := ParseMuteDeleteOptions(c.Text(), c) | ||
if err != "" { | ||
return c.Reply("Error deleting mute: " + err) | ||
} | ||
|
||
if found := reporter.MutesManager.DeleteMute(mute); !found { | ||
return c.Reply("Could not find the mute to delete!") | ||
} | ||
|
||
templateRendered, renderErr := reporter.TemplatesManager.Render("mute_deleted", mute) | ||
if renderErr != nil { | ||
reporter.Logger.Error().Err(renderErr).Msg("Error rendering template") | ||
return reporter.BotReply(c, "Error rendering template") | ||
} | ||
|
||
return reporter.BotReply(c, templateRendered) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Deleted mute with the following params: | ||
{{- if .Chain }} | ||
<strong>Chain:</strong> {{ .Chain }} | ||
{{- else }} | ||
<strong>Chain:</strong> all chains | ||
{{- end }} | ||
{{- if .ProposalID }} | ||
<strong>Proposal ID:</strong> {{ .ProposalID }} | ||
{{- else }} | ||
<strong>Proposal ID:</strong> all proposals | ||
{{- end }} |