File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+
8
+ # [ unreleased ]
9
+
10
+ Improvements in commands and new config option available.
11
+
12
+ ### Added
13
+ - Added the ability to use your own log channel
14
+ - You can do this by using the ` config set log_channel_id <id> ` command.
15
+
16
+ ### Changed
17
+ - You now have the ability to supply a reason when blocking a user.
18
+ - Blocked users are now stored in the database instead of in the channel topic.
19
+ - This means you can delete the top channel in the modmail category now.
20
+
21
+
7
22
# v2.0.7
8
23
9
24
New command and improvements in bot update message interfaces.
Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ def run(self):
91
91
super ().run (self .token )
92
92
finally :
93
93
print (Fore .RED + ' - Shutting down bot' + Style .RESET_ALL )
94
+
95
+ @property
96
+ def log_channel (self ):
97
+ channel_id = self .config .get ('bot_log_channel_id' )
98
+ if channel_id is not None :
99
+ return self .get_channel (int (channel_id ))
100
+ else :
101
+ return self .main_category .channels [0 ]
94
102
95
103
@property
96
104
def snippets (self ):
@@ -167,7 +175,7 @@ async def on_ready(self):
167
175
{ Fore .CYAN } Guild ID: { self .guild .id if self .guild else 0 }
168
176
{ line }
169
177
""" ).strip ())
170
-
178
+
171
179
if not self .guild :
172
180
print (Fore .RED + Style .BRIGHT + 'WARNING - The GUILD_ID provided does not exist!' + Style .RESET_ALL )
173
181
else :
@@ -292,7 +300,7 @@ async def on_guild_channel_delete(self, channel):
292
300
desc = f"[`{ log_data ['key' ]} `]({ log_url } ) { mod .mention } closed a thread with { user } "
293
301
em = discord .Embed (description = desc , color = em .color )
294
302
em .set_author (name = 'Thread closed' , url = log_url )
295
- await self .main_category . channels [ 0 ] .send (embed = em )
303
+ await self .log_channel .send (embed = em )
296
304
297
305
async def on_message_delete (self , message ):
298
306
"""Support for deleting linked messages"""
Original file line number Diff line number Diff line change @@ -138,8 +138,7 @@ async def _close(self, ctx):
138
138
pass
139
139
140
140
# Logging
141
- categ = self .bot .main_category
142
- log_channel = categ .channels [0 ]
141
+ log_channel = self .bot .log_channel
143
142
144
143
log_data = await self .bot .modmail_api .post_log (ctx .channel .id , {
145
144
'open' : False , 'closed_at' : str (datetime .datetime .utcnow ()), 'closer' : {
You can’t perform that action at this time.
0 commit comments