Skip to content

Commit bbde60a

Browse files
committed
Solved using deepcopy
1 parent 9060bfd commit bbde60a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

discord_slash/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import logging
23
import typing
34
import discord
@@ -209,11 +210,11 @@ async def to_dict(self):
209210
for y in selected.allowed_guild_ids:
210211
if y not in wait:
211212
wait[y] = {}
212-
wait[y][x] = command_dict
213+
wait[y][x] = copy.deepcopy(command_dict)
213214
else:
214215
if "global" not in wait:
215216
wait["global"] = {}
216-
wait["global"][x] = command_dict
217+
wait["global"][x] = copy.deepcopy(command_dict)
217218

218219
# Separated normal command add and subcommand add not to
219220
# merge subcommands to one. More info at Issue #88
@@ -262,7 +263,6 @@ async def to_dict(self):
262263
if "global" not in queue:
263264
queue["global"] = base_dict
264265
queue["global"]["options"].append(_dict)
265-
print(__import__("json").dumps(queue, indent=2))
266266
for i in queue:
267267
wait[i][x]["options"].append(queue[i])
268268

0 commit comments

Comments
 (0)