-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
48 lines (35 loc) · 1.35 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
48
import os
import discord
import re
import constant
from substr.substr_game import SubstrGame
from dotenv import load_dotenv
from discord.ext import commands
from game_commands import GameCommands
from music_player.music_commands import MusicCommands
from team_balancer.team_balancer_commands import TeamBalancerCommands
class LarmackBot(commands.Bot):
def __init__(self, command_prefix, intents):
super().__init__(command_prefix, case_insensitive=True, intents=intents)
self.add_cog(GameCommands(self))
self.add_cog(MusicCommands(self))
self.add_cog(TeamBalancerCommands(self))
SubstrGame.load()
async def on_ready(self):
print(f'{self.user} has connected to Discord!')
async def on_message(self, message):
if message.author == self.user:
return
msg = message.content.lower()
if re.search('(^|\s)pog+(gers)?(champ)?(gies)?!*(\s|$)', msg):
await message.channel.send("PogChamp!!")
# If I'm mentioned
if 210819098274299904 in message.raw_mentions and constant.REACT_ON_MENTION:
await message.add_reaction("<:larmad:859893602917810217>")
await self.process_commands(message)
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
intents = discord.Intents.default()
intents.members = True
bot = LarmackBot("!", intents)
bot.run(TOKEN)