Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Üsame Cengiz
Zote Bot
Commits
5dacbb74
Commit
5dacbb74
authored
May 09, 2021
by
Üsame Cengiz
Browse files
deleted rename cuz discord API doesnt allow FUN
parent
7048d5d5
Changes
1
Show whitespace changes
Inline
Side-by-side
bot.py
View file @
5dacbb74
...
...
@@ -85,8 +85,8 @@ async def on_message(message):
if
message
.
channel
==
tc
:
channel_creator
.
pop
(
message
.
author
)
await
vc
.
edit
(
name
=
message
.
content
)
elif
message
.
content
.
startswith
(
'~rename'
):
await
rename_single_channel
(
message
)
#
elif message.content.startswith('~rename'):
#
await rename_single_channel(message)
elif
message
.
content
.
endswith
(
'%'
)
and
message
.
content
.
startswith
(
'~'
):
name
=
message
.
content
[
1
:
-
1
]
n
=
random
.
randint
(
0
,
100
)
...
...
@@ -216,7 +216,7 @@ async def channel_manager_for_one_voice_channel(member, before, after):
for
vc_id
in
single_channel_manager
:
if
b_channel
.
id
in
single_channel_manager
[
vc_id
][
1
]:
b_relevant
=
True
refs_to_b
.
append
(
single_channel_manager
[
vc_id
][
1
]
)
refs_to_b
.
append
(
vc_id
)
b_relevant
=
b_relevant
and
len
(
b_channel
.
members
)
==
0
a_relevant
=
False
if
a_channel
is
None
else
a_channel
.
id
in
single_channel_manager
and
len
(
a_channel
.
members
)
>
0
...
...
@@ -226,7 +226,8 @@ async def channel_manager_for_one_voice_channel(member, before, after):
if
b_relevant
:
for
s
in
refs_to_b
:
s
.
discard
(
b_channel
)
single_channel_manager
[
s
][
1
].
discard
(
b_channel
.
id
)
update_guilds_txt
()
if
a_relevant
:
if
(
a_channel
.
id
not
in
single_channel_creation_set
):
...
...
@@ -245,16 +246,18 @@ async def channel_manager_for_one_voice_channel(member, before, after):
if
b_relevant
:
await
b_channel
.
delete
()
async
def
rename_single_channel
(
message
):
global
single_channel_manager
new_name
=
""
.
join
(
message
.
split
(
' '
)[
1
:])
curr
=
message
.
author
.
voice
.
channel
for
key
in
single_channel_manager
:
(
tc
,
clones
)
=
single_channel_manager
[
key
]
if
curr
in
clones
:
await
curr
.
edit
(
name
=
new_name
)
break
# async def rename_single_channel(message):
# global single_channel_manager
# new_name = " ".join(message.content.split(' ')[1:])
# curr = message.author.voice.channel
# for key in single_channel_manager:
# (tc, clones) = single_channel_manager[key]
# print(curr.name)
# if curr.id in clones:
# await curr.edit(name=new_name)
# break
# print("done")
# This function is for category channel management
async
def
channel_manager_for_all_voice_channels
(
member
,
before
,
after
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment