Compare commits

..

10 Commits

Author SHA1 Message Date
Kowlin
e3bff7e87c Version bump v3.0.0b18 (#1959)
Administrative Merge: Solo beta release.
2018-07-25 06:15:36 +02:00
Michael H
4b19421075 [V3] use uvloop if available (#1935)
* use uvloop if available

* Update __main__.py

requested changes made
2018-07-25 05:55:55 +02:00
Michael H
cf371e8093 fix invalidation (#1945) 2018-07-25 04:44:25 +02:00
Kowlin
5eeadc6399 Commented out the link checking (#1958) 2018-07-25 04:33:43 +02:00
Redjumpman
f6823ea3d1 Update bank.py (#1937) 2018-07-25 02:57:25 +02:00
aikaterna
f24290c423 [V3 Help] Exception for help when bot is blocked (#1955)
Fix for #1901.
Administrative merge: Travis CI failed due to docs issue, see #1957
2018-07-25 02:39:51 +02:00
Michael H
f8a36885fe doc string corretion (#1944)
Administrative merge: Travis CI failed due to docs issue, see #1957
2018-07-25 02:33:17 +02:00
Kowlin
a555eff2cc Fixed a bug with the JSON Driver (#1953)
Administrative merge: Travis CI failed due to docs issue, see #1957
2018-07-25 02:18:54 +02:00
Kowlin
05c389623c Removed warnings as errors argument (#1954) 2018-07-23 02:04:30 +02:00
Michael H
bf00f5e9a2 [V3] tox match pinned version d.py (#1930) 2018-07-12 05:51:00 +02:00
8 changed files with 38 additions and 25 deletions

View File

@@ -19,6 +19,15 @@ import logging.handlers
import logging
import os
# Let's not force this dependency, uvloop is much faster on cpython
if sys.implementation.name == "cpython":
try:
import uvloop
except ImportError:
pass
else:
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
#
# Red - Discord Bot v3

View File

@@ -635,7 +635,7 @@ class Permissions:
stil_valid = [
(k, v) for k, v in self.cache.items() if not any(obj in k for obj in to_invalidate)
]
self.cache = LRUDict(*stil_valid, size=self.cache.size)
self.cache = LRUDict(stil_valid, size=self.cache.size)
def find_object_uniquely(self, info: str) -> int:
"""

View File

@@ -36,5 +36,5 @@ class VersionInfo:
return [self.major, self.minor, self.micro, self.releaselevel, self.serial]
__version__ = "3.0.0b17"
version_info = VersionInfo(3, 0, 0, "beta", 17)
__version__ = "3.0.0b18"
version_info = VersionInfo(3, 0, 0, "beta", 18)

View File

@@ -191,7 +191,7 @@ async def set_balance(member: discord.Member, amount: int) -> int:
def _invalid_amount(amount: int) -> bool:
return amount <= 0
return amount < 0
async def withdraw_credits(member: discord.Member, amount: int) -> int:
@@ -217,7 +217,7 @@ async def withdraw_credits(member: discord.Member, amount: int) -> int:
"""
if _invalid_amount(amount):
raise ValueError("Invalid withdrawal amount {} <= 0".format(amount))
raise ValueError("Invalid withdrawal amount {} < 0".format(amount))
bal = await get_balance(member)
if amount > bal:

View File

@@ -84,7 +84,7 @@ class Dev:
author - command author's member object
message - the command's message object
discord - discord.py library
commands - discord.py commands extension
commands - redbot.core.commands
_ - The result of the last dev command.
"""
env = {
@@ -138,7 +138,7 @@ class Dev:
author - command author's member object
message - the command's message object
discord - discord.py library
commands - discord.py commands extension
commands - redbot.core.commands
_ - The result of the last dev command.
"""
env = {

View File

@@ -407,20 +407,24 @@ async def help(ctx, *cmds: str):
max_pages_in_guild = await ctx.bot.db.help.max_pages_in_guild()
if len(embeds) > max_pages_in_guild:
destination = ctx.author
for embed in embeds:
if use_embeds:
try:
await destination.send(embed=embed)
except discord.HTTPException:
destination = ctx.author
await destination.send(embed=embed)
else:
try:
await destination.send(embed)
except discord.HTTPException:
destination = ctx.author
await destination.send(embed)
try:
for embed in embeds:
if use_embeds:
try:
await destination.send(embed=embed)
except discord.HTTPException:
destination = ctx.author
await destination.send(embed=embed)
else:
try:
await destination.send(embed)
except discord.HTTPException:
destination = ctx.author
await destination.send(embed)
except discord.Forbidden:
await ctx.channel.send(
"I couldn't send the help message to you in DM. Either you blocked me or you disabled DMs in this server."
)
@help.error

View File

@@ -11,8 +11,8 @@ from pathlib import Path
log = logging.getLogger("red")
PRETTY = {"indent": 4, "sort_keys": True, "separators": (",", " : ")}
MINIFIED = {"sort_keys": True, "separators": (",", ":")}
PRETTY = {"indent": 4, "sort_keys": False, "separators": (",", " : ")}
MINIFIED = {"sort_keys": False, "separators": (",", ":")}
class JsonIO:

View File

@@ -13,7 +13,7 @@ envlist =
description = Run unit tests with pytest
extras = voice, test, mongo
deps =
https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]
https://github.com/Rapptz/discord.py/archive/7eb918b19e3e60b56eb9039eb267f8f3477c5e17.zip#egg=discord.py[voice]
-rrequirements.txt
commands =
python -m compileall ./redbot/cogs
@@ -26,7 +26,7 @@ basepython = python3.6
extras = voice, docs, mongo
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" -W -bhtml
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" -W -blinkcheck
# sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" -W -blinkcheck
[testenv:style]
description = Stylecheck the code with black to see if anything needs changes.