Discord_discord bot is a simple discord bot, which is deployed on heroku cloud environment. discord_bot has following functionality
- It reply hey to user hi
- Provide google search result (top 5) by using
!google search_query
- Provide user recent search result for a query by using
!recent query > >
bot details
discord_bot url = discord_bot discord_bot name = prashant_bot
- copy the discord bot url
https://discord.com/api/oauth2/authorize?client_id=758260433341251605&permissions=271969376&scope=bot
- login to your discord account
- paste the copied url in browser
- select the exesting server where you want to add bot, authorise the permissions
- go back to your server and see in the right side prashant_bot server is online
- copy the codebase
- in main directory, create a file
.env
, set the environment variable - add
DATABSE_URL
andDISCORD_TOKEN
- run the command to run server
python app.py
DATABASE_URL="postgresql://<username>:<password>@<host_url>:<port>/databasename
DISCORD_TOKEN="ELKJQWEIOJOWIEIOQWMQWEOIQWEUQOIEJUQWEOI"
-
In terminal/Konsole open
discord_bot
drirectory -
open python shell ( first install all requirements)
-
in python shell run following commands
a.
from bot import _engine as engine
b.from bot.database import Base
c.Base.metadata.create_all(engine)
email: [email protected]