Advertisement
Chl_Snt

s-кто?

Aug 9th, 2023
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.06 KB | None | 0 0
  1. import datetime
  2. import time
  3. import s_taper  # S-Taper
  4.  
  5. import discord
  6.  
  7. bot = discord.Bot(intents=discord.Intents.all())
  8. c = discord.commands.context.ApplicationContext
  9. print("Запущен!")
  10.  
  11.  
  12. @bot.message_command(name="Повысить репутацию")
  13. async def plus_rep(ctx: c, message: discord.Message):
  14.     await ctx.respond(f"+ Rep, {message.author.name}")
  15.  
  16.  
  17.  
  18. @bot.user_command(name="Дата регистрации")
  19. async def account_creation_date(ctx, member: discord.Member):
  20.     await ctx.respond(f"{member.name} создал аккаунт {member.created_at}")
  21.  
  22.  
  23. @bot.slash_command(description="Сложение")
  24. async def send(ctx: c, channel: discord.Option(discord.Member), msg: discord.Option(discord.Role)):
  25.     await channel.add_roles(msg)
  26.  
  27.  
  28. @bot.event
  29. async def on_member_update(old: discord.Member, gold: discord.Member):
  30.     channel = None
  31.     channels = gold.guild.channels
  32.     for ch in channels:
  33.         if ch.name == "основной":
  34.             channel = ch
  35.     if old.nick != gold.nick:
  36.         await channel.send(f"{old.name if not old.nick else old.nick} теперь "
  37.                            f"{'без ника' if not gold.nick else gold.nick}")
  38.     if old.roles != gold.roles:
  39.         await channel.send(f"У {old.name} изменилась роль!")
  40.  
  41.  
  42. @bot.event
  43. async def on_user_update(old: discord.User, gold: discord.User):
  44.     channel = None
  45.     members = bot.get_all_members()
  46.     for mem in members:
  47.         if mem.name == gold.name:
  48.             channels = mem.guild.channels
  49.     for ch in channels:
  50.         if ch.name == "основной":
  51.             channel = ch
  52.  
  53.     if old.avatar != gold.avatar:
  54.         await channel.send(f"У {gold.name} новая ава!")
  55.         await channel.send(gold.avatar.url)
  56.         await channel.send("👍👍👍")
  57.  
  58.  
  59. @bot.slash_command(description="Удаление")
  60. async def clear(ctx: c, num: discord.Option(int) = 100):
  61.     await ctx.channel.purge(limit=num)
  62.  
  63.  
  64. bot.run('MTEzNjI2MDI1OTMwNDk2NDEyNw.G8P7Vc.ElO4fJMUb7k9odvS1HLPd_C_z6qfEb5iTMi-7Q')
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement