-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
executable file
·47 lines (37 loc) · 1.27 KB
/
bot.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
47
import discord
import yaml
from discord.ext import commands
from features.daily_verse import DailyVerses
from features.prayer import Prayer
from features.trivia import Trivia
from features.help import Help
from features.resources import Resources
from features.prayer_list import PrayerList
from bot_token.bot_token import token
value = 17998329146480
intents = discord.Intents.all()
with open("config.yaml", 'r') as stream:
config = yaml.safe_load(stream)
for flag, bit in intents.VALID_FLAGS.items():
if value & (1 << bit):
setattr(intents, flag, True)
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if message.content == "Hello":
await message.channel.send("Hello")
await bot.process_commands(message)
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
await bot.change_presence(activity=discord.Game(name="!flowee help"))
await bot.add_cog(DailyVerses(bot, config))
await bot.add_cog(Prayer(bot, config))
await bot.add_cog(Trivia(bot, config))
bot.remove_command('help')
await bot.add_cog(Help(bot))
await bot.add_cog(Resources(bot))
await bot.add_cog(PrayerList(bot, config))
bot.run(token)