Skip to content

Commit

Permalink
Update 1.3.1
Browse files Browse the repository at this point in the history
temporary removed stage channels clone
  • Loading branch information
itskekoff committed May 27, 2023
1 parent 8005c82 commit 0feac3e
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.json
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/discord-server-copy.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions 27-05-2023-discord.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
2023-05-27 17:39:25,197 | INFO | Logging in using static token.
2023-05-27 17:39:26,303 | INFO | Found user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, build number 199933.
2023-05-27 17:39:28,885 | INFO | Connected to Gateway (Session ID: 02786e085e68b4fe4299e609a72aa300).
2023-05-27 17:39:29,000 | WARNING | Member list scraping failed for 1018134604051394660 (Failed to automatically choose channels; please specify them manually).
2023-05-27 17:39:29,000 | WARNING | Member list scraping failed for 1058380535262617716 (Failed to automatically choose channels; please specify them manually).
2023-05-27 17:39:29,000 | WARNING | Member list scraping failed for 995647102598262796 (Failed to automatically choose channels; please specify them manually).
2023-05-27 17:45:26,302 | ERROR | Ignoring exception in command copy
Traceback (most recent call last):
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\ext\commands\core.py", line 236, in wrapped
ret = await coro(*args, **kwargs)
File "D:\PycharmProjects\discord-server-copy\main.py", line 392, in copy
await cloner.clone_channels(perms=clone_overwrites)
File "D:\PycharmProjects\discord-server-copy\main.py", line 269, in clone_channels
new_channel = await self.new_guild.create_stage_channel(name=channel.name,
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\guild.py", line 1726, in create_stage_channel
data = await self._create_channel(
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\http.py", line 838, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50024): Cannot execute action on this channel type

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\ext\commands\bot.py", line 1169, in invoke
await ctx.command.invoke(ctx)
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\ext\commands\core.py", line 1020, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "D:\PycharmProjects\discord-server-copy\venv\lib\site-packages\discord\ext\commands\core.py", line 245, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50024): Cannot execute action on this channel type
14 changes: 14 additions & 0 deletions 27-05-2023-error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
2023-05-27 15:40:12,622 | INFO | Logging in using static token.
2023-05-27 15:40:14,517 | INFO | Found user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, build number 199933.
2023-05-27 15:40:17,990 | INFO | Connected to Gateway (Session ID: 87c134269dcb42197cd683d7b3799718).
2023-05-27 15:40:18,094 | WARNING | Member list scraping failed for 1111981887838244934 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:40:18,094 | WARNING | Member list scraping failed for 1018134604051394660 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:40:18,094 | WARNING | Member list scraping failed for 1058380535262617716 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:40:18,094 | WARNING | Member list scraping failed for 995647102598262796 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:43:12,366 | INFO | Logging in using static token.
2023-05-27 15:43:12,996 | INFO | Found user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, build number 199933.
2023-05-27 15:43:15,437 | INFO | Connected to Gateway (Session ID: 8af13203148cf7cdd9d59dd6ae54fa1c).
2023-05-27 15:43:15,534 | WARNING | Member list scraping failed for 1018134604051394660 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:43:15,534 | WARNING | Member list scraping failed for 1058380535262617716 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:43:15,534 | WARNING | Member list scraping failed for 995647102598262796 (Failed to automatically choose channels; please specify them manually).
2023-05-27 15:43:15,535 | WARNING | Member list scraping failed for 1111982092176330774 (Failed to automatically choose channels; please specify them manually).
46 changes: 18 additions & 28 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,40 +241,30 @@ async def clone_channels(self, perms: bool = True):
if isinstance(role, discord.Role):
overwrites[self.mappings["roles"][role]] = permissions
if isinstance(channel, discord.TextChannel):
new_channel: discord.TextChannel = await self.new_guild.create_text_channel(name=channel.name,
position=channel.position,
topic=channel.topic,
slowmode_delay=channel.slowmode_delay,
nsfw=channel.nsfw,
category=
self.mappings["categories"][
channel.category],
overwrites=overwrites
)
new_channel = await self.new_guild.create_text_channel(name=channel.name,
position=channel.position,
topic=channel.topic,
slowmode_delay=channel.slowmode_delay,
nsfw=channel.nsfw,
category=
self.mappings["categories"][
channel.category],
overwrites=overwrites)
self.mappings["channels"][channel] = new_channel
if self.debug:
logger.debug("Created text channel " + str(channel.id) + " | " + new_channel.name)
elif isinstance(channel, discord.VoiceChannel):
bitrate = channel.bitrate if channel.bitrate <= 96000 else None
new_channel: discord.VoiceChannel = await self.new_guild.create_voice_channel(name=channel.name,
position=channel.position,
bitrate=bitrate,
user_limit=channel.user_limit,
category=self.mappings[
"categories"][
channel.category],
overwrites=overwrites)
new_channel = await self.new_guild.create_voice_channel(name=channel.name,
position=channel.position,
bitrate=bitrate,
user_limit=channel.user_limit,
category=self.mappings[
"categories"][
channel.category],
overwrites=overwrites)
if self.debug:
logger.debug("Created voice channel " + str(channel.id) + " | " + new_channel.name)
elif isinstance(channel, discord.StageChannel):
new_channel: discord.StageChannel = await self.new_guild.create_stage_channel(name=channel.name,
position=channel.position,
category=self.mappings[
"categories"][
channel.category],
overwrites=overwrites)
if self.debug:
logger.debug("Created stage channel " + str(channel.id) + " | " + new_channel.name)
await asyncio.sleep(self.delay)

async def clone_emojis(self):
Expand Down Expand Up @@ -399,7 +389,7 @@ async def copy(ctx: commands.Context, server_id: int = None):

if __name__ == '__main__':
LoggerSetup(debug_enabled=debug)
Updater("1.3.0")
Updater("1.3.1")
file_handler = logging.FileHandler(f'{datetime.now().strftime("%d-%m-%Y")}-discord.log')
file_handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s | %(levelname)s | %(message)s')
Expand Down

0 comments on commit 0feac3e

Please sign in to comment.