how_to_start.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import discord
  2. from discord.ext import commands
  3. from discord.commands import Option
  4. from discord.commands import slash_command
  5. import os
  6. from dotenv import load_dotenv
  7. class howtostart(commands.Cog):
  8. def __init__(self, bot: discord.Bot):
  9. self.bot = bot
  10. intents = discord.Intents.default()
  11. intents.message_content = True
  12. intents.members = True
  13. intents.guilds = True
  14. intents.reactions = True
  15. client = discord.Client(intents=intents)
  16. debug_guilds_up = []
  17. server_token = os.getenv("SERVER").split(",")
  18. for i in range(len(server_token)):
  19. debug_guilds_up.append(int(server_token[i]))
  20. bot = commands.Bot(
  21. command_prefix=commands.when_mentioned_or("!"),
  22. description="VicePD Bot",
  23. intents=intents,
  24. debug_guilds=debug_guilds_up if debug_guilds_up else None
  25. )
  26. #Command initialization
  27. @bot.slash_command(name="how_to_start", description= "Get Infos")
  28. async def how_to_start(
  29. self,
  30. ctx,
  31. ):
  32. server = ctx.guild
  33. embed = discord.Embed(
  34. title=f"__How to start__",
  35. description=f"Hallo {ctx.author.mention}, um auf unserem Server spielen zu können, ließ dir zuerst das Regelwerk in in #regelwerk durch. Um einem Department beizutreten wähle in #how-to-start eine Einweisungsrolle aus. Melde dich anschließend für eine Einweisung an. **Wichtig: gehe erst krz vor der Einweisung auf den Server!**",
  36. color=discord.Color.yellow()
  37. )
  38. embed.set_thumbnail(url=server.icon)
  39. embed.set_author(name="VicePD", icon_url="https://i.imgur.com/6QteFrg.png")
  40. embed.set_footer(text="VicePD - Bot | Made by BaumSplitter41")
  41. await ctx.respond(embed=embed)
  42. def setup(bot: discord.Bot):
  43. bot.add_cog(howtostart(bot))