Example #1
0
        public void ShouldClearIdMsgDiscord()
        {
            const int initialIdMsgDiscord  = 0;
            ulong?    expectedIdMsgDiscord = null;
            var       idee = new Idee()
            {
                IdMsgDiscord = initialIdMsgDiscord,
            };

            idee.ClearIdMsgDiscord();

            idee.IdMsgDiscord.Should().Be(expectedIdMsgDiscord);
        }
Example #2
0
        private static async Task UpdateDiscordMessage(Idee idee, IMessage msgIdee)
        {
            if (idee.IsArchived && msgIdee is IUserMessage msgToDelete)
            {
                await msgToDelete.DeleteAsync();

                idee.ClearIdMsgDiscord();
            }
            else if (idee.IsModified() && msgIdee is IUserMessage msgToUpdate)
            {
                await msgToUpdate.ModifyAsync(m => { m.Embed = idee.GetBuilder().Build(); });
            }
        }