Minecraft-Server-Discord-Bot/main.py

35 lines
881 B
Python
Raw Normal View History

2022-10-30 22:36:37 +00:00
import os
import discord
from dotenv import load_dotenv
BOT_NAME = "Dumb Bitch"
2022-10-30 23:01:25 +00:00
def start_computer():
pass
2022-10-30 23:38:20 +00:00
class MyClient(discord.Client):
async def on_ready(self):
print(f"Logged on as {self.user}.")
2022-10-30 22:36:37 +00:00
2022-10-30 23:38:20 +00:00
async def on_message(self, message):
print(f"Message from {message.author}: {message.content}")
if message.author == self.user:
return
if message.content == "hello":
await message.channel.send(f"Hey {message.author}")
if message.content == "goodbye":
await message.channel.send(f"Goodbye {message.author}")
2022-10-30 22:36:37 +00:00
if __name__ == "__main__":
load_dotenv()
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
2022-10-30 23:38:20 +00:00
# intents = discord.Intents.default()
# intents.message_content = True
intents = discord.Intents.all()
client = MyClient(intents=intents)
client.run(DISCORD_TOKEN)