File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ 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
+ # v2.12.1
8
+
9
+ ### Changed
10
+
11
+ - ` logs search ` now also searches usernames present in thread logs.
12
+
7
13
# v2.12.0
8
14
9
15
### Important
@@ -13,6 +19,7 @@ In the future, the Modmail API (https://modmail.tk) will be deprecated. This is
13
19
### Changed
14
20
- A lot of painful code cleanup, which is good for us (the devs), but shouldn't affect you.
15
21
- The appearance of the ` logs ` command. Should be clearer with better info now.
22
+ - Bot owners get access to all commands regardless of server permissions.
16
23
17
24
### Added
18
25
Original file line number Diff line number Diff line change 22
22
SOFTWARE.
23
23
"""
24
24
25
- __version__ = '2.12.0 '
25
+ __version__ = '2.12.1 '
26
26
27
27
import asyncio
28
28
from datetime import datetime
@@ -259,10 +259,25 @@ async def on_connect(self):
259
259
self ._connected .set ()
260
260
261
261
async def setup_indexes (self ):
262
+ """Setup text indexes so we can use the $search operator"""
262
263
coll = self .db .logs
263
- if 'messages.content_text' not in await coll .index_information ():
264
- print ('Creating "text" index for "messages.content"' )
265
- await coll .create_index ([('messages.content' , 'text' )])
264
+ index_name = 'messages.content_text_messages.author.name_text'
265
+
266
+ index_info = await coll .index_information ()
267
+
268
+ # Backwards compatibility
269
+ old_index = 'messages.content_text'
270
+ if old_index in index_info :
271
+ print ('Dropping old index:' , old_index )
272
+ await coll .drop_index (old_index )
273
+
274
+ if index_name not in index_info :
275
+ print ('Creating "text" index for logs collection.' )
276
+ print ('Name:' , index_name )
277
+ await coll .create_index ([
278
+ ('messages.content' , 'text' ),
279
+ ('messages.author.name' , 'text' )
280
+ ])
266
281
267
282
async def on_ready (self ):
268
283
"""Bot startup, sets uptime."""
You can’t perform that action at this time.
0 commit comments