Skip to content

Commit

Permalink
Update address_ping_system.py
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Aug 1, 2023
1 parent f4aa312 commit 6e63625
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/address_ping_system/address_ping_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@


ping_db = KOT("ping_db")
settings_db = KOT("settings_db")


def max_user():
record = settings_db.get("max_user")
if record is None:
return 1000
return record


class aps:
command_line = False
Expand Down Expand Up @@ -79,7 +88,7 @@ def run(self):
data = self.integration.get()
if data != []:
for each in data:
if ping_db.get(each["fromUser"]) != True and ping_db.get_count() < 1:
if ping_db.get(each["fromUser"]) != True and ping_db.get_count() < max_user():
self.integration.send("reply", "hello", each["fromUser"])
ping_db.set(each["fromUser"], True)
time.sleep(5)
Expand Down

0 comments on commit 6e63625

Please sign in to comment.