Obtains the ID of the provided guild.
@param \CharlotteDunois\Yasmin\Models\Guild|string|int|null  $guild
@return string
@throws \InvalidArgumentException
165229
function getGuildID($guild) {
        if($guild === null || $guild === 'global') {
            return 'global';
        }
        
        return $this->client->guilds->resolve($guild)->id;
    }
633931
public function get(string $identifier): \Psr\Log\LoggerInterface
    {
        if (isset($this->instances[$identifier])) {
            return $this->instances[$identifier];
        }

        if (!isset($this->configuration[$identifier])) {
            throw new \InvalidArgumentException(sprintf('The given log identifier "%s" was not configured for the "%s" factory.', htmlspecialchars($identifier), self::class), 1515355505545);
        }

        if (!class_exists(Logger::class)) {
            throw new \Exception('To use the default logging you have to have the "neos/flow-log" package installed. It seems you miss it, so install it via "composer require neos/flow-log".', 1515437383589);
        }

        $backends = $this->instantiateBackends($this->configuration[$identifier]);

        $logger = new Logger($backends);
        $this->instances[$identifier] = $logger;
        return $logger;
    }
1070381
public function slot($slot = null)
    {
        if (is_null($slot)) {
            return $this->slot;
        }

        if (! in_array($slot, ['before', 'after'])) {
            throw new InvalidArgumentException(
                "{$slot} is an invalid gate slot"
            );
        }

        $this->slot = $slot;

        return $this;
    }
1283164
public function edit($guildId, $options = [])
    {
        $image = new Image();
        $guild = $this->show($guildId);
        $json['name'] = isset($options['name']) ? $options['name'] : $guild['name'];
        $json['region'] = isset($options['region']) ? $options['region'] : $guild['region'];
        $json['icon'] = isset($options['icon']) ? $image->encodeImage($options['icon']) : $guild['icon'];
        $json['afk_channel_id'] = isset($options['afk_channel_id']) ? $options['afk_channel_id'] : $guild['afk_channel_id'];

        return $this->request('PATCH', 'guilds/' . $guildId, [
            'json' => $json
        ]);
    }
830278
public function getID(): ?string
    {
        $sessionKey = $this->getSessionKey();
        if (strlen($sessionKey) === 0) {
            return null;
        }
        $cacheKey = 'id-' . $sessionKey;
        if (!isset(self::$cache[$cacheKey])) {
            self::$cache[$cacheKey] = null;
            $data = Internal\Data::getValue('.temp/bearcms/userkeys/' . md5($sessionKey));
            if ($data !== null) {
                self::$cache[$cacheKey] = $data;
            }
        }
        return self::$cache[$cacheKey];
    }
251781
function setupGuild($guild) {
        $guild = $this->getGuildID($guild);
        
        $settings = $this->settings->get($guild);
        if(!$settings) {
            $this->create($guild)->done(null, array($this->client, 'handlePromiseRejection'));
            return;
        }
        
        $this->setup[$guild] = true;
        
        if($guild === 'global' && \array_key_exists('commandPrefix', $settings)) {
            $this->client->setCommandPrefix($settings['commandPrefix'], true);
        }
        
        foreach($this->client->registry->commands as $command) {
            $this->setupGuildCommand($guild, $command, $settings);
        }
        
        foreach($this->client->registry->groups as $group) {
            $this->setupGuildGroup($guild, $group, $settings);
        }
        
        unset($this->setup[$guild]);
    }
532084
function remove($guild, string $key) {
        $guild = $this->getGuildID($guild);
        
        if($this->settings->get($guild) === null) {
            $this->client->emit('warn', 'Settings of specified guild is not loaded - loading row');
            
            return $this->create($guild)->then(function () use ($guild, $key) {
                $settings = $this->settings->get($guild);
                unset($settings[$key]);
            
                return $this->db->execute('UPDATE settings SET settings = ? WHERE guild = ?', array(\json_encode($settings), $guild));
            });
        }
        
        $settings = $this->settings->get($guild);
        unset($settings[$key]);
        
        return $this->db->execute('UPDATE settings SET settings = ? WHERE guild = ?', array(\json_encode($settings), $guild));
    }
803127
public function getNamesForDomain($domain)
    {
        if (!isset($this->templates[$domain])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown template domain "%s"',
                $domain
            ));
        }

        return array_keys($this->templates[$domain]);
    }
911502
public function getItagInfo($itag)
	{
		$itag = '' . $itag;
		$itags = $this->getItags();

		if (property_exists($itags, $itag))
			return $itags->$itag;

		return null;
	}
676422
public function getId($alias)
    {
        if (!isset($this->aliases[$alias])) {
            return null;
        }

        $id = $this->aliases[$alias];
        while (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return $id;
    }
480027
public function getGuildMember4GuildId($guildId)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p', 'character')
            ->join('p.character', 'character')
            ->where('p.guild = :guild')
            ->setParameter('guild', $guildId)
            ->orderBy('p.memberClass', 'asc')
            ->addOrderBy('p.level', 'desc');

        return $query->getQuery()->getResult();
    }
1262120
public function getTerritoryID($id)
	{
		// normalize id
		$id = $this->getCanonicalID($id);
		// find sub tags
		if (($underscorePosition=strpos($id, '_'))!== false)
		{
			$subTag = explode('_', $id);
			// territory sub tags can be distinguished from script sub tags by length
			if (isset($subTag[2]) && strlen($subTag[2])<4)
			{
				$id = $subTag[2];
			}
			elseif (strlen($subTag[1])<4)
			{
				$id = $subTag[1];
			}
			else
			{
				$id = null;
			}
		}
		else
		{
			$id = null;
		}
		return $id;
	}
90942
public function id($id = null)
    {
        if ($id) {
            if (!$this->isValidId($id)) {
                throw new \InvalidArgumentException('$id may contain only [a-zA-Z0-9-_]');
            }
            if ($this->id) {
                throw new Exception('Cannot set id while session is active');
            }
            $this->requestedId = $id;
        }
        return $this->id;
    }
1248063
public static function getId($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->id;
        }
        else
        {
            return null;
        }
    }
968999
public function get($key = null)
    {
        if ($key) {

            if (isset($_GET[$key])) {
                return $_GET[$key];
            }

            throw new \InvalidArgumentException(sprintf(
                '%s ist not a valid key for $_GET', $key
            ));

        }

        return $_GET;
    }
350800
protected function parseRoleId($role)
    {
        if ( is_string($role) || is_numeric($role) ) {

            $model = config('acl.role', 'Kodeine\Acl\Models\Eloquent\Role');
            $key = is_numeric($role) ? 'id' : 'slug';
            $alias = (new $model)->where($key, $role)->first();

            if ( ! is_object($alias) || ! $alias->exists ) {
                throw new \InvalidArgumentException('Specified role ' . $key . ' does not exists.');
            }

            $role = $alias->getKey();
        }

        $model = '\Illuminate\Database\Eloquent\Model';
        if ( is_object($role) && $role instanceof $model ) {
            $role = $role->getKey();
        }

        return (int) $role;
    }
477
public function getMemberAttribute()
    {
        $guild = $this->discord->guilds->get('id', $this->guild_id);

        return $guild->members->get('id', $this->user_id);
    }