private async Task InitializeAsync(string content, DateTimeOffset createTime, bool isSuccessfulCommand, ulong authorId, CollectionReference playerCollection, string docId) { Content = content; CreateTime = createTime; IsSuccessfulCommand = isSuccessfulCommand; RecentMessagesColl = playerCollection.Document(authorId.ToString()).Collection("recent-messages"); MessageDoc = RecentMessagesColl.Document(docId); if (!(await MessageDoc.GetSnapshotAsync()).Exists) { await MessageDoc.CreateAsync(new Dictionary <string, object>() { { "content", Content }, { "create-time", CreateTime }, { "is-successful-command", isSuccessfulCommand } }); } }
public async Task DeleteAsync() { await MessageDoc.DeleteAsync(); }