diff --git a/src/jarvis.py b/src/jarvis.py index ddcaf88..90291a5 100644 --- a/src/jarvis.py +++ b/src/jarvis.py @@ -1,8 +1,10 @@ from discord import Embed, Color, Intents -from discord.ext import commands, tasks +from discord.ext import commands +from discord.utils import find from dataclasses import dataclass from yaml import load from psutil import Process +from asyncio import sleep try: from yaml import CLoader as Loader @@ -50,6 +52,22 @@ async def on_ready(): print("Connected to {} guild(s)".format(len(jarvis.guilds))) +@jarvis.event +async def on_guild_join(guild): + general = find(lambda x: x.name == "general", guild.channels) + if general and general.permissions_for(guild.me).send_messages: + await general.send( + "Allow me to introduce myself. I am J.A.R.V.I.S., a virtual " + + "artificial intelligence, and I'm here to assist you with a " + + "variety of tasks as best I can, " + + "24 hours a day, seven days a week." + ) + await sleep(1) + await general.send("Importing all preferences from home interface...") + await sleep(5) + await general.send("Systems are now fully operational") + + @jarvis.command(name="status", help="Retrieve J.A.R.V.I.S. status") async def _status(ctx): title = "J.A.R.V.I.S. Status"