Function serenity::client::rest::create_guild [] [src]

pub fn create_guild(map: Value) -> Result<PartialGuild>

Creates a guild with the data provided.

Only a PartialGuild will be immediately returned, and a full Guild will be received over a Shard, if at least one is running.

Note: This endpoint is usually only available for user accounts. Refer to Discord's documentation for the endpoint here for more information. If your bot requires this, re-think what you are doing and whether it really needs to be doing this.

Examples

Create a guild called "test" in the US West region:

extern crate serde_json;

use serde_json::builder::ObjectBuilder;
use serde_json::Value;
use serenity::client::rest;

let map = ObjectBuilder::new()
    .insert("name", "test")
    .insert("region", "us-west")
    .build();

let _result = rest::create_guild(map);