Skip to content

Commit 5141f61

Browse files
Update bot.py
1 parent 01b0851 commit 5141f61

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

SCPSL-Discord-Bot/bot.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import discord
3+
from discord.ext import commands
34
import requests
45
import json
56

@@ -8,11 +9,6 @@
89
id = ""
910
api = ""
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-
1612
bot = 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)

0 commit comments

Comments
 (0)