github.com/diamondburned/arikawa@v1.3.14/state/store_noop.go (about) 1 package state 2 3 import ( 4 "errors" 5 6 "github.com/diamondburned/arikawa/discord" 7 ) 8 9 // NoopStore could be embedded by other structs for partial state 10 // implementation. All Getters will return ErrNotImplemented, and all Setters 11 // will return no error. 12 type NoopStore struct{} 13 14 var _ Store = (*NoopStore)(nil) 15 16 var ErrNotImplemented = errors.New("state is not implemented") 17 18 func (NoopStore) Reset() error { 19 return nil 20 } 21 22 func (NoopStore) Me() (*discord.User, error) { 23 return nil, ErrNotImplemented 24 } 25 26 func (NoopStore) MyselfSet(discord.User) error { 27 return nil 28 } 29 30 func (NoopStore) Channel(discord.ChannelID) (*discord.Channel, error) { 31 return nil, ErrNotImplemented 32 } 33 34 func (NoopStore) Channels(discord.GuildID) ([]discord.Channel, error) { 35 return nil, ErrNotImplemented 36 } 37 38 func (NoopStore) CreatePrivateChannel(discord.UserID) (*discord.Channel, error) { 39 return nil, ErrNotImplemented 40 } 41 42 func (NoopStore) PrivateChannels() ([]discord.Channel, error) { 43 return nil, ErrNotImplemented 44 } 45 46 func (NoopStore) ChannelSet(discord.Channel) error { 47 return nil 48 } 49 50 func (NoopStore) ChannelRemove(discord.Channel) error { 51 return nil 52 } 53 54 func (NoopStore) Emoji(discord.GuildID, discord.EmojiID) (*discord.Emoji, error) { 55 return nil, ErrNotImplemented 56 } 57 58 func (NoopStore) Emojis(discord.GuildID) ([]discord.Emoji, error) { 59 return nil, ErrNotImplemented 60 } 61 62 func (NoopStore) EmojiSet(discord.GuildID, []discord.Emoji) error { 63 return nil 64 } 65 66 func (NoopStore) Guild(discord.GuildID) (*discord.Guild, error) { 67 return nil, ErrNotImplemented 68 } 69 70 func (NoopStore) Guilds() ([]discord.Guild, error) { 71 return nil, ErrNotImplemented 72 } 73 74 func (NoopStore) GuildSet(discord.Guild) error { 75 return nil 76 } 77 78 func (NoopStore) GuildRemove(discord.GuildID) error { 79 return nil 80 } 81 82 func (NoopStore) Member(discord.GuildID, discord.UserID) (*discord.Member, error) { 83 return nil, ErrNotImplemented 84 } 85 86 func (NoopStore) Members(discord.GuildID) ([]discord.Member, error) { 87 return nil, ErrNotImplemented 88 } 89 90 func (NoopStore) MemberSet(discord.GuildID, discord.Member) error { 91 return nil 92 } 93 94 func (NoopStore) MemberRemove(discord.GuildID, discord.UserID) error { 95 return nil 96 } 97 98 func (NoopStore) Message(discord.ChannelID, discord.MessageID) (*discord.Message, error) { 99 return nil, ErrNotImplemented 100 } 101 102 func (NoopStore) Messages(discord.ChannelID) ([]discord.Message, error) { 103 return nil, ErrNotImplemented 104 } 105 106 // MaxMessages will always return 100 messages, so the API can fetch that 107 // many. 108 func (NoopStore) MaxMessages() int { 109 return 100 110 } 111 112 func (NoopStore) MessageSet(discord.Message) error { 113 return nil 114 } 115 116 func (NoopStore) MessageRemove(discord.ChannelID, discord.MessageID) error { 117 return nil 118 } 119 120 func (NoopStore) Presence(discord.GuildID, discord.UserID) (*discord.Presence, error) { 121 return nil, ErrNotImplemented 122 } 123 124 func (NoopStore) Presences(discord.GuildID) ([]discord.Presence, error) { 125 return nil, ErrNotImplemented 126 } 127 128 func (NoopStore) PresenceSet(discord.GuildID, discord.Presence) error { 129 return nil 130 } 131 132 func (NoopStore) PresenceRemove(discord.GuildID, discord.UserID) error { 133 return nil 134 } 135 136 func (NoopStore) Role(discord.GuildID, discord.RoleID) (*discord.Role, error) { 137 return nil, ErrNotImplemented 138 } 139 140 func (NoopStore) Roles(discord.GuildID) ([]discord.Role, error) { 141 return nil, ErrNotImplemented 142 } 143 144 func (NoopStore) RoleSet(discord.GuildID, discord.Role) error { 145 return nil 146 } 147 148 func (NoopStore) RoleRemove(discord.GuildID, discord.RoleID) error { 149 return nil 150 } 151 152 func (NoopStore) VoiceState(discord.GuildID, discord.UserID) (*discord.VoiceState, error) { 153 return nil, ErrNotImplemented 154 } 155 156 func (NoopStore) VoiceStates(discord.GuildID) ([]discord.VoiceState, error) { 157 return nil, ErrNotImplemented 158 } 159 160 func (NoopStore) VoiceStateSet(discord.GuildID, discord.VoiceState) error { 161 return ErrNotImplemented 162 } 163 164 func (NoopStore) VoiceStateRemove(discord.GuildID, discord.UserID) error { 165 return ErrNotImplemented 166 }