/// <summary>
        /// Return a DateTimOffset object, which is
        /// a unique identifier for the server.
        /// </summary>
        /// <returns></returns>
        public DateTimeOffset getGuildTimeStamp()
        {
            ISnowflakeEntity sfid      = this._subject.Guild;
            DateTimeOffset   timestamp = sfid.CreatedAt;

            return(timestamp);
        }
Ejemplo n.º 2
0
        public EphemeralUser WithISnowflakeEntityData(ISnowflakeEntity user)
        {
            if (user is null)
            {
                return(this);
            }

            if (user.CreatedAt != default)
            {
                CreatedAt = user.CreatedAt;
            }

            return(WithIEntityData(user));
        }
Ejemplo n.º 3
0
        public T GetIdOf <T>(ISnowflakeEntity snowflakeEntity)
        {
            Type type = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T);

            //if (Nullable.GetUnderlyingType(typeof(T)) != null)
            //{
            //    if (snowflakeEntity == null)
            //        return default(T);
            //    return (T)Convert.ChangeType(snowflakeEntity.Id, typeof(T));
            //}
            //return (T)Convert.ChangeType(snowflakeEntity?.Id ?? default(ulong), typeof(T));
            return(snowflakeEntity == null ? default(T)
                : (T)Convert.ChangeType(snowflakeEntity.Id, type)
                   );
        }
Ejemplo n.º 4
0
 public DiscordEntityObject(ISnowflakeEntity entity)
 {
     this.entity = entity;
 }
Ejemplo n.º 5
0
 public Task RespondAsync(ISnowflakeEntity beforeInfo, ISnowflakeEntity afterInfo)
 {
     return(RespondAsync(beforeInfo as TEventInfo, afterInfo as TEventInfo));
 }
Ejemplo n.º 6
0
 public Task RespondAsync(ISnowflakeEntity eventInfo)
 {
     return(RespondAsync(eventInfo as TEventInfo));
 }