Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthares101/get-ip-bot-dc
Basically the idea is to have a way to get the bot's server's current IP.
https://github.com/anthares101/get-ip-bot-dc
discord-bot docker dynamic-ip ip utility
Last synced: 1 day ago
JSON representation
Basically the idea is to have a way to get the bot's server's current IP.
- Host: GitHub
- URL: https://github.com/anthares101/get-ip-bot-dc
- Owner: anthares101
- License: gpl-3.0
- Created: 2024-03-25T18:25:27.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-03-26T22:53:37.000Z (8 months ago)
- Last Synced: 2024-03-27T19:59:52.232Z (7 months ago)
- Topics: discord-bot, docker, dynamic-ip, ip, utility
- Language: Python
- Homepage: https://hub.docker.com/r/anthares101/get-ip-bot-dc
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Bot - Get IP bot
Basically the idea is to have a way to get the bot's server's current IP. Useful for getting a dynamic IP, just use the command `/locate`.
## Before you start
Create a Discord bot and fill the variables in the `config.py` file. Register this application command and make sure the bot has permission to send messages to your server!
```python
import requestsurl = "https://discord.com/api/v10/applications//commands"
json = {
"name": "locate",
"type": 1,
"description": "Returns the public IP address where the bot is located",
}# For authorization use your bot token
headers = {
"Authorization": "Bot "
}r = requests.post(url, headers=headers, json=json)
```## Standalone usage
```
git clone https://github.com/anthares101/get-ip-bot-dc.git
cd get-ip-bot-dc
pip install -r requirements.txt
```Start the bot script with `python main.py`.
## Docker usage
### Recommended way
This repository takes care of building a docker image when necessary and uploads it to [DockerHub](https://hub.docker.com/r/anthares101/get-ip-bot-dc). You don't need to build anything!
```
docker run -v :/app/config.py anthares101/get-ip-bot-dc:latest
```### Build it yourself
To build the image, simply run:
```
docker build -t get-ip-bot-dc .
```After that is done, you can start your container:
```
docker run -v :/app/config.py get-ip-bot-dc
```