how_to_team.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 howtoteam(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_team", description= "Get Infos on how to join the Team on this Server")
  28. async def how_to_team(
  29. self,
  30. ctx,
  31. ):
  32. server = ctx.guild
  33. embed = discord.Embed(
  34. title=f"__How to join the Team on {server.name}__",
  35. description=f"If you want to join the Serverteam open a ticket in #ticket.",
  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(howtoteam(bot))