Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Title to Snapshot Multi Choice + Improve Scam Detection #337

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions rocketwatch/plugins/detect_scam/detect_scam.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ async def ticket_with_link(self, message):
"ticket"
],
[
("contact", "reach out", [("talk", "speak"), ("to", "with")]),
("admin", "mod")
("contact", "reach out", "report", [("talk", "speak"), ("to", "with")]),
("admin", "mod", "m0d")
],
"support team",
"assistance",
"help"
("support team", "supp0rt"),
[
("ask", "seek", "request", "contact"),
("help", "assistance")
]
)

def txt_contains(_x: Union[list, tuple, str]) -> bool:
Expand Down
8 changes: 4 additions & 4 deletions rocketwatch/plugins/snapshot/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def __init__(self, bot):
self.bot = bot
self.mongo = pymongo.MongoClient(cfg["mongodb_uri"])
self.db = self.mongo.rocketwatch
self.ratelimit = 300
self.last_ran = datetime.now() - timedelta(seconds=self.ratelimit)
self.ratelimit = timedelta(minutes=5)
self.last_ran = datetime.now() - self.ratelimit
self.version = 3

def run_loop(self):
# ratelimit
if (datetime.now() - self.last_ran).seconds < self.ratelimit:
if (datetime.now() - self.last_ran) < self.ratelimit:
return []
# nuke db if version changed or not present
if not self.db.snapshot_votes.find_one({"_id": "version", "version": self.version}):
Expand Down Expand Up @@ -120,7 +120,7 @@ def run_loop(self):
def handle_multiple_choice_vote(self, proposal, vote, prev_vote):
new_choices = [proposal["choices"][c - 1] for c in vote["choice"]]
e = Embed(
title=f"Snapshot Vote {'Changed' if prev_vote else 'Added'}",
title=f"Snapshot Vote {'Changed' if prev_vote else 'Added'}: {proposal['title']}",
)
nl = "\n- "
voter = f"{el_explorer_url(vote['node'])} ({el_explorer_url(vote['voter'])})"
Expand Down
3 changes: 2 additions & 1 deletion rocketwatch/strings/addresses.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@
"0x87269B23e73305117D0404557bAdc459CEd0dbEc": "Hop: L1 rETH bridge",
"0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a": "Hop: L1 USDC bridge",
"0x076732017b95A98A618BC9eEc3523A0058366807": "Cakepie Reward Distributor",
"0xfEb352930cA196a80B708CDD5dcb4eCA94805daB": "Paladin V2.1 QuestBoard veBAL"
"0xfEb352930cA196a80B708CDD5dcb4eCA94805daB": "Paladin V2.1 QuestBoard veBAL",
"0x2A906f92B0378Bb19a3619E2751b1e0b8cab6B29": "NodeSet Constellation"
}
Loading