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.

ISocketMessageChannel.cs 2.0 kB

12345678910111213141516171819202122232425262728293031
  1. using Discord.Rest;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Threading.Tasks;
  5. namespace Discord.WebSocket
  6. {
  7. public interface ISocketMessageChannel : IMessageChannel
  8. {
  9. /// <summary> Gets all messages in this channel's cache. </summary>
  10. IReadOnlyCollection<SocketMessage> CachedMessages { get; }
  11. /// <summary> Sends a message to this message channel. </summary>
  12. new Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null);
  13. /// <summary> Sends a file to this text channel, with an optional caption. </summary>
  14. new Task<RestUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null);
  15. /// <summary> Sends a file to this text channel, with an optional caption. </summary>
  16. new Task<RestUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null);
  17. SocketMessage GetCachedMessage(ulong id);
  18. /// <summary> Gets the last N messages from this message channel. </summary>
  19. IReadOnlyCollection<SocketMessage> GetCachedMessages(int limit = DiscordConfig.MaxMessagesPerBatch);
  20. /// <summary> Gets a collection of messages in this channel. </summary>
  21. IReadOnlyCollection<SocketMessage> GetCachedMessages(ulong fromMessageId, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch);
  22. /// <summary> Gets a collection of messages in this channel. </summary>
  23. IReadOnlyCollection<SocketMessage> GetCachedMessages(IMessage fromMessage, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch);
  24. /// <summary> Gets a collection of pinned messages in this channel. </summary>
  25. new Task<IReadOnlyCollection<RestMessage>> GetPinnedMessagesAsync(RequestOptions options = null);
  26. }
  27. }