fix a bug introduced a while back, where including any http:// or https:// url in the line would make bot6 think it was a valid command
now only specific commands allow that, otherwise it's discarded (but not exactly ignored)
This commit is contained in:
parent
02fe01fa2c
commit
6bda69aaf3
10
commands.py
10
commands.py
|
@ -92,6 +92,7 @@ class Command:
|
|||
|
||||
def preq_cmd(self): # command prequisites / triggers
|
||||
cmd = self.line
|
||||
needs_prefix = True
|
||||
# self.mesg(f"attempting command: {cmd}")
|
||||
if cmd == "help" or cmd.startswith("help "):
|
||||
command = "help"
|
||||
|
@ -109,13 +110,20 @@ class Command:
|
|||
command = "dbg2"
|
||||
elif cmd.startswith("yt ") or self.YouTube.match_urls(self.YouTube, cmd) != []:
|
||||
command = "yt"
|
||||
needs_prefix = False
|
||||
elif cmd.startswith("\x01") or self.is_ctcp:
|
||||
command = "ctcp"
|
||||
else:
|
||||
# self.mesg(cmd)
|
||||
return
|
||||
if command not in self.config.cmd.disabled:
|
||||
eval(f"self.{command}()")
|
||||
if needs_prefix == False:
|
||||
eval(f"self.{command}()")
|
||||
elif not (self.prefix == None and self.pm == False):
|
||||
eval(f"self.{command}()")
|
||||
|
||||
# else:
|
||||
# self.mesg("this ain't a valid commanderoonie, you twat")
|
||||
|
||||
@internal
|
||||
@cmd
|
||||
|
|
Loading…
Reference in New Issue