generated from kkrypt0nn/Python-Discord-Bot-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslash.py
129 lines (100 loc) · 5.76 KB
/
slash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
""""
Samuro Bot
Автор: *fennr*
github: https://github.com/fennr/Samuro-HotsBot
Бот для сообществ по игре Heroes of the Storm
"""
from discord import Member
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
from discord_slash.utils.manage_commands import create_option
from cogs import general, help, heroes, hots, profile, event, voice
from utils import check, exceptions
guild_ids = [845658540341592096] # Сервер ID для тестирования
class Slash(commands.Cog, name="Slash"):
def __init__(self, bot):
self.bot = bot
@cog_ext.cog_slash(name="voice_name", description="Переименовать комнату")
async def slash_voice_name(self, ctx: SlashContext, name):
await voice.Voice.name(self, ctx, name=name)
@cog_ext.cog_slash(name="voice_limit", description="Установить лимит участников")
async def slash_voice_limit(self, ctx: SlashContext, limit):
await voice.Voice.limit(self, ctx, limit=limit)
@cog_ext.cog_slash(name="voice_lock", description="Сделать комнату закрытой")
async def slash_voice_lock(self, ctx: SlashContext):
await voice.Voice.lock(self, ctx)
@cog_ext.cog_slash(name="voice_unlock", description="Сделать комнату открытой")
async def slash_voice_unlock(self, ctx: SlashContext):
await voice.Voice.unlock(self, ctx)
'''
@cog_ext.cog_slash(name="profile", description="Профиль игрока")
async def slash_profile(self, ctx: SlashContext, user):
await profile.Profile.profile_info(self, ctx, user)
'''
@cog_ext.cog_slash(name="login", description="Авторизоваться на сервере")
async def slash_login(self, ctx: SlashContext, battletag):
await profile.Profile.login(self, ctx, battletag)
'''@cog_ext.cog_slash(name="5x5", description="Подбор команд")
@check.is_admin()
async def slash_5x5(self, ctx: SlashContext, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10):
await event.Event.event_5x5(self, ctx, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)'''
@cog_ext.cog_slash(name="profile_add",
description="Добавить профиль",
options=[
create_option(
name="battletag",
description="Введите батлтег",
option_type=3,
required=True,
),
create_option(
name="discord",
description="Введите дискорд через упоминание",
option_type=3,
required=True,
)
]
)
async def slash_add(self, ctx: SlashContext, battletag: str, discord: Member):
await profile.Profile.profile_add(self, ctx, btag=battletag, discord_user=discord)
@cog_ext.cog_slash(name="info", description="Описание бота")
async def slash_info(self, ctx: SlashContext):
await general.general.info(self, ctx)
@cog_ext.cog_slash(name="avatar", description="Вывести аватар")
async def slash_avatar(self, ctx:SlashContext, member: Member):
await general.general.avatar(self, ctx, member)
@cog_ext.cog_slash(name="weekly", description="Список героев еженедельной ротации")
async def slash_rotate(self, ctx: SlashContext):
await hots.Hots.rotation(self, ctx)
@cog_ext.cog_slash(name="ban", description="Список рекомендуемых к бану героев")
async def slash_ban(self, ctx: SlashContext):
await hots.Hots.ban_list(self, ctx)
@cog_ext.cog_slash(name="data", description="Полные данные по герою")
async def slash_data(self, ctx: SlashContext, hero):
await hots.Hots.heroes_data(self, ctx, hero)
@cog_ext.cog_slash(name="streams", description="Онлайн стримы на твиче")
async def slash_streams(self, ctx: SlashContext, cnt):
await hots.Hots.streams(self, ctx, cnt)
@cog_ext.cog_slash(name="invite", description="Пригласить бота на свой канал")
async def slash_invite(self, ctx: SlashContext):
await general.general.invite(self, ctx)
@cog_ext.cog_slash(name="help", description="Все доступные команды")
async def slash_help(self, ctx: SlashContext, unit):
await help.Help.help(self, ctx, unit)
@cog_ext.cog_slash(name="hero", description="Описание героя")
async def slash_hero(self, ctx: SlashContext, hero):
await heroes.Heroes.hots_hero(self, ctx, hero)
@cog_ext.cog_slash(name="skill", description="Описание скиллов героя")
async def slash_skill(self, ctx: SlashContext, hero):
await heroes.Heroes.hots_skill(self, ctx, hero)
@cog_ext.cog_slash(name="talent", description="Описание талантов героя %lvl% уровня")
async def slash_talent(self, ctx: SlashContext, hero, lvl):
await heroes.Heroes.hots_talent(self, ctx, hero, lvl)
@cog_ext.cog_slash(name="patchnotes", description="Описание последнего обновления")
async def slash_pn(self, ctx: SlashContext):
await hots.Hots.hots_notes(self, ctx)
@cog_ext.cog_slash(name="stlk", description="Билды от Сталка")
async def slash_stlk_builds(self, ctx: SlashContext, hero):
await hots.Hots.stlk_builds(self, ctx, hero)
def setup(bot):
bot.add_cog(Slash(bot))