diff options
| author | Zeyla Hellyer <[email protected]> | 2017-05-05 17:09:39 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-05-05 17:11:31 -0700 |
| commit | ae352ea3df86eb2d853d5b1af048a95409aafc38 (patch) | |
| tree | b5701ee38a917c2483b09628d0e2ccf981bc1058 /src/model/guild | |
| parent | Add framework dynamic_prefix example (diff) | |
| download | serenity-ae352ea3df86eb2d853d5b1af048a95409aafc38.tar.xz serenity-ae352ea3df86eb2d853d5b1af048a95409aafc38.zip | |
Fix guild leaving result
When leaving a guild, `rest::leave_guild` would attempt to deserialize a
JSON body containing a partial amount of guild info, resulting in an
error:
```
Could not leave guild: Json(ErrorImpl { code: EofWhileParsingValue, line: 1, column: 0 })
```
Although the bot would still actually leave the guild, it would always
return this error.
To fix this, don't try to deserialize anything and only check for a 204
instead.
Diffstat (limited to 'src/model/guild')
| -rw-r--r-- | src/model/guild/guild_id.rs | 2 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 2 | ||||
| -rw-r--r-- | src/model/guild/partial_guild.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index 6e5cb3a..d1866ed 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -356,7 +356,7 @@ impl GuildId { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result<PartialGuild> { + pub fn leave(&self) -> Result<()> { rest::leave_guild(self.0) } diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 0daeec1..6757d98 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -642,7 +642,7 @@ impl Guild { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result<PartialGuild> { + pub fn leave(&self) -> Result<()> { self.id.leave() } diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 8c1113b..3635a7a 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -350,7 +350,7 @@ impl PartialGuild { /// Leaves the guild. #[inline] - pub fn leave(&self) -> Result<PartialGuild> { + pub fn leave(&self) -> Result<()> { self.id.leave() } |