from time import sleep
from whatsapp_api import WhatsApp
from RandomDraw import draw

groupName = 'Todos os migues do'
groupName = 'João Paulo Bot'
msg = "Olá, aqui é o Jonas' bot."
eu = 'João Paulo Bot'

# Starting Chrome session:
wp = WhatsApp()                         # Abre Chrome já na página do WhatsApp Web.
input('Press after QR code scan.')      # Waiting for QR code scan.

# Getting list of participants from group:
wp.search_contact(groupName)            # Procura por nome ou número do contato (ou nome do grupo). Se houver homônimos, retorna o primeiro.
sleep(3)
participants = wp.get_group_members_long()   # Getting everybody's numbers
# print(participants)

# Making the draw:
drawn = draw(participants)
for i in range(len(drawn)):     # Substituting "Você". Will send msg to individual group.
    if drawn[i] == 'Você':
        drawn[i] = eu
# print(drawn)
print('The drawn was done!')

# Sending drawn person for each contact:
for i in range(len(drawn)-1):

    wp.search_contact(drawn[i])                                     # Search contact.
    sleep(1)
    msg2 = 'No amigo oculto, você presenteará ' + drawn[i+1]        # Building message to send.
    wp.send_message(msg)                                            # Sending message.
    wp.send_message(msg2)                                           # Sending message.
    sleep(1)

    if drawn[i] != eu:                                              # If message was to sent to me,
        wp.delete_message_from_recent(msg2)                         # Deletes sent message (only for bot, not for recipient)
8b2480370ceb9cdec5949392b883780300e749a8
<mask token>

<mask token>
input('Press after QR code scan.')
wp.search_contact(groupName)
sleep(3)
<mask token>
for i in range(len(drawn)):
    if drawn[i] == 'Você':
        drawn[i] = eu
print('The drawn was done!')
for i in range(len(drawn) - 1):
    wp.search_contact(drawn[i])
    sleep(1)
    msg2 = 'No amigo oculto, você presenteará ' + drawn[i + 1]
    wp.send_message(msg)
    wp.send_message(msg2)
    sleep(1)
    if drawn[i] != eu:
        wp.delete_message_from_recent(msg2)

<mask token>
groupName = 'Todos os migues do'
groupName = 'João Paulo Bot'
msg = "Olá, aqui é o Jonas' bot."
eu = 'João Paulo Bot'
wp = WhatsApp()
input('Press after QR code scan.')
wp.search_contact(groupName)
sleep(3)
participants = wp.get_group_members_long()
drawn = draw(participants)
for i in range(len(drawn)):
    if drawn[i] == 'Você':
        drawn[i] = eu
print('The drawn was done!')
for i in range(len(drawn) - 1):
    wp.search_contact(drawn[i])
    sleep(1)
    msg2 = 'No amigo oculto, você presenteará ' + drawn[i + 1]
    wp.send_message(msg)
    wp.send_message(msg2)
    sleep(1)
    if drawn[i] != eu:
        wp.delete_message_from_recent(msg2)

from time import sleep
from whatsapp_api import WhatsApp
from RandomDraw import draw
groupName = 'Todos os migues do'
groupName = 'João Paulo Bot'
msg = "Olá, aqui é o Jonas' bot."
eu = 'João Paulo Bot'
wp = WhatsApp()
input('Press after QR code scan.')
wp.search_contact(groupName)
sleep(3)
participants = wp.get_group_members_long()
drawn = draw(participants)
for i in range(len(drawn)):
    if drawn[i] == 'Você':
        drawn[i] = eu
print('The drawn was done!')
for i in range(len(drawn) - 1):
    wp.search_contact(drawn[i])
    sleep(1)
    msg2 = 'No amigo oculto, você presenteará ' + drawn[i + 1]
    wp.send_message(msg)
    wp.send_message(msg2)
    sleep(1)
    if drawn[i] != eu:
        wp.delete_message_from_recent(msg2)

from time import sleep
from whatsapp_api import WhatsApp
from RandomDraw import draw

groupName = 'Todos os migues do'
groupName = 'João Paulo Bot'
msg = "Olá, aqui é o Jonas' bot."
eu = 'João Paulo Bot'

# Starting Chrome session:
wp = WhatsApp()                         # Abre Chrome já na página do WhatsApp Web.
input('Press after QR code scan.')      # Waiting for QR code scan.

# Getting list of participants from group:
wp.search_contact(groupName)            # Procura por nome ou número do contato (ou nome do grupo). Se houver homônimos, retorna o primeiro.
sleep(3)
participants = wp.get_group_members_long()   # Getting everybody's numbers
# print(participants)

# Making the draw:
drawn = draw(participants)
for i in range(len(drawn)):     # Substituting "Você". Will send msg to individual group.
    if drawn[i] == 'Você':
        drawn[i] = eu
# print(drawn)
print('The drawn was done!')

# Sending drawn person for each contact:
for i in range(len(drawn)-1):

    wp.search_contact(drawn[i])                                     # Search contact.
    sleep(1)
    msg2 = 'No amigo oculto, você presenteará ' + drawn[i+1]        # Building message to send.
    wp.send_message(msg)                                            # Sending message.
    wp.send_message(msg2)                                           # Sending message.
    sleep(1)

    if drawn[i] != eu:                                              # If message was to sent to me,
        wp.delete_message_from_recent(msg2)                         # Deletes sent message (only for bot, not for recipient)