Spaces:
Building
Building
File size: 1,327 Bytes
87c34f0 8067274 87c34f0 2d8a78b 6b076a3 87c34f0 6067e2a 87c34f0 6067e2a 87c34f0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# app.py or main.py
import discord
from discord import app_commands
from fastapi import FastAPI
import uvicorn
import asyncio
from shared import user_cash, user_bets, fetch_nhl_scores
from petsimgo import petsimgo
from petroll import petroll
from cash import cash
from dice import dice
from admincash import admincash
from shop import shop
from cashapp import cashapp
from database import database
from sportbet import sportbet
from roulette import roulette
app = FastAPI()
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Client(intents=intents)
tree = app_commands.CommandTree(bot)
@app.get("/")
async def read_root():
return {"Hello": "World"}
tree.add_command(petsimgo)
tree.add_command(petroll)
tree.add_command(cash)
tree.add_command(dice)
tree.add_command(admincash)
tree.add_command(shop)
tree.add_command(cashapp)
tree.add_command(database)
tree.add_command(sportbet)
tree.add_command(roulette)
@bot.event
async def on_ready():
await tree.sync()
print(f"{bot.user} is now online!")
async def run_bot():
await bot.start("MTI5MjkxMDYzMjg3MzQ5MjU4Mw.GbVmvy.8kEhPZyNLrACzBWYEorT7UqNRME7gp6Lvz6lg8")
@app.on_event("startup")
async def startup_event():
asyncio.create_task(run_bot())
if __name__ == "__main__":
uvicorn.run("app:app", host="0.0.0.0", port=7860) |