Skip to content

Instantly share code, notes, and snippets.

@Arzte
Last active November 11, 2018 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arzte/b68ebbb8fd5ca093504ba0465ca625d1 to your computer and use it in GitHub Desktop.
Save Arzte/b68ebbb8fd5ca093504ba0465ca625d1 to your computer and use it in GitHub Desktop.
command!(guild(_ctx, msg, args) {
let g = match GuildId(args.single::<u64>()?).to_partial_guild() {
Ok(partial_guild) => partial_guild,
Err(arg_error) => {
msg.channel_id.say(format!("Error when phrasing argument for guildID: {:?}", arg_error))?;
return Ok(())
},
};
msg.channel_id.send_message(|m| {
m.embed(|e| {
let mut e = e
.title(&g.name)
.field("ID", &g.id, true)
.field("Name", &g.name, true)
.field("Owner", format!("<{}>", &g.owner_id.as_u64()), true);
if let Some(icon) = &g.icon {
e = e.image(&icon).thumbnail(&icon);
}
e
})
}).unwrap();
});
thread 'serenity client' panicked at 'called `Result::unwrap()` on an `Err` value: Http(UnsuccessfulRequest(Response { status: BadRequest, headers: Headers { Date: Sun, 11 Nov 2018 06:34:31 GMT
, Content-Type: application/json
, Content-Length: 20
, Connection: keep-alive
, Set-Cookie: __cfduid=d6bf186156e1a409ac2c51267240fe41f1541918071; expires=Mon, 11-Nov-19 06:34:31 GMT; path=/; domain=.discordapp.com; HttpOnly
, Strict-Transport-Security: max-age=31536000; includeSubDomains
, X-RateLimit-Limit: 5
, X-RateLimit-Remaining: 4
, X-RateLimit-Reset: 1541918077
, Via: 1.1 google
, Alt-Svc: clear
, Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
, Server: cloudflare
, CF-RAY: 477ebbcb7b8c55ee-ORD
, }, version: Http11, url: "https://discordapp.com/api/v6/channels/381926291785383946/messages", status_raw: RawStatus(400, "BAD REQUEST"), message: Http11Message { is_proxied: false, method: None, stream: Wrapper { obj: Some(Reading(SizedReader(remaining=20))) } } }))', libcore\result.rs:1009:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment