File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import discord
3+ from discord .ext import commands
34import requests
45import json
56
89id = ""
910api = ""
1011
11- #If you have more than 1 server and want this bot to display the other servers change this value.
12- #1st server = 0, 2nd = 1, 3rd = 2 etc
13-
14- server = 0
15-
1612bot = commands .Bot (command_prefix = "!" , intents = discord .Intents .none ())
1713
1814@bot .event
@@ -21,7 +17,7 @@ async def on_ready():
2117 while True :
2218 t = requests .get (f"https://api.scpslgame.com/serverinfo.php?id={ id } &key={ api } &players=true" ).text
2319 data = json .loads (t )
24- playercount = data ["Servers" ][server ]["Players" ]
20+ playercount = data ["Servers" ][0 ]["Players" ]
2521 await bot .change_presence (activity = discord .Game (name = playercount ))
2622 print (playercount )
2723 await asyncio .sleep (60 )
You can’t perform that action at this time.
0 commit comments