Add introduction on guild join

This commit is contained in:
Zeva Rose 2021-06-24 11:32:15 -06:00
parent 21c7d1cefe
commit 355d3963bb

View file

@ -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"