summaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bot.py b/bot.py
index 4d828b4..3cbe4a4 100644
--- a/bot.py
+++ b/bot.py
@@ -4,6 +4,7 @@ import datetime
from discord_slash import SlashContext, SlashCommand
from discord.ext.commands import Bot
from models.user import User
+from exp import Exp
with open("config.yaml", "r") as yamlfile:
@@ -18,6 +19,7 @@ intents.members = True
bot = Bot(command_prefix="!", self_bot=True, intents=intents)
slash = SlashCommand(bot, sync_commands=True)
+bot_channel = None
# Runs once bot has connected to discord
@@ -32,14 +34,15 @@ async def on_ready():
for channel in guild.channels:
if channel.name == config["discord_channel"]:
print(f"{time_now}: Found channel {channel.name}!")
+ bot_channel = channel
@bot.event
async def on_message(message):
print(message.author.id)
user = User.get(User.discord_id == message.author.id)
- user.add_message()
- print(user.display_name)
+ exp = Exp(user, message.channel)
+ await exp.calculate_exp()
@slash.slash(
@@ -54,4 +57,7 @@ async def test(ctx: SlashContext):
bot.load_extension("commands.economy")
bot.load_extension("commands.basic_games")
+bot.load_extension("commands.rank")
+bot.load_extension("commands.shop")
+bot.load_extension("commands.inventory")
bot.run(config["discord_token"])