@Corsaka/

Mindnight Report Bot

Python

No description

fork
loading
Files
  • main.py
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
import discord
from discord.ext import commands
from time import sleep
import datetime
# imports

bot = commands.Bot(command_prefix=commands.when_mentioned_or("mr!"), description="Intended solely for dealing with mindnight reports.",pm_help="None")
# sets the prefix, allows people to mention the bot to call commands

@bot.event
async def on_ready():
  print(bot.user, end='')
  print(" online!")
  online_channel = bot.get_channel(569208178257035275)
  await online_channel.send("I'm online as of " + str(datetime.datetime.now()).strftime("%H:%M, %d/%m"))
  # tells a channel that bot is online after recieving confirmation from discord
  await bot.change_presence(activity=discord.Game("MINDNIGHT, probably"))
  # sets the playing status of the bot

@bot.event
async def read_reports():
  report_channel = bot.get_channel(0) # replace 0 with channel ID of reports channel
  while True:
    sleep(1)
    reports = open("reports.txt","r") # reads the file - replace "reports.txt" with the file name
    reportlist = reports.readlines()
    
    

# bot.run("token") # replace with bot token