@ML1012018ZHENG/

Team Surpoter

Python

No description

fork
loading
Files
  • main.py
  • requirements.txt
main.py
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
import discord
import os

client = discord.Client()
season = 0
@client.event
async def on_ready():
    print("I'm in")
    print(client.user)

@client.event
async def on_message(message):
  if message.content.startswith("t$"):
    if "t$online" == message.content:
      await message.channel.send("yo")
    if "t$season check" == message.content:
      await message.channel.send("it is season: " + str(os.environ["SEASON"]))
    if discord.utils.get(message.author.roles, name="admin"):
      if "t$season next" == message.content:
        os.environ["SEASON"] = str(int(os.environ.get("SEASON")) + 1)
        await message.channel.send("season changed to: "+ str(os.environ["SEASON"]))
      if "t$season reset" == message.content:
        os.environ["SEASON"] = "0"
        await message.channel.send("season reseted to: "+ str(os.environ["SEASON"]))
      if "t$userkilladd" in message.content:
        words = message.content.split(" ")
        os.environ[words[1]] = words[2]
        await message.channel.send("player " + words[1].upper() + " kill count is " + words[2] + " in season " + os.environ["SEASON"])
        
    else:
      await message.channel.send("you do not have the perms.")
token = os.environ.get("DISCORD_BOT_SECRET")
client.run(token)