add getgroups and broadcast
This commit is contained in:
parent
0076a34dff
commit
930f285bc3
2 changed files with 21 additions and 0 deletions
13
worker/broadcast.py
Normal file
13
worker/broadcast.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from zzcore import StdAns
|
||||
|
||||
class Ans(StdAns):
|
||||
AllowUser = [1318000868]
|
||||
|
||||
def GETMSG(self):
|
||||
groups = self.getgroups()
|
||||
|
||||
msg = ""
|
||||
for g in groups:
|
||||
msg += g["groupname"]
|
||||
|
||||
retuen msg
|
|
@ -63,6 +63,14 @@ class StdAns():
|
|||
}
|
||||
requests.post(url = url, data = json.dumps(data),headers = Headers)
|
||||
|
||||
def getgroups(self):
|
||||
url = APIURL + "get_group_list"
|
||||
Headers = {
|
||||
'content-type': 'application/json',
|
||||
'Authorization':'Bearer ' + AUTHORIZATION
|
||||
}
|
||||
|
||||
return requests.get(url = url,headers = Headers).json()['data']
|
||||
|
||||
def mysakuya(self, words):
|
||||
if self.uid == 1318000868:
|
||||
|
|
Loading…
Reference in a new issue