Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

himonshuuu/discord-http-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord HTTP interaction bot example

An awesome open source project to demonstrate usage of discord http interactions in python!

License Code style: black

About this project

This repository is an open source project to demonstrate the usage of discord http interactions in python.

  • This repo is open source and free to use.
  • Http interactions can be used to host serverless bots, it saves us a lot of hosting resources and money.

You may also suggest changes by forking this repo and creating a pull request or opening an issue

Built with

Python AIOHTTP PyNaCl

Getting Started

  1. Clone this repo on your local machine
git clone https://github.com/0xhimangshu/discord-http-py
  1. Install the requirements
python -m pip install -U -r requirements.txt
  1. Create a discord application and bot on Discord Developer Portal
  2. Rename the example.config.py file to config.py
  3. Complete the config.py file with your bot token, application id and public key from the discord developer portal.
  4. Edit commands in commands.py
  • Note: You will have to run upsert.py before main.py to upload your slash commands to discord.
  1. Run the bot
python main.py
  1. Sorry, you are not done yet! you have to use a server like ngrok to start a local webserver.
  2. Please install any server like ngrok and start a local webserver on port 3000.
ngrok http 3000
  1. Copy the https url from the ngrok terminal and paste it in the discord developer portal in the interaction section.
  2. You are done! Now you can use your bot in any server you want.
  3. This is serverless hosting so it wont cost you much 😉

Join discord server if you want to

Discord

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages