@0r1gam1/

My first discord bot

Python

a basic discord bot I'm trying out!

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
import discord
import os
import time
client = discord.Client()

@client.event
async def on_ready():
    print("I'm in")
    print(client.user)

@client.event
async def on_message(message):
      if message.content.startswith("!alive"):
        channel = message.channel
     
        await client.send_message(message.channel, "I am now alive!")
      


token = os.environ.get("DISCORD_BOT_SECRET")
client.run(token)