internal static SocketCommandBaseData Create(DiscordSocketClient client, Model model, ulong id, ulong?guildId)
        {
            var entity = new SocketCommandBaseData(client, model, guildId);

            entity.Update(model);
            return(entity);
        }
예제 #2
0
        internal SocketCommandBase(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
            : base(client, model.Id, channel)
        {
            var dataModel = model.Data.IsSpecified
                ? (DataModel)model.Data.Value
                : null;

            ulong?guildId = null;

            if (Channel is SocketGuildChannel guildChannel)
            {
                guildId = guildChannel.Guild.Id;
            }

            Data = SocketCommandBaseData.Create(client, dataModel, model.Id, guildId);
        }