-
Notifications
You must be signed in to change notification settings - Fork 0
/
BotMain.py
32 lines (25 loc) · 818 Bytes
/
BotMain.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
import BotCredential as Credential
import discord
from discord.ext import commands
import datetime
import discord.message
def BotLog(msg):
print("[",datetime.datetime.now().strftime("%H:%M:%S"),"]",msg)
BotLog("App Started")
botIntent=discord.Intents.all()
Bot=commands.Bot(intents=botIntent,command_prefix="py ",help_command=None)
# bot run at last line
@Bot.event
async def on_ready():
print("Bot Ready")
BotLogChannel= Bot.get_channel(Credential.BOT_CHANNEL_LOG)
await BotLogChannel.send("Bot Active")
@Bot.command(name="info")
async def info(ctx):
print("info required")
@Bot.event
async def on_message(msg : Message):
if(msg.author!=Bot.user):
if(msg.content.startswith(Bot.command_prefix)):
await Bot.process_commands(msg)
Bot.run(Credential.BOT_TOKEN)