how_to_team.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 howtteam(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")
  28. async def how_to_team(
  29. ctx,
  30. ):
  31. server = ctx.guild
  32. embed = discord.Embed(
  33. title=f"__How to join the Team on {server.name}__",
  34. description=f"If you want to join the Serverteam open a ticket in #ticket.",
  35. color=discord.Color.yellow()
  36. )
  37. embed.set_thumbnail(url=server.icon)
  38. embed.set_author(name="VicePD", icon_url="https://i.imgur.com/6QteFrg.png")
  39. embed.set_footer(text="VicePD - Bot | Made by BaumSplitter41")
  40. await ctx.respond(embed=embed)
  41. def setup(bot: discord.Bot):
  42. bot.add_cog(howtteam(bot))