Skip to content

Commit 19ef139

Browse files
committed
Merge branch 'development'
2 parents 71acd4f + a956073 commit 19ef139

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ however, insignificant breaking changes do not guarantee a major version bump, s
1010

1111
### Fixed
1212

13+
- Autoupdate persists despite errors
14+
- Mention when normal thread created was not working.
15+
16+
# v3.7.5
17+
18+
### Fixed
19+
1320
- Close on emoji was not working.
1421

1522
# v3.7.3

bot.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.7.5"
1+
__version__ = "3.7.6"
22

33

44
import asyncio
@@ -1479,10 +1479,17 @@ async def autoupdate(self):
14791479
else:
14801480
command = "git pull"
14811481
proc = await asyncio.create_subprocess_shell(command, stderr=PIPE, stdout=PIPE,)
1482+
err = await proc.stderr.read()
1483+
err = err.decode("utf-8").rstrip()
14821484
res = await proc.stdout.read()
14831485
res = res.decode("utf-8").rstrip()
14841486

1485-
if res != "Already up to date.":
1487+
if err and not res:
1488+
logger.warning(f"Autoupdate failed: {err}")
1489+
self.autoupdate_loop.cancel()
1490+
return
1491+
1492+
elif res != "Already up to date.":
14861493
logger.info("Bot has been updated.")
14871494
channel = self.log_channel
14881495
if self.hosting_method == HostingMethod.PM2:

cogs/utility.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import random
55
import re
6+
from sys import stdout
67
import traceback
78
from contextlib import redirect_stdout
89
from datetime import datetime
@@ -1920,10 +1921,18 @@ async def update(self, ctx, *, flag: str = ""):
19201921
command = "git pull"
19211922

19221923
proc = await asyncio.create_subprocess_shell(command, stderr=PIPE, stdout=PIPE,)
1924+
err = await proc.stderr.read()
1925+
err = err.decode("utf-8").rstrip()
19231926
res = await proc.stdout.read()
19241927
res = res.decode("utf-8").rstrip()
19251928

1926-
if res != "Already up to date.":
1929+
if err and not res:
1930+
embed = discord.Embed(
1931+
title="Update failed", description=err, color=self.bot.error_color
1932+
)
1933+
await ctx.send(embed=embed)
1934+
1935+
elif res != "Already up to date.":
19271936
logger.info("Bot has been updated.")
19281937

19291938
embed = discord.Embed(title="Bot has been updated", color=self.bot.main_color,)

core/thread.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async def setup(self, *, creator=None, category=None, initial_message=None):
155155
await channel.edit(topic=f"User ID: {recipient.id}")
156156
self.ready = True
157157

158-
if creator != recipient:
158+
if creator is not None and creator != recipient:
159159
mention = None
160160
else:
161161
mention = self.bot.config["mention"]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ keywords = ['discord', 'modmail']
3636

3737
[tool.poetry.dependencies]
3838
python = "^3.7"
39-
"discord.py" = "./discord.py-1.5.1.tar.gz"
39+
"discord.py" = "./discord.py-1.5.2.tar.gz"
4040
uvloop = {version = ">=0.12.0", markers = "sys_platform != 'win32'"}
4141
python-dotenv = ">=0.10.3"
4242
parsedatetime = "^2.6"

requirements.min.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ aiohttp==3.6.2
66
async-timeout==3.0.1
77
attrs==19.3.0
88
chardet==3.0.4
9-
./discord.py-1.5.1.tar.gz
9+
./discord.py-1.5.2.tar.gz
1010
dnspython==1.16.0
1111
emoji==0.5.4
1212
future==0.18.2

0 commit comments

Comments
 (0)