From 077817c126e0f381e7c15c510977f603e8232f41 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 26 Nov 2015 21:09:02 -0500 Subject: Move _null_event and _verify_successful_response to utils They might be used in other files in the future. --- discord/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'discord/utils.py') diff --git a/discord/utils.py b/discord/utils.py index 8e328bfa..38a00bdc 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE. """ from re import split as re_split +from .errors import HTTPException import datetime @@ -55,3 +56,12 @@ def find(predicate, seq): if predicate(element): return element return None + +def _null_event(*args, **kwargs): + pass + +def _verify_successful_response(response): + code = response.status_code + success = code >= 200 and code < 300 + if not success: + raise HTTPException(response) -- cgit v1.2.3