repl.it
@GarethDwyer1/

discord-bot

Python

Hello world in python flask

fork
loading
Files
  • main.py
  • env
  • keep_alive.py
  • Packager files
  • 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
import discord
import os

from keep_alive import keep_alive

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.author != client.user:
        await client.send_message(message.channel, message.content[::-1])


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