File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import discord
2+ from discord .ext import commands
3+
4+ import squarecloud as square
5+ from dotenv import load_dotenv
6+ import os
7+
8+ load_dotenv ()
9+
10+ SQUARE_TOKEN = os .getenv ("SQUARE_API_KEY" )
11+ SQUARE_APP_ID = os .getenv ("SQUARE_APP_ID" )
12+ OWNER_ID = os .getenv ("OWNER_ID" )
13+
14+ intents = discord .Intents .default ()
15+ intents .members = True
16+
17+ bot = commands .Bot (command_prefix = '+' , intents = intents )
18+
19+ client = square .Client (api_key = SQUARE_TOKEN )
20+
21+ @bot .tree .command (name = "performance" , description = "[Dev] Veja a performance da LuaBot!" )
22+ async def performance (interaction : discord .Interaction ):
23+ if not OWNER_ID :
24+ await interaction .response .send_message ("Tá querendo ver se eu tô funcionando?" )
25+ else :
26+ status = await client .app_status (SQUARE_APP_ID ) # StatusData(...)
27+
28+ await interaction .response .send_message (f"Performance: **RAM:**{ status .ram } , **CPU:** { status .cpu } , **Network:** { status .network } " )
You can’t perform that action at this time.
0 commit comments