internal OptionalSnowflakeEntity(Snowflake id) { Id = id; _value = default; HasValue = false; }
public CachedGuild GetGuild(Snowflake id) => State.GetGuild(id);
/// <summary> /// Looks up the user cache for the <see cref="CachedUser"/> with the given id. /// </summary> /// <param name="id"> The id of the user. </param> /// <returns> /// The found <see cref="CachedUser"/> or <see langword="null"/>. /// </returns> public CachedUser GetUser(Snowflake id) => State.GetUser(id);
public static string Role(Snowflake id) => $"<@&{id}>";
public CachedUserMessage GetMessage(Snowflake channelId, Snowflake messageId) => State.GetMessage(channelId, messageId);
public async Task PinMessageAsync(Snowflake messageId, RestRequestOptions options = null) { await Client.PinMessageAsync(Id, messageId, options).ConfigureAwait(false); LastPinTimestamp = DateTimeOffset.UtcNow; }
public static string User(Snowflake id, bool hasNick = false) => hasNick ? $"<@!{id}>" : $"<@{id}>";
internal void AddOrUpdateNote(Snowflake id, string note, Func <Snowflake, string, string> func) { _notes.AddOrUpdate(id, note, func); }
public LocalReferenceBuilder WithMessageId(Snowflake messageId) { MessageId = messageId; return(this); }
public static bool TryParseUser(ReadOnlySpan <char> value, out Snowflake result) { result = 0; return(value.Length > 3 && value[0] == '<' && value[1] == '@' && value[^ 1] == '>' && Snowflake.TryParse(value[2] == '!' ? value[3..^ 1] : value[2..^ 1], out result));
public TransientGuildEmoji(IClient client, Snowflake guildId, EmojiJsonModel model) : base(client, model) { GuildId = guildId; }
public static bool TryParseUser(string value, out Snowflake result) { Guard.IsNotNull(value); return(TryParseUser(value.AsSpan(), out result)); }
internal CachedSnowflakeEntity(DiscordClientBase client, Snowflake id) : base(client) { Id = id; }
internal OptionalSnowflakeEntity(T value, Snowflake id) { _value = value; Id = id; HasValue = value != null; }
public Task <IReadOnlyList <RestUser> > GetReactionsAsync(Snowflake messageId, IEmoji emoji, int limit = 100, Snowflake?startFromId = null, RestRequestOptions options = null) => Client.GetReactionsAsync(Id, messageId, emoji, limit, startFromId, options);
public TransientIntegration(IClient client, Snowflake guildId, IntegrationJsonModel model) : base(client, model) { GuildId = guildId; }
public Task <RestUserMessage> ModifyMessageAsync(Snowflake messageId, Action <ModifyMessageProperties> action, RestRequestOptions options = null) => Client.ModifyMessageAsync(Id, messageId, action, options);
public TransientVanityInvite(IClient client, Snowflake guildId, InviteJsonModel model) : base(client, model) { GuildId = guildId; }
public Task UnpinMessageAsync(Snowflake messageId, RestRequestOptions options = null) => Client.UnpinMessageAsync(Id, messageId, options);
internal DownloadableOptionalSnowflakeEntity(Snowflake id, RestDownloadableDelegate <TDownloadable> func) : this(null, id, func) { }
public static string TextChannel(Snowflake id) => $"<#{id}>";
internal DownloadableOptionalSnowflakeEntity(T value, Snowflake id, RestDownloadableDelegate <TDownloadable> func) : base(value, id) { Downloadable = new RestDownloadable <TDownloadable>(func); }
public LocalOverwrite(Snowflake targetId, OverwriteTargetType targetType, OverwritePermissions permissions) { TargetId = targetId; TargetType = targetType; Permissions = permissions; }
public Task <RestMessage> GetMessageAsync(Snowflake messageId, RestRequestOptions options = null) => Client.GetMessageAsync(Id, messageId, options);
public IReadOnlyList <CachedUserMessage> GetMessages(Snowflake channelId) => State.GetMessages(channelId);
public Task RemoveOwnReactionAsync(Snowflake messageId, IEmoji emoji, RestRequestOptions options = null) => Client.RemoveOwnReactionAsync(Id, messageId, emoji, options);
public CachedGuildChannel GetGuildChannel(Snowflake id) => State.GetGuildChannel(id);
public RestRequestEnumerable <RestUser> GetReactionsEnumerable(Snowflake messageId, IEmoji emoji, int limit, Snowflake?startFromId = null, RestRequestOptions options = null) => Client.GetReactionsEnumerable(Id, messageId, emoji, limit, startFromId, options);
public CachedPrivateChannel GetPrivateChannel(Snowflake id) => State.GetPrivateChannel(id);
public static TMessage AddStickerId <TMessage>(this TMessage message, Snowflake stickerId) where TMessage : LocalMessageBase { message._stickerIds.Add(stickerId); return(message); }