-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
44 lines (33 loc) · 1.38 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
# import discord
# import os
# from dotenv import load_dotenv
# # Load the environment variables from .env
# load_dotenv()
# # Get the bot token from the environment variable
# token = os.getenv("DISCORD_BOT_TOKEN")
# if token is None:
# raise ValueError("Bot token not found. Please set the DISCORD_BOT_TOKEN environment variable.")
# # Create a bot client class
# class MyClient(discord.Client):
# async def on_ready(self):
# print(f'Logged in as {self.user}')
# #
# async def on_message(self, message):
# # Print incoming messages to the console
# print(f'Message from {message.author}: {message.content}')
# # Avoid responding to the bot's own messages
# if message.author == self.user:
# return
# # Basic command response: if someone types "ping", respond with "pong"
# if message.content == 'ping':
# await message.channel.send('pong')
# # Set intents to allow reading message content
# intents = discord.Intents.default()
# intents.message_content = True # Enable reading message content
# # Initialize the bot client with the correct intents
# client = MyClient(intents=intents)
# # Run the bot using the token
# client.run(token)
# =============================================================
# Code discarded not in Use
# ===============================================================