mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2025-01-11 05:15:37 +00:00
6a8819a2a8
- added logging and listing of kick/ban/mute events - add usernotes (.note to add a note to a user, .notes to fetch them) - split off mod.py into many files, cleanup on many features - renamed .listwarns to .userlog - renamed .mywarns to .myuserlog
26 lines
809 B
Python
26 lines
809 B
Python
import json
|
|
|
|
|
|
def add_restriction(self, member, rst):
|
|
# from kurisu source, credits go to ihaveamac
|
|
with open("data/restrictions.json", "r") as f:
|
|
rsts = json.load(f)
|
|
if str(member.id) not in rsts:
|
|
rsts[str(member.id)] = []
|
|
if rst not in rsts[str(member.id)]:
|
|
rsts[str(member.id)].append(rst)
|
|
with open("data/restrictions.json", "w") as f:
|
|
json.dump(rsts, f)
|
|
|
|
|
|
def remove_restriction(self, member, rst):
|
|
# from kurisu source, credits go to ihaveamac
|
|
with open("data/restrictions.json", "r") as f:
|
|
rsts = json.load(f)
|
|
if str(member.id) not in rsts:
|
|
rsts[str(member.id)] = []
|
|
if rst in rsts[str(member.id)]:
|
|
rsts[str(member.id)].remove(rst)
|
|
with open("data/restrictions.json", "w") as f:
|
|
json.dump(rsts, f)
|