Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
try outsourcing no backticks message to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hyper-neutrino committed Jul 30, 2021
1 parent d981470 commit 0e46e3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions data.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
messages:
info: "[GitHub Repository](https://github.com/Vyxal/Vyxal/) | [Online Interpreter](https://lyxal.pythonanywhere.com) | [Tutorial](https://github.com/Vyxal/Vyxal/blob/master/docs/Tutorial.md) | [Vyxapedia](https://vyxapedia.hyper-neutrino.xyz) | [List of elements](https://github.com/Vyxal/Vyxal/blob/master/docs/elements.txt) | [Code Page](https://github.com/Vyxal/Vyxal/blob/master/docs/codepage.txt) | [GitHub Organization](https://github.com/Vyxal/)"
no-backticks: "Did you forget to put backticks around your code (`\\`code\\``)? Remember to escape any backticks in your code (to type `\\`hi\\``, enter `\\`\\\\`hi\\\\`\\``)."
6 changes: 2 additions & 4 deletions hooks/msghooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from utils import *

INFOTEXT = variables["messages"]["info"]

NO_BACKTICKS = variables["messages"]["no-backticks"]

@app.route("/join", methods=["POST"])
@msghook
Expand Down Expand Up @@ -78,9 +78,7 @@ def receive_message():
without_ping = re.sub("^" + ping_regex, "", content.lower()).strip()
if re.match(r"^(exec(ute)?|run|run code|eval(uate)?)", without_ping):
return (
reply + "Did you forget to put backticks around your code "
"(`\\`code\\``)? Remember to escape any backticks in your code "
"(to type `\\`hi\\``, enter `\\`\\\\`hi\\\\`\\``)."
reply + NO_BACKTICKS
)
if re.match(
r"^(status|((lol )?(yo)?u good( (there )?(my )?(epic )?"
Expand Down

0 comments on commit 0e46e3e

Please sign in to comment.