How to Build Your Own Discord Bots For Free in 5 Minutes

November 20, 2022 ・0 comments

Think Discord is just a chat app? Think again! With these amazing tools and tutorials, you'll be able to build bots for your Discord server in 5 minutes! It doesn't matter if you've never coded before, now there's no excuse for not having a fully automated and customized Discord server.

# main.py

from flask import Flask

from threading import Thread

app = Flask('')

@app.route('/')

def home():

    return "Hello. I am alive!"

def run():

  app.run(host='0.0.0.0',port=8080)

def keep_alive():

    t = Thread(target=run)

    t.start()

Verify URL - https://discord.com/api/oauth2/authorize?client_id=[Client ID]&permissions=[Permission Integer]&scope=bot

# keep_ailve.py

import discord

import os

from keep_alive import keep_alive

client = discord.Client()

@client.event

async def on_ready():

    print('We have logged in as {0.user}'.format(client))

@client.event

async def on_message(message):

    if message.author == client.user:

        return

    if message.content.startswith('ping'):

        await message.channel.send('pong!')

client.run(os.getenv('TOKEN'))


 


Post a Comment

If you can't commemt, try using Chrome instead.