Documentation ¶
Index ¶
- Variables
- type Provider
- type ReportError
- type ReportService
- func (r *ReportService) ExpireExpiredReports() (mErr *multierror.MultiError)
- func (r *ReportService) ExpireLastReport(guildID, victimID string, typ models.ReportType) (err error)
- func (r *ReportService) PushBan(rep models.Report) (models.Report, error)
- func (r *ReportService) PushKick(rep models.Report) (models.Report, error)
- func (r *ReportService) PushMute(rep models.Report) (models.Report, error)
- func (r *ReportService) PushReport(rep models.Report) (models.Report, error)
- func (r *ReportService) RevokeMute(guildID, executorID, victimID, reason string) (emb *discordgo.MessageEmbed, err error)
- func (r *ReportService) RevokeReport(rep models.Report, executorID string, reason string, wsPublicAddr string) (emb *discordgo.MessageEmbed, err error)
- func (r *ReportService) UnbanReport(unbanReq models.UnbanRequest, executorID string, reason string, isUnban bool) (emb *discordgo.MessageEmbed, err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { PushReport(rep models.Report) (models.Report, error) PushKick(rep models.Report) (models.Report, error) PushBan(rep models.Report) (models.Report, error) PushMute(rep models.Report) (models.Report, error) RevokeMute(guildID, executorID, victimID, reason string) (emb *discordgo.MessageEmbed, err error) RevokeReport(rep models.Report, executorID, reason, wsPublicAddr string, ) (emb *discordgo.MessageEmbed, err error) UnbanReport( unbanReq models.UnbanRequest, executorID string, reason string, isUnban bool, ) (emb *discordgo.MessageEmbed, err error) ExpireLastReport(guildID, victimID string, typ models.ReportType) (err error) ExpireExpiredReports() (mErr *multierror.MultiError) }
type ReportError ¶
type ReportService ¶
type ReportService struct {
// contains filtered or unexported fields
}
func New ¶
func New(container di.Container) (t *ReportService, err error)
func (*ReportService) ExpireExpiredReports ¶
func (r *ReportService) ExpireExpiredReports() (mErr *multierror.MultiError)
func (*ReportService) ExpireLastReport ¶
func (r *ReportService) ExpireLastReport(guildID, victimID string, typ models.ReportType) (err error)
func (*ReportService) PushBan ¶
PushBan is shorthand for PushReport as member ban action and also bans the member from the guild with the given reason and case ID for the audit log.
func (*ReportService) PushKick ¶
PushKick is shorthand for PushReport as member kick action and also kicks the member from the guild with the given reason and case ID for the audit log.
func (*ReportService) PushMute ¶
PushMute is shorthand for PushReport as member mute action and also adds the mute role to the specified victim.
func (*ReportService) PushReport ¶
PushReport creates a new Report object with the given executorID, victimID, reason, attachmentID, and typ. The report is saved to the database using the passed db databse rpovider and an embed is created with the attachment url assembled with publicAddr as image endpoint root. This embed is then sent to the specified mod log channel for this guild, if existent.
func (*ReportService) RevokeMute ¶
func (r *ReportService) RevokeMute(guildID, executorID, victimID, reason string) (emb *discordgo.MessageEmbed, err error)
RevokeMute removes the mute role of the specified victim and sends an unmute embed to the users DMs and to the mod log channel.
func (*ReportService) RevokeReport ¶
func (r *ReportService) RevokeReport( rep models.Report, executorID string, reason string, wsPublicAddr string, ) (emb *discordgo.MessageEmbed, err error)
func (*ReportService) UnbanReport ¶
func (r *ReportService) UnbanReport( unbanReq models.UnbanRequest, executorID string, reason string, isUnban bool, ) (emb *discordgo.MessageEmbed, err error)