Spaces:
Sleeping
Sleeping
Rifat Azad commited on
Commit ·
25d0eb4
1
Parent(s): 58d5d35
fix 8
Browse files
logger.py
CHANGED
|
@@ -1,27 +1,7 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
import discord
|
| 3 |
-
import os
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
-
# Initialize a Discord client
|
| 8 |
-
client = discord.Client()
|
| 9 |
-
|
| 10 |
-
# Discord bot token
|
| 11 |
-
BOT_TOKEN = os.getenv('DISCORD_TOKEN')
|
| 12 |
-
|
| 13 |
-
# Event to handle when the bot is ready
|
| 14 |
-
@client.event
|
| 15 |
-
async def on_ready():
|
| 16 |
-
print(f'We have logged in as {client.user}')
|
| 17 |
-
|
| 18 |
-
# Endpoint to get the status of the Discord bot
|
| 19 |
@app.get("/")
|
| 20 |
-
async def
|
| 21 |
-
|
| 22 |
-
return {"status": "Online"}
|
| 23 |
-
else:
|
| 24 |
-
return {"status": "Offline"}
|
| 25 |
-
|
| 26 |
-
# Start the Discord bot
|
| 27 |
-
client.run(BOT_TOKEN)
|
|
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
@app.get("/")
|
| 6 |
+
async def read_root():
|
| 7 |
+
return {"PyDVPL DISCORD BOT DOCKER"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|