mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	Reminders can now be embeds. But you won't be able to set plaintext
This commit is contained in:
		@@ -159,6 +159,18 @@ public class RemindService : INService, IReadyExecutor
 | 
				
			|||||||
            if (ch is null)
 | 
					            if (ch is null)
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var st = SmartText.CreateFrom(r.Message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (st is SmartEmbedText set)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                await ch.SendMessageAsync(null, embed: set.GetEmbed().Build());
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (st is SmartEmbedTextArray seta)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                await ch.SendMessageAsync(null, embeds: seta.GetEmbedBuilders().Map(x => x.Build()));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
                await ch.EmbedAsync(_eb.Create()
 | 
					                await ch.EmbedAsync(_eb.Create()
 | 
				
			||||||
                        .WithOkColor()
 | 
					                        .WithOkColor()
 | 
				
			||||||
                        .WithTitle("Reminder")
 | 
					                        .WithTitle("Reminder")
 | 
				
			||||||
@@ -168,6 +180,7 @@ public class RemindService : INService, IReadyExecutor
 | 
				
			|||||||
                            (await ch.GetUserAsync(r.UserId))?.ToString() ?? r.UserId.ToString()),
 | 
					                            (await ch.GetUserAsync(r.UserId))?.ToString() ?? r.UserId.ToString()),
 | 
				
			||||||
                    r.Message);
 | 
					                    r.Message);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        catch (Exception ex)
 | 
					        catch (Exception ex)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.Warning(ex, "Error executing reminder {ReminderId}: {ErrorMessage}", r.Id, ex.Message);
 | 
					            Log.Warning(ex, "Error executing reminder {ReminderId}: {ErrorMessage}", r.Id, ex.Message);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user