{"action":"created","issue":{"url":"https://api.github.com/repos/hydrabolt/discord.js/issues/639","repository_url":"https://api.github.com/repos/hydrabolt/discord.js","labels_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/639/labels{/name}","comments_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/639/comments","events_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/639/events","html_url":"https://github.com/hydrabolt/discord.js/issues/639","id":175235381,"number":639,"title":"Add support for date in ChannelLogsQueryOptions","user":{"login":"timhwang21","id":5831434,"avatar_url":"https://avatars.githubusercontent.com/u/5831434?v=3","gravatar_id":"","url":"https://api.github.com/users/timhwang21","html_url":"https://github.com/timhwang21","followers_url":"https://api.github.com/users/timhwang21/followers","following_url":"https://api.github.com/users/timhwang21/following{/other_user}","gists_url":"https://api.github.com/users/timhwang21/gists{/gist_id}","starred_url":"https://api.github.com/users/timhwang21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timhwang21/subscriptions","organizations_url":"https://api.github.com/users/timhwang21/orgs","repos_url":"https://api.github.com/users/timhwang21/repos","events_url":"https://api.github.com/users/timhwang21/events{/privacy}","received_events_url":"https://api.github.com/users/timhwang21/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-06T12:33:45Z","updated_at":"2016-09-06T15:57:17Z","closed_at":"2016-09-06T15:57:17Z","body":"http://hydrabolt.github.io/discord.js/#!/docs/tag/master/typedef/ChannelLogsQueryOptions\r\n\r\nIt would be nice if I could pass `{ beforeDate: date }` as an option. My use case is creating a sweeper to delete all messages over x hours old. Date could be a ISO string or a moment js object, whichever works better. \r\n\r\nIs there a better way to accomplish this already? Thank you, really enjoying using this so far! "},"comment":{"url":"https://api.github.com/repos/hydrabolt/discord.js/issues/comments/244998338","html_url":"https://github.com/hydrabolt/discord.js/issues/639#issuecomment-244998338","issue_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/639","id":244998338,"user":{"login":"timhwang21","id":5831434,"avatar_url":"https://avatars.githubusercontent.com/u/5831434?v=3","gravatar_id":"","url":"https://api.github.com/users/timhwang21","html_url":"https://github.com/timhwang21","followers_url":"https://api.github.com/users/timhwang21/followers","following_url":"https://api.github.com/users/timhwang21/following{/other_user}","gists_url":"https://api.github.com/users/timhwang21/gists{/gist_id}","starred_url":"https://api.github.com/users/timhwang21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timhwang21/subscriptions","organizations_url":"https://api.github.com/users/timhwang21/orgs","repos_url":"https://api.github.com/users/timhwang21/repos","events_url":"https://api.github.com/users/timhwang21/events{/privacy}","received_events_url":"https://api.github.com/users/timhwang21/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T15:57:17Z","updated_at":"2016-09-06T15:57:17Z","body":"Surely a binary search implementation would work? The messages are ordered after all. (bsearch for message with date closest to `beforeDate`, get id, then do query for `{ before: id }`)\r\n\r\nRegardless, thanks for the clarification. Would you recommend fetching messages 100 at a time and deleting until I arrive at my time cutoff? (Not in a position to test atm -- do you know if the messages are returned most recently first or least recently first?) Thank you!"}}
{"actor":{"display_login":"timhwang21"}}