File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88import sys
99import json
1010from pkg_resources import parse_version
11+ from difflib import get_close_matches
1112import random
1213
1314import discord
@@ -289,11 +290,15 @@ def find_index(name):
289290 if plugin_name in self .registry :
290291 index = find_index (plugin_name )
291292 elif plugin_name is not None :
292- return await ctx . send ( embed = discord .Embed (
293+ em = discord .Embed (
293294 color = discord .Color .red (),
294295 description = f'Could not find a plugin with name "{ plugin_name } " within the registry.'
295296 )
296- )
297+
298+ matches = get_close_matches (plugin_name , self .registry .keys ())
299+ if matches :
300+ em .add_field (name = 'Perhaps you meant' , value = '\n ' .join (f'`{ m } `' for m in matches ))
301+ return await ctx .send (embed = em )
297302
298303 for name , info in registry :
299304 repo = f"https://github.com/{ info ['repository' ]} "
You can’t perform that action at this time.
0 commit comments