mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-10 22:26:23 +02:00
Made Botty Case Insensitive
This commit is contained in:
@@ -24,7 +24,7 @@ class GlossaryModule(PrivMsgObserverPrototype):
|
||||
self._config = config
|
||||
|
||||
def update_on_priv_msg(self, data, connection: Connection):
|
||||
msg = data['message']
|
||||
msg = data['messageCaseSensitive']
|
||||
if msg.startswith(GlossaryModule._REMOVE_EXPLANATION):
|
||||
self._remove_query(data, connection)
|
||||
elif msg.startswith(GlossaryModule._ADD_EXPLANATION):
|
||||
@@ -84,7 +84,7 @@ class GlossaryModule(PrivMsgObserverPrototype):
|
||||
connection.send_back("Dir fehlen leider die Rechte zum Hinzufügen von Einträgen, " + data['nick'] + ".",
|
||||
data)
|
||||
return
|
||||
msg = data['message'].split(GlossaryModule._ADD_EXPLANATION)[1].strip()
|
||||
msg = data['messageCaseSensitive'].split(GlossaryModule._ADD_EXPLANATION)[1].strip()
|
||||
split = msg.split(' ', 1)
|
||||
glossary_provider = GlossaryProvider()
|
||||
glossary_provider.save_or_replace(split[0], split[1])
|
||||
|
||||
@@ -18,7 +18,7 @@ class IntroductionObserver(PrivMsgObserverPrototype):
|
||||
return ".me - kann von registrierten Nutzern verwendet werden um eine Vorstellung zu speichern"
|
||||
|
||||
def update_on_priv_msg(self, data, connection: Connection):
|
||||
msg = data["message"]
|
||||
msg = data['messageCaseSensitive']
|
||||
nick = data["nick"]
|
||||
if not msg.startswith(".me") and not msg.startswith(".me-"):
|
||||
return
|
||||
|
||||
@@ -15,6 +15,6 @@ class TellObserver(PrivMsgObserverPrototype):
|
||||
|
||||
def update_on_priv_msg(self, data, connection: Connection):
|
||||
if data['message'].find('.tell') != -1 and self._is_idented_mod(data, connection):
|
||||
connection.send_channel(data['message'][6:])
|
||||
connection.send_channel(data['messageCaseSensitive'][6:])
|
||||
def _is_idented_mod(self, data: dict, connection: Connection):
|
||||
return data['nick'] in self._config.mods and connection.is_idented(data['nick'])
|
||||
@@ -18,7 +18,7 @@ class TitleObserver(PrivMsgObserverPrototype):
|
||||
|
||||
def update_on_priv_msg(self, data, connection: Connection):
|
||||
regex = "(?P<url>https?://[^\s]+)"
|
||||
url = re.search(regex, data['message'])
|
||||
url = re.search(regex, data['messageCaseSensitive'])
|
||||
if url is not None:
|
||||
url = url.group()
|
||||
print(url)
|
||||
|
||||
Reference in New Issue
Block a user