DEV Community

brian austin
brian austin

Posted on

How I built a WhatsApp-style AI chatbot for Nigerian developers (under ₦3,200/month)

How I built a WhatsApp-style AI chatbot for Nigerian developers (under ₦3,200/month)

Let me tell you about the math problem that broke me.

ChatGPT Plus costs $20/month. At the time I'm writing this, that's about ₦32,000 naira. The average Nigerian software developer earns between ₦150,000 and ₦400,000/month. That means ChatGPT costs 8–21% of your monthly salary.

In the US, $20/month is 0.3% of the median software salary.

So the same AI tool costs Nigerian developers 60-70x more relative to income than it costs American developers.

That's not a pricing model. That's exclusion.


The build

I decided to build something that solved this. A WhatsApp-style AI chatbot using Telegram (massive in Nigeria — Lagos, Abuja, Port Harcourt all have huge Telegram user bases) with Claude API as the brain.

Here's the full working code:

const TelegramBot = require('node-telegram-bot-api');
const axios = require('axios');

const bot = new TelegramBot(process.env.TELEGRAM_TOKEN, { polling: true });
const LOUIE_API = 'https://simplylouie.com/api/chat';

// Store conversation history per user
const conversations = {};

bot.on('message', async (msg) => {
  const chatId = msg.chat.id;
  const userMessage = msg.text;

  if (!userMessage) return;

  // Initialize conversation history
  if (!conversations[chatId]) {
    conversations[chatId] = [];
  }

  // Add user message to history
  conversations[chatId].push({
    role: 'user',
    content: userMessage
  });

  // Show typing indicator
  bot.sendChatAction(chatId, 'typing');

  try {
    const response = await axios.post(
      LOUIE_API,
      {
        messages: conversations[chatId],
        model: 'claude-opus-4-5'
      },
      {
        headers: {
          'Authorization': `Bearer ${process.env.LOUIE_API_KEY}`,
          'Content-Type': 'application/json'
        }
      }
    );

    const reply = response.data.content[0].text;

    // Add assistant response to history
    conversations[chatId].push({
      role: 'assistant',
      content: reply
    });

    // Keep conversation history at 20 messages max
    if (conversations[chatId].length > 20) {
      conversations[chatId] = conversations[chatId].slice(-20);
    }

    await bot.sendMessage(chatId, reply);

  } catch (error) {
    console.error('Error:', error.message);
    await bot.sendMessage(
      chatId, 
       'I hit an error. Try again in a moment.'
    );
  }
});

console.log('Bot running...');
Enter fullscreen mode Exit fullscreen mode

The API cost breakdown

I'm using SimplyLouie as my Claude API gateway:

  • Cost: ₦3,200/month (about $2 USD)
  • Unlimited messages — no per-token billing
  • Claude Opus quality (same model ChatGPT Plus users pay ₦32,000/month for)
  • No Anthropic account required — just a Louie API key

For context:

  • Indomie noodles: ₦200
  • This AI API: ₦3,200/month = 16 packs of Indomie
  • ChatGPT Plus: ₦32,000/month = 160 packs of Indomie

You choose.

What Nigerian developers are building with this

I've seen devs in Lagos and Abuja using this stack for:

1. Customer support bots — Small businesses on Instagram/WhatsApp that can't afford Zendesk

2. Automated content writing — Freelancers on Fiverr/Upwork who need to scale content output

3. Code review assistants — Junior devs getting AI feedback on their GitHub PRs before senior review

4. Study assistants — Computer science students at UNILAG, LUTH, OAU using AI for DSA prep and exam revision

5. Translation bots — English ↔ Yoruba/Igbo/Hausa translation for local business content

The setup

# Install dependencies
npm install node-telegram-bot-api axios dotenv

# Create .env file
echo "TELEGRAM_TOKEN=your_telegram_bot_token" > .env
echo "LOUIE_API_KEY=your_louie_api_key" >> .env

# Run
node bot.js
Enter fullscreen mode Exit fullscreen mode

Get your Telegram bot token from @botfather (free).
Get your Louie API key from simplylouie.com/ng/ (₦3,200/month).

Deploying on a Nigerian budget

You don't need a VPS for this. Options that work:

  • Railway.app — Free tier handles small bots
  • Render.com — Free tier with 750 hours/month
  • Your laptop running 24/7 — Works fine for personal/testing use
  • A ₦2,000/month shared hosting — If it supports Node.js

Total cost to run this bot: ₦3,200/month for the AI API. Everything else is free.

The broader point

When AI tools are priced at Silicon Valley salaries, it doesn't mean African developers can't use them — it means they build workarounds. Key sharing, free tier cycling, limited usage.

That's wasted energy that should go into building products.

₦3,200/month for unlimited Claude Opus access is meant to end that workaround cycle for Nigerian developers.

Try it: simplylouie.com/ng/

7-day free trial, no credit card required for trial. Pay with what works for you.


Building something with this? Drop it in the comments — I want to see what Naija devs are making.

nigeria #naijaDevelopers #techInAfrica #chatbot #telegram #javascript #ai #claude

Top comments (0)