debug
This commit is contained in:
parent
f96f7978be
commit
9b5571108a
1 changed files with 4 additions and 0 deletions
|
@ -1,8 +1,11 @@
|
||||||
|
import logging
|
||||||
import niobot
|
import niobot
|
||||||
from thefuzz import fuzz
|
from thefuzz import fuzz
|
||||||
|
|
||||||
|
|
||||||
class InfoModule(niobot.Module):
|
class InfoModule(niobot.Module):
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@niobot.command(name="room-info", aliases=["ri"])
|
@niobot.command(name="room-info", aliases=["ri"])
|
||||||
async def room_info(self, ctx: niobot.Context, room: str = None):
|
async def room_info(self, ctx: niobot.Context, room: str = None):
|
||||||
"""
|
"""
|
||||||
|
@ -36,6 +39,7 @@ class InfoModule(niobot.Module):
|
||||||
if ctx.event.sender not in room_obj.users:
|
if ctx.event.sender not in room_obj.users:
|
||||||
continue
|
continue
|
||||||
ratio = fuzz.ratio(room, room_obj.display_name)
|
ratio = fuzz.ratio(room, room_obj.display_name)
|
||||||
|
self.log.debug("%r: %r", room_obj.display_name, ratio)
|
||||||
if ratio > 1:
|
if ratio > 1:
|
||||||
matches.append((room_obj, ratio))
|
matches.append((room_obj, ratio))
|
||||||
matches.sort(
|
matches.sort(
|
||||||
|
|
Loading…
Reference in a new issue