mirror of
https://github.com/RGBCube/minearchy-bot
synced 2025-07-27 08:57:46 +00:00
a
This commit is contained in:
parent
8c954ed8d2
commit
a4d6277e72
1 changed files with 77 additions and 72 deletions
|
@ -56,9 +56,11 @@ class Utils(Cog):
|
|||
continue
|
||||
|
||||
if isinstance(channel, CategoryChannel):
|
||||
string.append(f"category {channel.name}:")
|
||||
string.append(f" id: {channel.id}")
|
||||
string.append(f"category `{channel.name}`: ")
|
||||
|
||||
# Category perms start.
|
||||
|
||||
# " permissions:"
|
||||
perms = []
|
||||
|
||||
for thing, overwrites in channel.overwrites.items():
|
||||
|
@ -72,9 +74,6 @@ class Utils(Cog):
|
|||
typ = repr(thing.type)
|
||||
name = "unknown"
|
||||
|
||||
perms.append(f" {typ} {name}:")
|
||||
perms.append(f" id: {thing.id}")
|
||||
|
||||
allow, deny = [], []
|
||||
|
||||
for perm, value in overwrites._values.items():
|
||||
|
@ -84,6 +83,7 @@ class Utils(Cog):
|
|||
deny.append(perm)
|
||||
|
||||
if allow or deny:
|
||||
perms.append(f" {typ} {name}: {thing.id}")
|
||||
perms.append(" permissions:")
|
||||
|
||||
for a in allow:
|
||||
|
@ -91,7 +91,15 @@ class Utils(Cog):
|
|||
for d in deny:
|
||||
perms.append(f" {d}: ❌")
|
||||
|
||||
perms.append(" channels:")
|
||||
if perms:
|
||||
string.append(" permissions:")
|
||||
string.extend(perms)
|
||||
|
||||
# Category perms end.
|
||||
|
||||
# Channel perms start.
|
||||
|
||||
string.append(" channels:")
|
||||
|
||||
for child in channel.channels:
|
||||
if isinstance(child, TextChannel):
|
||||
|
@ -105,8 +113,7 @@ class Utils(Cog):
|
|||
else:
|
||||
typ = "unknown"
|
||||
|
||||
string.append(f" {typ} channel `{child.name}`:")
|
||||
string.append(f" id: {child.id}")
|
||||
string.append(f" {typ} channel `{child.name}`: {child.id}")
|
||||
|
||||
child_perms = []
|
||||
|
||||
|
@ -121,9 +128,6 @@ class Utils(Cog):
|
|||
typ = repr(child_thing.type)
|
||||
name = "unknown"
|
||||
|
||||
child_perms.append(f" {typ} {name}:")
|
||||
child_perms.append(f" id: {child_thing.id}")
|
||||
|
||||
allow, deny = [], []
|
||||
|
||||
for perm, value in overwrites._values.items():
|
||||
|
@ -139,6 +143,7 @@ class Utils(Cog):
|
|||
deny.append(perm)
|
||||
|
||||
if allow or deny:
|
||||
child_perms.append(f" {typ} {name}: {child_thing.id}")
|
||||
string.append(" permissions:")
|
||||
|
||||
for a in allow:
|
||||
|
@ -149,9 +154,8 @@ class Utils(Cog):
|
|||
if child_perms:
|
||||
string.append(" permissions:")
|
||||
string.extend(child_perms)
|
||||
if perms:
|
||||
string.append(" permissions:")
|
||||
string.extend(perms)
|
||||
|
||||
# Child perms end.
|
||||
|
||||
else:
|
||||
if isinstance(channel, TextChannel):
|
||||
|
@ -165,9 +169,10 @@ class Utils(Cog):
|
|||
else:
|
||||
typ = "unknown"
|
||||
|
||||
string.append(f"{typ} channel `{channel.name}`:")
|
||||
string.append(f" id: {channel.id}")
|
||||
string.append(f"{typ} channel `{channel.name}`: {channel.id}")
|
||||
|
||||
# Root perms start.
|
||||
# " permissions:"
|
||||
perms = []
|
||||
|
||||
for thing, overwrites in channel.overwrites.items():
|
||||
|
@ -181,9 +186,6 @@ class Utils(Cog):
|
|||
typ = repr(thing.type)
|
||||
name = "unknown"
|
||||
|
||||
string.append(f" {typ} {name}:")
|
||||
string.append(f" id: {thing.id}")
|
||||
|
||||
allow, deny = [], []
|
||||
|
||||
for perm, value in overwrites._values.items():
|
||||
|
@ -193,6 +195,7 @@ class Utils(Cog):
|
|||
deny.append(perm)
|
||||
|
||||
if allow or deny:
|
||||
string.append(f" {typ} {name}: {thing.id}")
|
||||
string.append(" permissions:")
|
||||
|
||||
for a in allow:
|
||||
|
@ -204,6 +207,8 @@ class Utils(Cog):
|
|||
string.append(" permissions:")
|
||||
string.extend(perms)
|
||||
|
||||
# Root perms end.
|
||||
|
||||
await ctx.reply(
|
||||
file=File(
|
||||
BytesIO("\n".join(string).encode()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue