PycordViews 1.2.25__py3-none-any.whl → 1.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycordViews/multibot/bot.py +55 -51
- pycordViews/multibot/errors.py +5 -1
- pycordViews/multibot/multibot.py +41 -3
- pycordViews/multibot/process.py +56 -3
- pycordViews/pagination/pagination_view.py +5 -1
- pycordViews/views/easy_modified_view.py +3 -3
- {pycordviews-1.2.25.dist-info → pycordviews-1.3.1.dist-info}/METADATA +12 -6
- {pycordviews-1.2.25.dist-info → pycordviews-1.3.1.dist-info}/RECORD +11 -11
- {pycordviews-1.2.25.dist-info → pycordviews-1.3.1.dist-info}/WHEEL +1 -1
- {pycordviews-1.2.25.dist-info → pycordviews-1.3.1.dist-info}/licenses/LICENSE +0 -0
- {pycordviews-1.2.25.dist-info → pycordviews-1.3.1.dist-info}/top_level.txt +0 -0
pycordViews/multibot/bot.py
CHANGED
@@ -46,7 +46,13 @@ class DiscordBot:
|
|
46
46
|
else:
|
47
47
|
raise BotNotStartedError(self.__bot.user.name)
|
48
48
|
|
49
|
-
def
|
49
|
+
async def __stop_bot_in_thread(self):
|
50
|
+
"""
|
51
|
+
Clear le cache du bot de manière asynchrone
|
52
|
+
"""
|
53
|
+
await self.__bot.close()
|
54
|
+
|
55
|
+
def add_pyFile_commands(self, file: str, reload_command: bool, setup_function: str):
|
50
56
|
"""
|
51
57
|
Ajoute et charge un fichier de commande bot et ses dépendances.
|
52
58
|
Les fichiers doivent avoir une fonction appelée « setup » ou un équivalent passé en paramètre.
|
@@ -75,17 +81,13 @@ class DiscordBot:
|
|
75
81
|
Ne recharge que le fichier et non les commandes du bot !
|
76
82
|
:param file: Le chemin d'accès relatif ou absolue du fichier
|
77
83
|
"""
|
78
|
-
print('ok')
|
79
84
|
module_name = path.splitext(path.basename(file))[0]
|
80
85
|
module_found = False
|
81
86
|
|
82
87
|
# Mise à jour du module et de son setup
|
83
|
-
print(self.__imported_module)
|
84
88
|
for imported in self.__imported_module:
|
85
|
-
|
89
|
+
|
86
90
|
if imported['module'].__name__ == module_name:
|
87
|
-
print('reload module :', module_name)
|
88
|
-
reload(imported['module'])
|
89
91
|
imported['setup_function'] = setup_function
|
90
92
|
module_found = True
|
91
93
|
break
|
@@ -95,7 +97,6 @@ class DiscordBot:
|
|
95
97
|
|
96
98
|
# Supprimer toutes les commandes du bot
|
97
99
|
for command in self.__bot.application_commands:
|
98
|
-
print('del commande', command.name)
|
99
100
|
self.__bot.remove_application_command(command)
|
100
101
|
|
101
102
|
# Réattacher toutes les commandes en réexécutant tous les setup
|
@@ -107,6 +108,42 @@ class DiscordBot:
|
|
107
108
|
reload_command=False
|
108
109
|
)
|
109
110
|
|
111
|
+
def reload_pyFile_commands(self):
|
112
|
+
"""
|
113
|
+
Recharge tous les fichiers de commandes du bot
|
114
|
+
"""
|
115
|
+
for imported in self.__imported_module:
|
116
|
+
self.modify_pyFile_commands(imported['file'], imported['setup_function'])
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
def __call_setup_function_in_command_file(self, file: str, module, setup_function: str, reload_command: bool):
|
121
|
+
"""
|
122
|
+
Appel la fonction de setup du module pour charger toutes les commandes du bot
|
123
|
+
:param file: Le chemin d'accès du fichier de commandes
|
124
|
+
:param module: Le module préchargé
|
125
|
+
:param setup_function: Le nom de la fonction de setup
|
126
|
+
:param reload_command: Si les commandes doivent être recharger sur le bot (envoie une requête à Discord) automatiquement
|
127
|
+
"""
|
128
|
+
if hasattr(module, setup_function): # si la fonction setup (ou autre) est dans le package
|
129
|
+
getattr(module, setup_function)(self.__bot)
|
130
|
+
|
131
|
+
########## permet de modifier le dictionnaire des modules importés si celui-ci existe déjà, sinon il l'ajoute à la liste des dictionaires des modules importés. Utile car on reload tout si un des modules est modifié
|
132
|
+
find = False
|
133
|
+
for mod in self.__imported_module:
|
134
|
+
if mod['module'].__name__ == module.__name__:
|
135
|
+
mod['setup_function'] = setup_function
|
136
|
+
find = True
|
137
|
+
break
|
138
|
+
|
139
|
+
if not find:
|
140
|
+
self.__imported_module.append({'setup_function': setup_function, 'module': module, 'file': file})
|
141
|
+
##########
|
142
|
+
|
143
|
+
if reload_command:
|
144
|
+
self.reload_commands()
|
145
|
+
else:
|
146
|
+
raise SetupCommandFunctionNotFound(setup_function, file)
|
110
147
|
|
111
148
|
def reload_commands(self, commands: Optional[list[ApplicationCommand]] = None):
|
112
149
|
"""
|
@@ -114,6 +151,17 @@ class DiscordBot:
|
|
114
151
|
"""
|
115
152
|
run_coroutine_threadsafe(self.__reload_commands(commands=commands), self.__loop).result(timeout=30)
|
116
153
|
|
154
|
+
async def __reload_commands(self, commands: Optional[list[ApplicationCommand]] = None):
|
155
|
+
"""
|
156
|
+
Recharge les commandes quand le bot est ready
|
157
|
+
"""
|
158
|
+
if self.__running_bot is not None:
|
159
|
+
while not self.is_ready:
|
160
|
+
await sleep(0.3)
|
161
|
+
await self.__bot.register_commands(commands=commands, method='individual', force=False)
|
162
|
+
else:
|
163
|
+
raise BotNotStartedError(self.__token)
|
164
|
+
|
117
165
|
|
118
166
|
@property
|
119
167
|
def is_running(self) -> bool:
|
@@ -135,12 +183,6 @@ class DiscordBot:
|
|
135
183
|
return self.__bot.is_ws_ratelimited()
|
136
184
|
|
137
185
|
|
138
|
-
async def __stop_bot_in_thread(self):
|
139
|
-
"""
|
140
|
-
Clear le cache du bot de manière asynchrone
|
141
|
-
"""
|
142
|
-
await self.__bot.close()
|
143
|
-
|
144
186
|
def close_ascyncio_loop(self):
|
145
187
|
"""
|
146
188
|
Ferme la boucle asyncio
|
@@ -153,42 +195,4 @@ class DiscordBot:
|
|
153
195
|
|
154
196
|
self.__loop.close()
|
155
197
|
|
156
|
-
async def __reload_commands(self, commands: Optional[list[ApplicationCommand]]):
|
157
|
-
"""
|
158
|
-
Recharge les commandes quand le bot est ready
|
159
|
-
"""
|
160
|
-
if self.__running_bot is not None:
|
161
|
-
while not self.is_ready:
|
162
|
-
await sleep(0.3)
|
163
|
-
await self.__bot.register_commands(commands=commands, method='individual', force=False)
|
164
|
-
else:
|
165
|
-
raise BotNotStartedError(self.__token)
|
166
|
-
|
167
|
-
def __call_setup_function_in_command_file(self, file: str, module, setup_function: str, reload_command: bool):
|
168
|
-
"""
|
169
|
-
Appel la fonction de setup du module pour charger toutes les commandes du bot
|
170
|
-
:param file: Le chemin d'accès du fichier de commandes
|
171
|
-
:param module: Le module préchargé
|
172
|
-
:param setup_function: Le nom de la fonction de setup
|
173
|
-
:param reload_command: Si les commandes doivent être recharger sur le bot (envoie une requête à Discord) automatiquement
|
174
|
-
"""
|
175
|
-
if hasattr(module, setup_function): # si la fonction setup (ou autre) est dans le package
|
176
|
-
getattr(module, setup_function)(self.__bot)
|
177
|
-
|
178
|
-
########## permet de modifier le dictionnaire des modules importés si celui-ci existe déjà, sinon il l'ajoute à la liste des dictionaires des modules importés. Utile car on reload tout si un des modules est modifié
|
179
|
-
find = False
|
180
|
-
for mod in self.__imported_module:
|
181
|
-
if mod['module'].__name__ == module.__name__:
|
182
|
-
mod['setup_function'] = setup_function
|
183
|
-
find = True
|
184
|
-
break
|
185
|
-
|
186
|
-
if not find:
|
187
|
-
self.__imported_module.append({'setup_function': setup_function, 'module': module})
|
188
|
-
##########
|
189
|
-
|
190
|
-
if reload_command:
|
191
|
-
self.reload_commands()
|
192
|
-
else:
|
193
|
-
raise SetupCommandFunctionNotFound(setup_function, file)
|
194
198
|
|
pycordViews/multibot/errors.py
CHANGED
@@ -27,4 +27,8 @@ class SetupCommandFunctionNotFound(MultibotError):
|
|
27
27
|
|
28
28
|
class CommandFileNotFoundError(MultibotError):
|
29
29
|
def __init__(self, file_name: str):
|
30
|
-
super().__init__(f"'{file_name}' file not found ! Init commands impossible
|
30
|
+
super().__init__(f"'{file_name}' file not found ! Init commands impossible !")
|
31
|
+
|
32
|
+
class ModuleNotFoundError(MultibotError):
|
33
|
+
def __init__(self, module_name: str):
|
34
|
+
super().__init__(f"{module_name} module not found !")
|
pycordViews/multibot/multibot.py
CHANGED
@@ -3,7 +3,7 @@ from multiprocessing.queues import Queue
|
|
3
3
|
from .process import ManageProcess
|
4
4
|
from discord import Intents
|
5
5
|
from sys import platform
|
6
|
-
from typing import Union
|
6
|
+
from typing import Union, Optional
|
7
7
|
|
8
8
|
|
9
9
|
class Multibot:
|
@@ -84,7 +84,26 @@ class Multibot:
|
|
84
84
|
self.__main_queue.put({'type': "STOP", 'bot_name': bot_name})
|
85
85
|
results.append(self.__get_data_queue())
|
86
86
|
return results
|
87
|
-
|
87
|
+
|
88
|
+
def restart(self, *bot_names: str) -> list[dict[str, str]]:
|
89
|
+
"""
|
90
|
+
Stop and start bots.
|
91
|
+
This function is slow ! It's shutdown all bots properly.
|
92
|
+
"""
|
93
|
+
results = []
|
94
|
+
for bot_name in bot_names:
|
95
|
+
self.__main_queue.put({'type': "RESTART", 'bot_name': bot_name})
|
96
|
+
results.append(self.__get_data_queue())
|
97
|
+
return results
|
98
|
+
|
99
|
+
def restart_all(self):
|
100
|
+
"""
|
101
|
+
Stop and restart all bots
|
102
|
+
This function is slow ! It's shutdown all bots properly.
|
103
|
+
"""
|
104
|
+
self.__main_queue.put({'type': "RESTARTALL"})
|
105
|
+
return self.__get_data_queue()
|
106
|
+
|
88
107
|
def start_all(self) -> list[dict[str, list[str]]]:
|
89
108
|
"""
|
90
109
|
Start all bots in the process.
|
@@ -100,6 +119,25 @@ class Multibot:
|
|
100
119
|
self.__main_queue.put({'type': "STOPALL"})
|
101
120
|
return self.__get_data_queue()
|
102
121
|
|
122
|
+
def add_modules(self, *modules_name):
|
123
|
+
"""
|
124
|
+
Adds modules (library) to the process (thus affecting bots).
|
125
|
+
Only previously removed modules can be added again!
|
126
|
+
To be run before launching a bot!
|
127
|
+
:param modules_name: names of modules to be added
|
128
|
+
"""
|
129
|
+
self.__main_queue.put({'type': "ADD_MODULES", 'modules_name': modules_name})
|
130
|
+
return self.__get_data_queue()
|
131
|
+
|
132
|
+
def remove_modules(self, *modules_name):
|
133
|
+
"""
|
134
|
+
Removes modules (library) to the process (thus affecting bots).
|
135
|
+
To be run before launching a bot!
|
136
|
+
:param modules_name: names of modules to be removed
|
137
|
+
"""
|
138
|
+
self.__main_queue.put({'type': "REMOVE_MODULES", 'modules_name': modules_name})
|
139
|
+
return self.__get_data_queue()
|
140
|
+
|
103
141
|
def is_started(self, bot_name: str) -> bool:
|
104
142
|
"""
|
105
143
|
Return the current Websocket connexion status
|
@@ -148,7 +186,7 @@ class Multibot:
|
|
148
186
|
|
149
187
|
:param bot_name: The bot's name to add commands file
|
150
188
|
:param file: Relative or absolute commands file's path
|
151
|
-
:param setup_function: Function name called by the process to give the Bot instance.
|
189
|
+
:param setup_function: Function name called by the process to give the Bot instance. Set to 'setup' by default.
|
152
190
|
:param reload_command: Reload all command in the fil and dependencies. Default : True
|
153
191
|
"""
|
154
192
|
self.__main_queue.put({'type': "ADD_COMMAND_FILE",
|
pycordViews/multibot/process.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
from multiprocessing import Queue
|
2
|
-
from .errors import BotAlreadyExistError, BotNotFoundError, MultibotError, BotNotStartedError
|
2
|
+
from .errors import BotAlreadyExistError, BotNotFoundError, MultibotError, BotNotStartedError, ModuleNotFoundError
|
3
3
|
from .bot import DiscordBot
|
4
4
|
from discord import Intents
|
5
5
|
from immutableType import Str_
|
6
|
+
from sys import modules
|
6
7
|
|
7
8
|
class ManageProcess:
|
8
9
|
|
@@ -13,24 +14,29 @@ class ManageProcess:
|
|
13
14
|
self.__bots: dict[str, DiscordBot] = {}
|
14
15
|
self.main_queue: Queue = main_queue
|
15
16
|
self.process_queue: Queue = process_queue
|
17
|
+
self.removed_modules: dict[str, "ModuleType"] = {}
|
16
18
|
|
17
19
|
self.commandes = {
|
18
20
|
"ADD": self.add_bot_to_process,
|
19
21
|
"REMOVE": self.remove_bot_to_process,
|
20
22
|
"START": self.start_bot_to_process,
|
21
23
|
"STOP": self.stop_bot_to_process,
|
24
|
+
"RESTART": self.restart_bot_to_process,
|
22
25
|
"IS_STARTED": self.is_started,
|
23
26
|
"IS_READY": self.is_ready,
|
24
27
|
"IS_WS_RATELIMITED": self.is_ws_ratelimited,
|
25
28
|
"STOPALL": self.stop_all_bot_to_process,
|
26
29
|
"STARTALL": self.start_all_bot_to_process,
|
30
|
+
"RESTARTALL": self.restart_all_bot_to_process,
|
27
31
|
"BOT_COUNT": self.bot_count,
|
28
32
|
"STARTED_BOT_COUNT": self.started_bot_count,
|
29
33
|
"SHUTDOWN_BOT_COUNT": self.shutdown_bot_count,
|
30
34
|
"BOTS_bot_name": self.get_bots_bot_name,
|
31
35
|
"RELOAD_COMMANDS": self.reload_all_commands,
|
32
36
|
"ADD_COMMAND_FILE": self.add_pyFile_commands,
|
33
|
-
"MODIFY_COMMAND_FILE": self.modify_pyFile_commands
|
37
|
+
"MODIFY_COMMAND_FILE": self.modify_pyFile_commands,
|
38
|
+
"REMOVE_MODULES": self.remove_modules,
|
39
|
+
"ADD_MODULES": self.add_modules
|
34
40
|
}
|
35
41
|
|
36
42
|
def run(self):
|
@@ -69,6 +75,26 @@ class ManageProcess:
|
|
69
75
|
self.__bots[bot_name].stop()
|
70
76
|
return f'{bot_name} bot stopped'
|
71
77
|
|
78
|
+
def restart_bot_to_process(self, bot_name: str) -> str:
|
79
|
+
"""
|
80
|
+
Redémarre un bot du processus
|
81
|
+
:param bot_name: Le nom du bot à redémarrer
|
82
|
+
"""
|
83
|
+
self.if_bot_no_exist(bot_name)
|
84
|
+
self.__bots[bot_name].stop()
|
85
|
+
self.__bots[bot_name].start()
|
86
|
+
self.__bots[bot_name].reload_pyFile_commands()
|
87
|
+
return f'{bot_name} bot restarted'
|
88
|
+
|
89
|
+
def restart_all_bot_to_process(self) -> list[str]:
|
90
|
+
"""
|
91
|
+
Redémarre tous les bots du processus
|
92
|
+
"""
|
93
|
+
result = []
|
94
|
+
for bot in self.__bots.keys():
|
95
|
+
result.append(self.restart_bot_to_process(bot))
|
96
|
+
return result
|
97
|
+
|
72
98
|
def start_all_bot_to_process(self) -> list[str]:
|
73
99
|
"""
|
74
100
|
Start tous les bots du processus
|
@@ -114,8 +140,8 @@ class ManageProcess:
|
|
114
140
|
:param reload_command : Recharge toutes les commandes dans le fichier et les dépendances. Défaut : True
|
115
141
|
"""
|
116
142
|
self.if_bot_no_exist(bot_name)
|
117
|
-
setup_function = Str_(setup_function).str_
|
118
143
|
file = Str_(file).str_
|
144
|
+
setup_function = Str_(setup_function).str_
|
119
145
|
self.__bots[bot_name].add_pyFile_commands(file=file, setup_function=setup_function, reload_command=reload_command)
|
120
146
|
|
121
147
|
def modify_pyFile_commands(self, bot_name: str, file: str, setup_function: str):
|
@@ -153,6 +179,33 @@ class ManageProcess:
|
|
153
179
|
del self.__bots[bot_name]
|
154
180
|
return f'Bot {bot_name} removed'
|
155
181
|
|
182
|
+
def remove_modules(self, modules_name: tuple[str]):
|
183
|
+
"""
|
184
|
+
Enlève les modules (bibliothèque) de tous le processus (affecte donc les bots).
|
185
|
+
A éxécuter avant de lancer un bot !
|
186
|
+
:param modules_name: Tuple contenant les noms des modules à enlever
|
187
|
+
"""
|
188
|
+
for module in modules_name:
|
189
|
+
if module in modules_name:
|
190
|
+
self.removed_modules[module] = modules.pop(module)
|
191
|
+
else:
|
192
|
+
raise ModuleNotFoundError(module)
|
193
|
+
return f"[{', '.join(modules_name)}] modules removed"
|
194
|
+
|
195
|
+
def add_modules(self, modules_name: tuple[str]):
|
196
|
+
"""
|
197
|
+
Ajoute les modules (bibliothèque) de tous le processus (affecte donc les bots).
|
198
|
+
Uniquement les modules enlever au préalable peuvent-être de nouveau ajouter !
|
199
|
+
A éxécuter avant de lancer un bot !
|
200
|
+
:param modules_name: Tuple contenant les noms des modules à ajouter
|
201
|
+
"""
|
202
|
+
for module in modules_name:
|
203
|
+
if module in self.removed_modules.keys():
|
204
|
+
modules[module] = self.removed_modules.pop(module)
|
205
|
+
else:
|
206
|
+
raise ModuleNotFoundError(module)
|
207
|
+
return f"[{', '.join(modules_name)}] modules added"
|
208
|
+
|
156
209
|
def is_started(self, bot_name: str) -> bool:
|
157
210
|
"""
|
158
211
|
Regarde si la connexion au Websocket est effectué
|
@@ -67,7 +67,7 @@ class Pagination:
|
|
67
67
|
page_count = len(self.__pages)
|
68
68
|
|
69
69
|
if page_count <= 1:
|
70
|
-
await self.__view.
|
70
|
+
await self.__view.shutdown()
|
71
71
|
await interaction.response.defer(invisible=True)
|
72
72
|
return
|
73
73
|
|
@@ -134,3 +134,7 @@ class Pagination:
|
|
134
134
|
(start to 0)
|
135
135
|
"""
|
136
136
|
return self.__current_page
|
137
|
+
|
138
|
+
@property
|
139
|
+
def get_view(self) -> EasyModifiedViews:
|
140
|
+
return self.__view
|
@@ -290,14 +290,14 @@ class EasyModifiedViews(View):
|
|
290
290
|
|
291
291
|
await self._update()
|
292
292
|
|
293
|
-
def on_timeout(self) -> None:
|
293
|
+
async def on_timeout(self) -> None:
|
294
294
|
"""
|
295
295
|
Called if timeout view is finished
|
296
296
|
"""
|
297
297
|
if self.__disabled_on_timeout:
|
298
|
-
|
298
|
+
await self.shutdown()
|
299
299
|
if self.__call_on_timeout is not None:
|
300
|
-
|
300
|
+
await self.__call_on_timeout(self.__ctx)
|
301
301
|
|
302
302
|
def call_on_timeout(self, _callable: Callable) -> None:
|
303
303
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: PycordViews
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.1
|
4
4
|
Summary: Views and multibot for py-cord library
|
5
5
|
Home-page: https://github.com/BOXERRMD/Py-cord_Views
|
6
6
|
Author: Chronos (alias BOXERRMD)
|
@@ -47,7 +47,7 @@ The paginator instance is used to create a view acting as a “book”, with pag
|
|
47
47
|
>
|
48
48
|
> > **Method** `send(target: Union[Member, TextChannel]) -> Any` : Send the pagination in dm member or channels
|
49
49
|
>
|
50
|
-
> > **Method** `respond(ctx: ApplicationContext) -> Any` : Respond at slash command call
|
50
|
+
> > **Method** `respond(ctx: Union[ApplicationContext, Interaction]) -> Any` : Respond at slash command call
|
51
51
|
>
|
52
52
|
> > **@property** `get_view -> EasyModifiedViews` : Return the pagination view. Can be used in `view` parameter to setup a view
|
53
53
|
>
|
@@ -75,7 +75,7 @@ async def pagination_command(ctx):
|
|
75
75
|
pages.add_page(content="My last page !", embed=None)# reset embed else he show the embed of the page before
|
76
76
|
|
77
77
|
await pages.respond(ctx=ctx) # respond to the command
|
78
|
-
await pages.send(
|
78
|
+
await pages.send(target=ctx.author) # send the message to the command author
|
79
79
|
|
80
80
|
bot.run("Your token")
|
81
81
|
```
|
@@ -95,11 +95,12 @@ The SelectMenu instance is used to create drop-down menus that can be easily mod
|
|
95
95
|
>
|
96
96
|
> > **Method** `add_mentionnable_select_menu(custom_id: str = None, placeholder: str = None, min_values: int = 1, max_values: int = 1, disabled=False, row=None) -> Menu` : Add a mentionable select menu in the ui. Return Menu instance to set options
|
97
97
|
>
|
98
|
-
> > **Method** `set_callable(*custom_ids: str, _callable: Union[Callable, None], data: Optional[dict[str, Any]]
|
98
|
+
> > **Method** `set_callable(*custom_ids: str, _callable: Union[Callable, None], data: Optional[dict[str, Any]], autorised_roles : Optional[list[Union[int, Role]]] = None,
|
99
|
+
autorised_key: Optional[Callable] = None) -> SelectMenu` : Set a callable for menus associated with custom_ids. This callable _(async function)_ will be set to respond at selected menus interactions. _data_ parameter is a dict fill with any values to pass in _(async function)_ parameters
|
99
100
|
>
|
100
101
|
> > **Method** `send(target: Union[Member, TextChannel]) -> Any` : Send the selectmenu in dm member or channels
|
101
102
|
>
|
102
|
-
> > **Method** `respond(ctx: ApplicationContext) -> Any` : Respond at slash command call
|
103
|
+
> > **Method** `respond(ctx: Union[ApplicationContext, Interaction]) -> Any` : Respond at slash command call and Interaction
|
103
104
|
>
|
104
105
|
> > **Method** `update() -> None` : Update the view dynamically if there was sent before.
|
105
106
|
>
|
@@ -113,7 +114,10 @@ The SelectMenu instance is used to create drop-down menus that can be easily mod
|
|
113
114
|
> ```python
|
114
115
|
> Menu(...)` # Not to be initialized by the user
|
115
116
|
> ```
|
116
|
-
> > **Method** `set_callable(_callable: Union[Callable, None]
|
117
|
+
> > **Method** `set_callable(_callable: Union[Callable, None],
|
118
|
+
data: Optional[dict[str, Any]] = None,
|
119
|
+
autorised_roles : Optional[list[Union[int, Role]]] = None,
|
120
|
+
autorised_key: Optional[Callable] = None) -> Menu` : Set a callable for menus associated. This callable _(async function)_ will be set to respond at selected menus interactions
|
117
121
|
>
|
118
122
|
> > **Method** `add_option(label: str, value: str = MISSING, description: Union[str, None] = None, emoji: Union[str, Emoji, PartialEmoji, None] = None, default: bool = False) -> Menu` : Add a string select option. Only for string select menu !
|
119
123
|
>
|
@@ -171,6 +175,8 @@ Each instance of this class creates a process where bots can be added. These bot
|
|
171
175
|
>
|
172
176
|
> > **Method** `stop(*bot_names: str) -> list[dict[str, str]]` : Stop bots properly
|
173
177
|
>
|
178
|
+
> > **Method** `restart(*bot_names: str) -> list[dict[str, str]]` : Restarts bots
|
179
|
+
>
|
174
180
|
> > **Method** `start_all() -> list[dict[str, list[str]]]` : Start all bot in the process
|
175
181
|
>
|
176
182
|
> > **Method** `stop_all() -> list[dict[str, list[str]]]` : Stop all bot in the process properly
|
@@ -10,19 +10,19 @@ pycordViews/modal/__init__.py,sha256=TFUX3z25oInBhBzoOQhnLbKmwArXo4IVVqBfN6y11Bo
|
|
10
10
|
pycordViews/modal/easy_modal_view.py,sha256=sNxfSg6sgoiKa3vc6eKa4RV7vNVNaSrI1XUJ9RMSD80,4281
|
11
11
|
pycordViews/modal/errors.py,sha256=nIGYyOS_oWH49Dj8ZGW53nnzaPmbvFbAo7ydikD5xWE,307
|
12
12
|
pycordViews/multibot/__init__.py,sha256=93Q_URiRUMsvwQJIqUnb75aq6SPM83yteSMrH0rmXMg,30
|
13
|
-
pycordViews/multibot/bot.py,sha256=
|
14
|
-
pycordViews/multibot/errors.py,sha256=
|
15
|
-
pycordViews/multibot/multibot.py,sha256=
|
16
|
-
pycordViews/multibot/process.py,sha256=
|
13
|
+
pycordViews/multibot/bot.py,sha256=pD-BPXNo7JeJPguTn7qLii0UzBSS4ITvmOPv8htKJG8,8284
|
14
|
+
pycordViews/multibot/errors.py,sha256=sPl_mM6b72Q8uuz4JkocO0TKBQ_9R3f0yT5eGhH_-PY,1328
|
15
|
+
pycordViews/multibot/multibot.py,sha256=625UTZ1FcgjR_BzXv2LZfkXonq9qosB_C1-zazr1pYs,9112
|
16
|
+
pycordViews/multibot/process.py,sha256=efSWVeHxrN88RdikUb3oOm8pAKgnQn2Q20CZqXGATfo,10114
|
17
17
|
pycordViews/pagination/__init__.py,sha256=rvOp-nGXZ6EX_ojK1_1lcOHYUcrB0LG3DL7zwatkRPY,105
|
18
18
|
pycordViews/pagination/errors.py,sha256=CYb5gBcXx0kYDUDkNpfUrqSxQAcJE_qfpomWtUFOsTk,316
|
19
19
|
pycordViews/pagination/page.py,sha256=sKi_gCFt1euY7uJKWgMnxEqP1B4LMhUysxQ8oQbhNVQ,1147
|
20
|
-
pycordViews/pagination/pagination_view.py,sha256=
|
20
|
+
pycordViews/pagination/pagination_view.py,sha256=t6wvTLNTYg-w4eJQiyiX-LmEeR385SChifUzhiVSZBs,5793
|
21
21
|
pycordViews/views/__init__.py,sha256=yligptZmw-np8tjKLr76SVmi0807Nk6jCyKkKYLhbCY,89
|
22
|
-
pycordViews/views/easy_modified_view.py,sha256=
|
22
|
+
pycordViews/views/easy_modified_view.py,sha256=dOiSZ59zthRUV6s-mzdnql0o-z6hQM2ppKShJjmipu0,13992
|
23
23
|
pycordViews/views/errors.py,sha256=AkhGskuBjbFs0ZQdTDlVyfvAJ1WRMMQx2sAXUnYjmog,360
|
24
|
-
pycordviews-1.
|
25
|
-
pycordviews-1.
|
26
|
-
pycordviews-1.
|
27
|
-
pycordviews-1.
|
28
|
-
pycordviews-1.
|
24
|
+
pycordviews-1.3.1.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
|
25
|
+
pycordviews-1.3.1.dist-info/METADATA,sha256=Qf2sc2nqKIu9X02j7OEjSs4vVjHA5EC14fXgglLjVyI,12417
|
26
|
+
pycordviews-1.3.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
27
|
+
pycordviews-1.3.1.dist-info/top_level.txt,sha256=3NvgH6MjESe7Q6jb6aqHgdYrYb5NhxwxnoDyE6PkThY,125
|
28
|
+
pycordviews-1.3.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|