internal override Task SendMessage(Channel channel, string text, Attachment[] attachments = null)
		{
			Console.ForegroundColor = ConsoleColor.Cyan;
			Console.WriteLine(text);
			if (attachments != null && attachments.Any())
			{
				foreach (var attachment in attachments)
				{
					if (!string.IsNullOrEmpty(attachment.Pretext))
						Console.WriteLine(attachment.Pretext);
					if (!string.IsNullOrEmpty(attachment.AuthorName))
						Console.WriteLine(attachment.AuthorName);
					Console.WriteLine($"{attachment.Title} <{attachment.TitleLink}>");
					if (!string.IsNullOrEmpty(attachment.Text))
						Console.WriteLine(attachment.Text);
					foreach (var field in attachment.Fields)
						Console.WriteLine($"{field.Title}: {field.Value}");
					Console.WriteLine();
				}
			}
			Console.ResetColor();

			return Task.FromResult(true);
		}
示例#2
0
 internal abstract Task SendMessage(Channel channel, string text, Attachment[] attachments = null);
示例#3
0
		protected async Task SendMessage(Channel channel, string text, Attachment[] attachments = null)
		{
			await _bot.SendMessage(channel, text, attachments);
		}