Love your pillow doesn't work!

Good morning,
I bought an Arduino MkR1000 to make Iot Bundle projects.
I tried to do Love your pillow project: when plug to the computer, the program works (sometimes) because it sens to my bot the emoticons but not everytime; it also send letters such as J, J dpX, J dZX and so on…The secret command doesn’t work either.
When plug to battery (9v) it dosn’t send messages but just make HeartBeat sounds from buzzer.
I attached my code and foto of the circuit ( in such circuit , battery is missing to make foto more clear).

// ArduinoJson - Version: 5.13.5
#include <ArduinoJson.h>
#include <ArduinoJson.hpp>

#include <SPI.h>
#include <WiFi101.h>
#include<WiFiSSLClient.h>
#include <CapacitiveSensor.h>
#include <TelegramBot.h>

#include <Adafruit_SleepyDog.h>

const char* ssid = SECRET_SSID;    //  your network SSID (name)
const char* password = SECRET_PASS;  // your network password
const char BotToken[] = SECRET_TOKEN; // you bot API token


WiFiSSLClient client;
TelegramBot bot (BotToken, client);

unsigned long timer;
bool pressed = false;
String chat_id;
int threshold = 1500; // this value might change depending on the amount of alluminium foil used
int heart_beat=-1;
int Buzzer = 8; // Pin attached to the buzzer

// List of Emoji we are going to send taken from
// https://apps.timwhitlock.info/emoji/tables/unicode
String emoji[] {
  "\U0001F44A", // fist  
  "\U0001F60D", // eyes
  "\U00002764" // heart
};

CapacitiveSensor   foil = CapacitiveSensor(5,4);        // 10M resistor between pins 5 & 4, pin 4 is sensor pin, add a wire and or foil if desired

void setup() {
  Serial.begin(115200);
  
  Serial.print("connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("WiFi connected");
  
  bot.begin();
  foil.set_CS_AutocaL_Millis(0xFFFFFFFF);

  Watchdog.enable(10000); // Set the timer to 10 sec
}

void loop() {
  Watchdog.reset(); // If this function is not called within 10 seconds the board will reset itself
    
  if(!pressed){
    message m = bot.getUpdates(); // Read new messages
      if ( m.chat_id != 0 ){ // Check if there are some updates
      Serial.println(m.text);
      // Check if the text is an emoji and react accordingly
      if(m.text== "u2764" || m.text== "ud83dudc4a" || m.text== "ud83dude0d" ) HeartBeat();
      chat_id = m.chat_id;
      }
  }
    long start = millis();
    long sensor_value =  foil.capacitiveSensor(30);
    
//   Uncomment this line to debug and calibrate the threshold
    Serial.println(sensor_value);  
    
  if (sensor_value > threshold && !pressed) { 
    pressed = true;
  } 
  else if(sensor_value > threshold && pressed){
    HeartBeat();
    heart_beat+=1;
    // Avoid the heart_beat value to exceed the emoji[] array length
    if(heart_beat >= sizeof(emoji)/sizeof(String)) heart_beat = 0; 
  }
  else if (sensor_value < threshold && pressed) {
    pressed = false;
    Serial.print(heart_beat);
    Serial.println(" heart beats");
    SendMessage(heart_beat);
    heart_beat=-1;
  }
}

void SendMessage(int heart_beat) {
  // Check if you know the chat_id of the chat you want to send the message to
  // You cannot send messages without knowing the chat_id
  if(chat_id!=0) bot.sendMessage(chat_id, emoji[heart_beat]);
  // Use heart_beat variable to navigate the array emoji[]
}

void HeartBeat(){
    tone(Buzzer, 31, 200); // tone(Pin, Note, Duration);
    delay(200);
    tone(Buzzer, 31, 400);
    delay(200);
    noTone(Buzzer); 
    delay(1000);
}

and a tab “arduino_secret.h” where I put:

#define SECRET_SSID "SSID Name"
#define SECRET_PASS "Password"
#define SECRET_BOT_TOKEN "Token"

but when I compile it, it says “SECRET_SSID not declared for this scope” so i had to pud my datas insted of SECRET to make it work.

Img1

Img2

Would you help me to solve these problems?

Io please,

Did you use the project guide here ?

Yes, I follower Every instruction and allo copi ed the code but The bot not always replay to me and sometimes it writes lettere. Even the secret commando doesnt work