Aucune description

Nikita Chursin 4e34545c85 fixed docker-compose il y a 2 ans
api 56dee455f9 added interfaces il y a 3 ans
config c32b84e792 fixed typo il y a 3 ans
redis b23381743c .env il y a 3 ans
structs 42ff6f405f fixed typo on подробности il y a 2 ans
telegram 56dee455f9 added interfaces il y a 3 ans
.gitignore b23381743c .env il y a 3 ans
Dockerfile be38c247ee minor fixes to the makefile and gitignore il y a 3 ans
Makefile b97006e06a readme and updates to config il y a 2 ans
README.md 5821b987dd added form script il y a 2 ans
docker-compose.yml 4e34545c85 fixed docker-compose il y a 2 ans
go.mod ca86aec98c godotenv dependency il y a 3 ans
go.sum ca86aec98c godotenv dependency il y a 3 ans
server.go 9d985cfde6 everything works il y a 3 ans

README.md

Salesforce RU Careers Control Bot

This is the bot, that converts Salesforce RU Careers from Google Form responses to Telegram posts.

Configuration

  1. Create a new bot
  2. Add bot to your chat/channel. Bot has to be an admin to post message to channel.
  3. Create .env file: BOT_TOKEN=<yout bot token> CHANNEL=@<your channel>
  4. Make docker image
  5. Update docker-compose to use correct image
  6. Add the following script to your Google Form: ```javascript const BOT_URL = "";
  7. const fieldMaps = {

    // <question text>: <field name in code>
    // e.g.:
    "Кого ищете?": "position",
    "Компания": "company",
    "Город": "city",
    "Зарплата": "salary"
    

    } function onSubmit(e) {

    const form = FormApp.getActiveForm();
    const formId = form.getId();
    const allResponses = form.getResponses();
    const latestResponse = allResponses[allResponses.length - 1];
    const responseId = latestResponse.getId();
    const response = latestResponse.getItemResponses();
    const payload = {};
    for (let i = 0; i < response.length; i++) {
        const question = fieldMaps[response[i].getItem().getTitle()];
        const answer = response[i].getResponse();
        payload[question] = answer;
    }
    payload.formId = formId;
    payload.responseId = String(allResponses.length - 1);
    payload.editUrl = latestResponse.getEditResponseUrl();
    
    var options = {
        "method": "post",
        "contentType": "application/json",
        "payload": JSON.stringify(payload)
    };
    UrlFetchApp.fetch(BOT_URL, options);
    

    }; ```

    NB: This instruction is not perfect for sure for multiple reasons. Feel free to contribute to the repo!