mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-21 03:57:26 +00:00
all: Revert incorrect "GuildID" changes (#211)
This commit is contained in:
parent
c45096c9fa
commit
df5954d2e1
|
@ -29,7 +29,7 @@ func AdminOnly(ctx *bot.Context) func(interface{}) error {
|
|||
|
||||
func GuildOnly(ctx *bot.Context) func(interface{}) error {
|
||||
return func(ev interface{}) error {
|
||||
// Try and infer the GuildIDs.
|
||||
// Try and infer the GuildID.
|
||||
if guildID := infer.GuildID(ev); guildID.IsValid() {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ func TestGuildOnly(t *testing.T) {
|
|||
}
|
||||
var middleware = GuildOnly(ctx)
|
||||
|
||||
t.Run("allow message with GuildIDs", func(t *testing.T) {
|
||||
t.Run("allow message with GuildID", func(t *testing.T) {
|
||||
var msg = &gateway.MessageCreateEvent{
|
||||
Message: discord.Message{
|
||||
ID: 3,
|
||||
|
|
|
@ -247,7 +247,7 @@ func ConvertSupplementalMember(sm SupplementalMember) discord.Member {
|
|||
}
|
||||
|
||||
// ConvertSupplementalPresence converts a SupplementalPresence to a regular
|
||||
// Presence with an empty GuildIDs.
|
||||
// Presence with an empty GuildID.
|
||||
func ConvertSupplementalPresence(sp SupplementalPresence) Presence {
|
||||
return Presence{
|
||||
User: discord.User{ID: sp.UserID},
|
||||
|
|
|
@ -625,7 +625,7 @@ func (s *State) Messages(channelID discord.ChannelID) ([]discord.Message, error)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// New messages fetched weirdly does not have GuildIDs filled. We'll try and
|
||||
// New messages fetched weirdly does not have GuildID filled. We'll try and
|
||||
// get it for consistency with incoming message creates.
|
||||
var guildID discord.GuildID
|
||||
|
||||
|
|
|
@ -10,10 +10,10 @@ import (
|
|||
|
||||
var (
|
||||
// ErrMissingForIdentify is an error when we are missing information to identify.
|
||||
ErrMissingForIdentify = errors.New("missing GuildIDs, UserID, SessionID, or Token for identify")
|
||||
ErrMissingForIdentify = errors.New("missing GuildID, UserID, SessionID, or Token for identify")
|
||||
|
||||
// ErrMissingForResume is an error when we are missing information to resume.
|
||||
ErrMissingForResume = errors.New("missing GuildIDs, SessionID, or Token for resuming")
|
||||
ErrMissingForResume = errors.New("missing GuildID, SessionID, or Token for resuming")
|
||||
)
|
||||
|
||||
// OPCode 0
|
||||
|
|
Loading…
Reference in a new issue