internal void GetMessages(string channelID, int limit, DiscordMessagesCallback callback) { if (callback == null) { callback = delegate { } } ; string url = channelurl + channelID + "/messages?&limit=" + limit; Call(HttpMethod.Get, url, (result) => { string substring = "{\"messages\":"; result = result.Insert(0, substring).Insert(result.Length + substring.Length, "}"); DiscordMessageJSONWrapper wrapper = JsonUtility.FromJson <DiscordMessageJSONWrapper>(result); unityInvoker.Enqueue(() => callback(this, GetMessagesArray(wrapper.messages), new DiscordError())); }, (result) => { unityInvoker.Enqueue(() => callback(this, null, new DiscordError(result))); }); } }
/// <summary> Gets the messages in this channel. </summary> /// <param name="limit">The limit of the amount of messages.</param> /// <param name="message">A message to focus on.</param> /// <param name="before">Whether we should get all the message before or after the message that is focused.</param> public void GetMessages(int limit, DiscordMessage message, bool before, DiscordMessagesCallback callback) { client.GetMessages(ID, limit, message.ID, before, callback); }
/// <summary> Gets the messages in this channel. </summary> /// <param name="limit">The limit of the amount of messages.</param> public void GetMessages(int limit, DiscordMessagesCallback callback) { client.GetMessages(ID, limit, callback); }
public void CheckMessages(string lastMessage, DiscordMessagesCallback callback) { GetMessages(channelID, 100, lastMessage, false, callback); }
public void InitMessages(DiscordMessagesCallback callback) { GetMessages(channelID, 100, callback); }