|
1 | | -__version__ = "3.7.9" |
| 1 | +__version__ = "3.7.10" |
2 | 2 |
|
3 | 3 |
|
4 | 4 | import asyncio |
@@ -270,6 +270,21 @@ def mention_channel(self): |
270 | 270 |
|
271 | 271 | return self.log_channel |
272 | 272 |
|
| 273 | + @property |
| 274 | + def update_channel(self): |
| 275 | + channel_id = self.config["update_channel_id"] |
| 276 | + if channel_id is not None: |
| 277 | + try: |
| 278 | + channel = self.get_channel(int(channel_id)) |
| 279 | + if channel is not None: |
| 280 | + return channel |
| 281 | + except ValueError: |
| 282 | + pass |
| 283 | + logger.debug("UPDATE_CHANNEL_ID was invalid, removed.") |
| 284 | + self.config.remove("update_channel_id") |
| 285 | + |
| 286 | + return self.log_channel |
| 287 | + |
273 | 288 | async def wait_for_connected(self) -> None: |
274 | 289 | await self.wait_until_ready() |
275 | 290 | await self._connected.wait() |
@@ -1027,8 +1042,9 @@ async def on_message(self, message): |
1027 | 1042 | title="Bot mention", |
1028 | 1043 | description=f"[Jump URL]({message.jump_url})\n{truncate(message.content, 50)}", |
1029 | 1044 | color=self.main_color, |
1030 | | - timestamp=datetime.utcnow(), |
1031 | 1045 | ) |
| 1046 | + if self.config["show_timestamp"]: |
| 1047 | + em.timestamp = datetime.utcnow() |
1032 | 1048 | await self.mention_channel.send(content=self.config["mention"], embed=em) |
1033 | 1049 |
|
1034 | 1050 | await self.process_commands(message) |
@@ -1508,7 +1524,7 @@ async def autoupdate(self): |
1508 | 1524 |
|
1509 | 1525 | elif res != "Already up to date.": |
1510 | 1526 | logger.info("Bot has been updated.") |
1511 | | - channel = self.log_channel |
| 1527 | + channel = self.update_channel |
1512 | 1528 | if self.hosting_method == HostingMethod.PM2: |
1513 | 1529 | embed = discord.Embed(title="Bot has been updated", color=self.main_color) |
1514 | 1530 | await channel.send(embed=embed) |
|
0 commit comments