-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbio2.py
46 lines (35 loc) · 1.36 KB
/
bio2.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
45
46
# import random, asyncio is required for discord.py
import random
import os
import asyncio
# imports the required pieces from discord.py
import discord
from discord.ext import commands
# imports config file
from config import config
# import colors
from termcolor import cprint
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=config["BOT"]["PREFIX"], intents=intents)
@bot.event
async def on_ready():
print(f'\n\nLogged in as: {bot.user.name} - {bot.user.id}\n Using discord.py v{discord.__version__}\n')
# Changes our bots Playing Status. type=1(streaming) for a standard game you could remove type and url.
await bot.change_presence(activity=discord.Game(name=random.choice(config["BOT"]["PLAYING_WITH"]), type=1, url='https://github.com/pandavenger/bio2'))
await bot.load_extension('cogs.status')
@bot.command()
@commands.is_owner()
async def post(ctx, channel_id, post):
channel = ctx.bot.get_channel(int(channel_id))
await channel.send(post)
async def load_extensions():
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
# cut off the .py from the file name
await bot.load_extension(f"cogs.{filename[:-3]}")
async def main():
async with bot:
await load_extensions()
await bot.start(config["BOT"]["TOKEN"])
asyncio.run(main())