1
0
Fork 0
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:
Maximilian von Lindern 2021-05-30 23:16:16 +02:00 committed by GitHub
parent c45096c9fa
commit df5954d2e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View file

@ -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
}

View file

@ -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,

View file

@ -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},

View file

@ -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

View file

@ -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