how i can encode this and print the message with pywhatkit

Viewed 69

i'm trying to automate some whatsapp messages with pywhatkit, but have some errors: in the code bellow, the variable message only print when the type is str, if if I add .encode('utf-8) then it changes to bytes and I don't know how to organize it, I have given it a lot of thought but it doesn't works, can't you put an accent to concatenated strings? if I just send a message without variables it works.

def send():
today = get_date()
for day in range(30):
    text_today = date.today().strftime("%B %d, %Y")
    print(f"Today is: {text_today}" )
    if today >=6:
        print("is the weekend!")
    else:
        not = get_article()
        menssage = str(' *¡Hi, Community!* Here are 5 articles in which you can find valuable content:\n\n -' + not + '\n').encode('utf-8') #error here
        print(type(mensaje))
        pywhatkit.sendwhatmsg_to_group("###############", message, 17, 50, 20, True, 3)
        print("message sent")

works like this:

message = "¡hello there!".encode(utf-8)
pywhatkit.sendwhatmsg_to_group("###############", message, 17, 50, 20, True, 3)

there's something i can do? -- sorry cant find the tag pywhatkit.

0 Answers
Related