Preventing bot from calling itself
This commit is contained in:
4
index.js
4
index.js
@@ -138,6 +138,10 @@ function sendImage(results, resultIndex, roomId, name, searchCommand, retryCount
|
|||||||
|
|
||||||
Searxng.prototype.handleMessage = function(event, room) {
|
Searxng.prototype.handleMessage = function(event, room) {
|
||||||
|
|
||||||
|
if (event.getSender() == this.matrixClient.getUserId()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const messagePieces = event.getContent().body.split(" ");
|
const messagePieces = event.getContent().body.split(" ");
|
||||||
|
|
||||||
if (searxngCommands.indexOf(messagePieces[0]?.toLowerCase()) > -1) {
|
if (searxngCommands.indexOf(messagePieces[0]?.toLowerCase()) > -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user