MrShandy

Untitled

Dec 23rd, 2021
1,530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. import requests
  2. from dis_snek.client import Snake
  3. from dis_snek.models import Activity, slash_command, Embed, InteractionContext
  4. from dis_snek.models.enums import Intents, ActivityType
  5. from dis_snek.models.listener import listen
  6. import configparser
  7.  
  8. config = configparser.ConfigParser()
  9. config.read("config.ini", encoding='utf-8')
  10.  
  11. bot = Snake(intents=Intents.DEFAULT)
  12.  
  13.  
  14. @listen()
  15. async def on_ready():
  16.     print(f"Авторизован под: {bot.user}")
  17.     await bot.change_presence(activity=Activity(type=ActivityType.WATCHING, name="//info"))
  18.  
  19.  
  20. @slash_command(
  21.     name="info",
  22.     description="Информация о боте"
  23. )
  24. async def info(ctx: InteractionContext):
  25.     embed = Embed(
  26.         title="World Of Tanks Status",
  27.         description="Бот создан для отображения статуса серверов WOT. Имеет всего две команды: `//info` и `//status`.\nАвтор: [Shandy](https://github.com/Shandeika)\nИсточник данных: https://wgstatus.com")
  28.     await ctx.send(embeds=embed)
  29.  
  30.  
  31. bot.start(config["Config"]["token"])
  32.  
Advertisement
Add Comment
Please, Sign In to add comment