Skip to content

Commit 1ae3cf6

Browse files
committed
Hotfix heroku logging
1 parent a6eef11 commit 1ae3cf6

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
77
however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section.
88

9-
# v3.7.0-dev20
9+
# v3.7.0-dev21
1010

1111
### Added
1212

bot.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.7.0-dev20"
1+
__version__ = "3.7.0-dev21"
22

33

44
import asyncio
@@ -109,10 +109,6 @@ def hosting_method(self) -> HostingMethod:
109109

110110
return HostingMethod.OTHER
111111

112-
@property
113-
def is_pm2(self) -> bool:
114-
return ".heroku" in os.environ.get("PYTHONHOME", "")
115-
116112
def startup(self):
117113
logger.line()
118114
if os.name != "nt":

cogs/utility.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,20 +1929,25 @@ async def update(self, ctx, *, flag: str = ""):
19291929
if self.bot.hosting_method == HostingMethod.PM2:
19301930
embed = discord.Embed(
19311931
title="Bot has been updated",
1932-
description=f"Version: {latest.version}",
19331932
color=self.bot.main_color,
19341933
)
1934+
embed.set_footer(
1935+
text=f"Updating Modmail v{self.bot.version} " f"-> v{latest.version}"
1936+
)
19351937
await ctx.send(embed=embed)
19361938
else:
19371939
embed = discord.Embed(
19381940
title="Bot has been updated and is logging out.",
1939-
description=f"Version: {latest.version}\nIf you do not have an auto-restart setup, please manually start the bot.",
1941+
description="If you do not have an auto-restart setup, please manually start the bot.",
19401942
color=self.bot.main_color,
19411943
)
1944+
embed.set_footer(
1945+
text=f"Updating Modmail v{self.bot.version} " f"-> v{latest.version}"
1946+
)
19421947
await ctx.send(embed=embed)
19431948
await self.bot.logout()
19441949
else:
1945-
embed = discord.Embed(title="Already up to date.", color=self.bot.main_color,)
1950+
embed = discord.Embed(title="Already up to date", description=desc, color=self.bot.main_color,)
19461951
await ctx.send(embed=embed)
19471952

19481953
@commands.command(hidden=True, name="eval")
@@ -2023,6 +2028,8 @@ def paginate(text: str):
20232028
break
20242029
await ctx.send(f"```py\n{page}\n```")
20252030

2031+
await self.bot.add_reaction(ctx.message, "\u2705")
2032+
20262033

20272034
def setup(bot):
20282035
bot.add_cog(Utility(bot))

core/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import re
33
import sys
4+
import os
45
from enum import IntEnum
56
from logging.handlers import RotatingFileHandler
67
from string import Formatter
@@ -16,6 +17,11 @@
1617
Fore = Style = type("Dummy", (object,), {"__getattr__": lambda self, item: ""})()
1718

1819

20+
if ".heroku" in os.environ.get("PYTHONHOME", ""):
21+
# heroku
22+
Fore = Style = type("Dummy", (object,), {"__getattr__": lambda self, item: ""})()
23+
24+
1925
class PermissionLevel(IntEnum):
2026
OWNER = 5
2127
ADMINISTRATOR = 4

0 commit comments

Comments
 (0)