public DiscordMsg(MsgService s, IUserMessage message) : base(s) { Id = message.Id; Content = message.Content; Author = message.Author; Attachments = string.Join(',', message.Attachments.Select(x => x.Url)); Embeds = message.Embeds.ToList(); }
public DbMsg(MsgService s, MsgModel model) : base(s) { Id = model.Message; Content = s.GetLatestContent(Id)?.Content.TrimEnd(); Author = Program.Client.GetGuild(model.Guild)?.GetUser(model.Author) ?? null; Author ??= Program.Client.GetUser(model.Author); if (Author == null) { var dbu = new DbUser(model.Author); dbu.Username = s.GetNamesFor(model.Author).LastOrDefault()?.Name; Author = dbu; } Attachments = model.Attachments; Embeds = new List <IEmbed>(); ChannelId = model.Channel; Channel = Program.Client.GetChannel(ChannelId); }
public ReturnedMsg(MsgService cn) { service = cn; }