mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2025-03-24 02:49:20 +00:00
Bumped cchat
This commit is contained in:
parent
b6694ea24a
commit
1907986ceb
2
go.mod
2
go.mod
|
@ -4,7 +4,7 @@ go 1.14
|
|||
|
||||
require (
|
||||
github.com/diamondburned/arikawa v1.3.0
|
||||
github.com/diamondburned/cchat v0.2.12
|
||||
github.com/diamondburned/cchat v0.3.1
|
||||
github.com/diamondburned/ningen v0.1.1-0.20200820222640-35796f938a58
|
||||
github.com/dustin/go-humanize v1.0.0
|
||||
github.com/go-test/deep v1.0.7
|
||||
|
|
4
go.sum
4
go.sum
|
@ -84,6 +84,10 @@ github.com/diamondburned/cchat v0.2.11 h1:w4c/6t02htGtVj6yIjznecOGMlkcj0TmmLy+K4
|
|||
github.com/diamondburned/cchat v0.2.11/go.mod h1:IlMtF+XIvAJh0GL/2yFdf0/34w+Hdy5A1GgvSwAXtQI=
|
||||
github.com/diamondburned/cchat v0.2.12 h1:R4wrBdhELMfhv2Kn3xL/H3ci8UcLXzFRPq1IrY4+js4=
|
||||
github.com/diamondburned/cchat v0.2.12/go.mod h1:IlMtF+XIvAJh0GL/2yFdf0/34w+Hdy5A1GgvSwAXtQI=
|
||||
github.com/diamondburned/cchat v0.3.0 h1:xC8Y+/nwsVhc4a7i7R+4n0JczOnFSA2Gmj6Bz/pZ5zo=
|
||||
github.com/diamondburned/cchat v0.3.0/go.mod h1:IlMtF+XIvAJh0GL/2yFdf0/34w+Hdy5A1GgvSwAXtQI=
|
||||
github.com/diamondburned/cchat v0.3.1 h1:7NbVjT50dmLxcHPm+eDFF5jcaZw3t/9IdSEkZ/md1Rg=
|
||||
github.com/diamondburned/cchat v0.3.1/go.mod h1:IlMtF+XIvAJh0GL/2yFdf0/34w+Hdy5A1GgvSwAXtQI=
|
||||
github.com/diamondburned/ningen v0.1.1-0.20200621014632-6babb812b249 h1:yP7kJ+xCGpDz6XbcfACJcju4SH1XDPwlrvbofz3lP8I=
|
||||
github.com/diamondburned/ningen v0.1.1-0.20200621014632-6babb812b249/go.mod h1:xW9hpBZsGi8KpAh10TyP+YQlYBo+Xc+2w4TR6N0951A=
|
||||
github.com/diamondburned/ningen v0.1.1-0.20200708085949-b64e350f3b8c h1:3h/kyk6HplYZF3zLi106itjYJWjbuMK/twijeGLEy2M=
|
||||
|
|
|
@ -23,7 +23,7 @@ const (
|
|||
|
||||
var ErrUnknownAction = errors.New("unknown message action")
|
||||
|
||||
func (ac Actioner) DoAction(action, id string) error {
|
||||
func (ac Actioner) Do(action, id string) error {
|
||||
s, err := discord.ParseSnowflake(id)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to parse ID")
|
||||
|
|
|
@ -18,11 +18,7 @@ func New(ch *shared.Channel) cchat.Backlogger {
|
|||
return Backlogger{ch}
|
||||
}
|
||||
|
||||
func (bl Backlogger) MessagesBefore(
|
||||
ctx context.Context,
|
||||
b cchat.ID,
|
||||
c cchat.MessagesContainer) error {
|
||||
|
||||
func (bl Backlogger) Backlog(ctx context.Context, b cchat.ID, c cchat.MessagesContainer) error {
|
||||
p, err := discord.ParseSnowflake(b)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to parse snowflake")
|
||||
|
|
|
@ -15,9 +15,9 @@ func New(ch *shared.Channel) cchat.Editor {
|
|||
return Editor{ch}
|
||||
}
|
||||
|
||||
// MessageEditable returns true if the given message ID belongs to the current
|
||||
// IsEditable returns true if the given message ID belongs to the current
|
||||
// user.
|
||||
func (ed Editor) MessageEditable(id string) bool {
|
||||
func (ed Editor) IsEditable(id string) bool {
|
||||
s, err := discord.ParseSnowflake(id)
|
||||
if err != nil {
|
||||
return false
|
||||
|
@ -31,8 +31,8 @@ func (ed Editor) MessageEditable(id string) bool {
|
|||
return m.Author.ID == ed.State.UserID
|
||||
}
|
||||
|
||||
// RawMessageContent returns the raw message content from Discord.
|
||||
func (ed Editor) RawMessageContent(id string) (string, error) {
|
||||
// RawContent returns the raw message content from Discord.
|
||||
func (ed Editor) RawContent(id string) (string, error) {
|
||||
s, err := discord.ParseSnowflake(id)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "Failed to parse ID")
|
||||
|
@ -46,8 +46,8 @@ func (ed Editor) RawMessageContent(id string) (string, error) {
|
|||
return m.Content, nil
|
||||
}
|
||||
|
||||
// EditMessage edits the message to the given content string.
|
||||
func (ed Editor) EditMessage(id, content string) error {
|
||||
// Edit edits the message to the given content string.
|
||||
func (ed Editor) Edit(id, content string) error {
|
||||
s, err := discord.ParseSnowflake(id)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to parse ID")
|
||||
|
|
Loading…
Reference in a new issue