diff --git a/modules/mass-tagger/index.py b/modules/mass-tagger/index.py new file mode 100644 index 0000000..667a3de --- /dev/null +++ b/modules/mass-tagger/index.py @@ -0,0 +1,12 @@ +if "%" in self.MESSAGE["text"]: + tagging_issued = False + tags_used = set() + tagged_users = set() + for i in self.tag_sets: + if i in self.MESSAGE["text"]: + tagging_issued = True + tags_used.add(i) + tagged_users |= self.tag_sets[i] + + if tagging_issued: + self.RESPONCE = "Користувач використав масовий тег з повідомленням: {}\n\n{}".format(self.MESSAGE["text"], " ".join(tagged_users)) diff --git a/modules/mass-tagger/meta.json b/modules/mass-tagger/meta.json new file mode 100644 index 0000000..f27d2a4 --- /dev/null +++ b/modules/mass-tagger/meta.json @@ -0,0 +1,7 @@ +{ + "version": 1, + "index_file": "index.py", + "predefine": "predefine.py", + "start_on_boot": true, + "alias": "mass-tagger" +} diff --git a/modules/mass-tagger/predefine.py b/modules/mass-tagger/predefine.py new file mode 100644 index 0000000..3eeadb6 --- /dev/null +++ b/modules/mass-tagger/predefine.py @@ -0,0 +1,4 @@ +self.tag_sets = { + "%testing": {"@dmytrofiot23"}, + "%students": {"@dmytrofiot23", "@Rhinemann", "@Vlad86557", "@nonGratis", "@aposijl", "@Bacant150", "@Investor3221", "@Fvggggu", "@andrux4", "@danya946", "@Antntipo", "@eugeneholovatenko", "@brazoo", "@kozak_yana", "@dfttime", "@forkreros", "@nikitobus1", "@m1x3d0", "@BohdanOstrykov", "@theNightingal3", "@maks1mka_77g", "@victoriavodyana", "@cyberbebebe", "@misha1tigr", "@artemm4ekk", "@jwnsn", "@nstchpnk", "@telegadimki", "@Dedinsyult", "@sashkamg", "@sandrokovi3"} +}