コード例 #1
0
 def deletefriendnum(self, to, wait, cmd):
     asd = self.refreshContacts()
     selection = MySplit(self.adityasplittext(cmd, 's'),
                         range(1,
                               len(asd) + 1))
     k = len(asd) // 20
     d = []
     for c in selection.parse():
         d.append(asd[int(c) - 1])
     self.sendMessage(to, ' 「 Friendlist 」\nWaiting.....')
     for a in range(k + 1):
         if a == 0:
             self.mentionmention(
                 to=to,
                 wait=wait,
                 text='',
                 dataMid=d[:20],
                 pl=-0,
                 ps='╭「 Friendlist 」─\n├ Type: Delete Friendlist',
                 pg='DELFL',
                 pt=d)
         else:
             self.mentionmention(
                 to=to,
                 wait=wait,
                 text='',
                 dataMid=d[a * 20:(a + 1) * 20],
                 pl=a * 20,
                 ps='├「 Friendlist 」─\n├ Type: Delete Friendlist',
                 pg='DELFL',
                 pt=d)
コード例 #2
0
 def adityaarchi(self, wait, sd, dd, ss, split, msg, tex, nama=[]):
     selection = MySplit(split, range(1, len(nama) + 1))
     k = len(nama) // 20
     for a in range(k + 1):
         if a == 0: eto = '╭「 ' + sd + ' 」─' + tex
         else: eto = '├「 ' + sd + ' 」─' + tex
         text = ''
         mids = []
         no = a
         for i in selection.parse()[a * 20:(a + 1) * 20]:
             mids.append(nama[i - 1])
             if dd == 'kick':
                 self.kickoutFromGroup(ss, [nama[i - 1]])
                 hh = ''
             if dd == 'delfriend':
                 try:
                     self.AdityadeleteContact(nama[i - 1])
                     hh = 'Del Friend'
                 except:
                     hh = 'Not Friend User'
             if dd == 'delbl':
                 try:
                     wait['blacklist'].remove(nama[i - 1])
                     hh = 'Del BL'
                 except:
                     hh = 'Not BL User'
             if dd == 'delwl':
                 try:
                     wait['bots'].remove(nama[i - 1])
                     hh = 'Del WL'
                 except:
                     hh = 'Not WL User'
             if dd == 'delml':
                 try:
                     wait['target'].remove(nama[i - 1])
                     hh = 'Del ML'
                 except:
                     hh = 'Not ML User'
             if dd == 'delblock':
                 try:
                     self.unblockContact(nama[i - 1])
                     hh = 'Del Block'
                 except:
                     hh = 'Not Block User'
             if dd == '': hh = ''
             if dd == 'tag': hh = ''
             no += 1
             if no == len(selection.parse()):
                 text += "\n╰{}. @! {}".format(i, hh)
             else:
                 text += "\n│{}. @! {}".format(i, hh)
         if dd == 'tag': self.sendMention(ss, eto + text, sd, mids)
         else: self.sendMention(msg.to, eto + text, sd, mids)
     if dd == 'tag':
         self.sendMessage(
             msg.to, '╭「 Mention 」{}\n╰Status: Success tag {} mem'.format(
                 tex,
                 len(nama) - (len(nama) - len(selection.parse()))))
コード例 #3
0
 def getalbum2(self, to, text, wait):
     #to = msg.to
     ha = self.getGroupAlbum(to)
     a = [a['title'] for a in ha['result']['items']]
     c = [a['photoCount'] for a in ha['result']['items']]
     a = text.split(' ')
     selection = MySplit(a[3], range(1, len(ha['result']['items']) + 1))
     for i in selection.parse():
         try:
             b = random.randint(0, 999)
             self.getImageGroupAlbum(
                 to,
                 ha['result']['items'][int(a[2]) - 1]['id'],
                 ha['result']['items'][int(a[2]) -
                                       1]['recentPhotos'][i - 1]['oid'],
                 returnAs='path',
                 saveAs='{}.png'.format(b))
             self.sendImage(to, '{}.png'.format(b))
             os.remove('{}.png'.format(b))
         except:
             continue