Step-by-step guide — apne Discord bot ko bilkul free mein 24/7 host karo. Koi credit card nahi, koi paisa nahi.
discord.com/developers/applications pe jao → "New Application" click karo → naam do apne bot ko.
Left sidebar mein "Bot" pe click karo → "Add Bot" karo → "Reset Token" se apna TOKEN copy karo. Yeh token secret rakho!
"OAuth2" → "URL Generator" → scopes: bot → permissions select karo → generated URL se apne server mein invite karo.
# pip install discord.py import discord from discord.ext import commands # Bot setup intents = discord.Intents.default() intents.message_content = True bot = commands.Bot(command_prefix="!", intents=intents) @bot.event async def on_ready(): print(f"Bot online: {bot.user}") @bot.command() async def hello(ctx): await ctx.send(f"Namaste {ctx.author.name}! 👋") @bot.command() async def ping(ctx): await ctx.send(f"🏓 Pong! {round(bot.latency * 1000)}ms") # Apna TOKEN yahan dalo bot.run("YOUR_BOT_TOKEN_HERE")
// npm install discord.js const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent ] }); client.on('ready', () => { console.log(`Bot online: ${client.user.tag}`); }); client.on('messageCreate', async (message) => { if (message.content === '!ping') { await message.reply('🏓 Pong!'); } if (message.content === '!hello') { await message.reply(`Namaste ${message.author.username}! 👋`); } }); // Apna TOKEN yahan dalo client.login('YOUR_BOT_TOKEN_HERE');
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Bot is ALIVE! 🤖" def run(): app.run(host='0.0.0.0', port=8080) def keep_alive(): t = Thread(target=run) t.start() # Bot.py mein import karo: # from keep_alive import keep_alive # keep_alive() ← bot.run() se pehle likhna
discord.py==2.3.2 flask==3.0.0
{
"name": "my-discord-bot",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"discord.js": "^14.0.0"
}
}