aboutsummaryrefslogtreecommitdiff
path: root/discord/utils.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-11-26 21:09:02 -0500
committerRapptz <[email protected]>2015-11-26 21:09:50 -0500
commit077817c126e0f381e7c15c510977f603e8232f41 (patch)
treef4b65ac41c7617ac43c069a99e161b72c2120160 /discord/utils.py
parentSimplify examples to no longer use logging or Client.is_logged_in (diff)
downloaddiscord.py-077817c126e0f381e7c15c510977f603e8232f41.tar.xz
discord.py-077817c126e0f381e7c15c510977f603e8232f41.zip
Move _null_event and _verify_successful_response to utils
They might be used in other files in the future.
Diffstat (limited to 'discord/utils.py')
-rw-r--r--discord/utils.py10
1 files changed, 10 insertions, 0 deletions
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)