Skip to content

Commit

Permalink
Fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
waybackarchiver committed Sep 1, 2024
1 parent 94a9824 commit aece446
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions publish/discord/discord_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
)

var (
now = time.Now()
token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
upgrader = websocket.Upgrader{}
channel = &discord.Channel{
Expand Down Expand Up @@ -59,8 +60,8 @@ var (
ID: messageID,
ChannelID: channelID,
Content: "https://example.com/",
Timestamp: discord.Timestamp("1625186466"),
EditedTimestamp: discord.Timestamp("1625186466"),
Timestamp: now,
EditedTimestamp: &now,
MentionRoles: []string{},
TTS: false,
MentionEveryone: false,
Expand Down
4 changes: 2 additions & 2 deletions service/discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ func (d *Discord) buttonHandlers() map[string]func(*discord.Session, *discord.In
s.ChannelTyping(i.Message.ChannelID)

i.Message.Content = helper.Byte2String(data)
d.process(&discord.MessageCreate{Message: i.Message}) // nolint:errcheck
s.InteractionResponseDelete(i.Interaction) // nolint:errcheck
d.process(&discord.MessageCreate{Message: i.Message}) // nolint:errcheck
s.InteractionResponseDelete(i.Interaction) // nolint:errcheck
},
}
}
Expand Down
5 changes: 3 additions & 2 deletions service/discord/discord_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
)

var (
now = time.Now()
upgrader = websocket.Upgrader{}
channel = &discord.Channel{
ID: channelID,
Expand All @@ -63,8 +64,8 @@ var (
ID: messageID,
ChannelID: channelID,
Content: "https://example.com/",
Timestamp: discord.Timestamp("1625186466"),
EditedTimestamp: discord.Timestamp("1625186466"),
Timestamp: now,
EditedTimestamp: &now,
MentionRoles: []string{},
TTS: false,
MentionEveryone: false,
Expand Down

0 comments on commit aece446

Please sign in to comment.