You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ITextChannel.cs 1.7 KiB

123456789101112131415161718192021222324252627282930
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using System.Threading.Tasks;
  4. namespace Discord
  5. {
  6. public interface ITextChannel : IChannel
  7. {
  8. /// <summary> Gets the message in this text channel with the given id, or null if none was found. </summary>
  9. Task<Message> GetMessage(ulong id);
  10. /// <summary> Gets the last N messages from this text channel. </summary>
  11. /// <param name="limit"> The maximum number of messages to retrieve. </param>
  12. Task<IEnumerable<Message>> GetMessages(int limit = 100);
  13. /// <summary> Gets a collection of messages in this channel. </summary>
  14. /// <param name="limit"> The maximum number of messages to retrieve. </param>
  15. /// <param name="relativeMessageId"> The message to start downloading relative to. </param>
  16. /// <param name="relativeDir"> The direction, from relativeMessageId, to download messages in. </param>
  17. Task<IEnumerable<Message>> GetMessages(int limit = 100, ulong? relativeMessageId = null, Relative relativeDir = Relative.Before);
  18. /// <summary> Sends a message to this text channel. </summary>
  19. Task<Message> SendMessage(string text, bool isTTS = false);
  20. /// <summary> Sends a file to this text channel, with an optional caption. </summary>
  21. Task<Message> SendFile(string filePath, string text = null, bool isTTS = false);
  22. /// <summary> Sends a file to this text channel, with an optional caption. </summary>
  23. Task<Message> SendFile(Stream stream, string filename, string text = null, bool isTTS = false);
  24. /// <summary> Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds.</summary>
  25. Task SendIsTyping();
  26. }
  27. }