Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Bots-Discord
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Skyler Mäntysaari
Bots-Discord
Commits
c48f93b5
Commit
c48f93b5
authored
6 years ago
by
Sami
Browse files
Options
Downloads
Patches
Plain Diff
Migrate: More updates
parent
5cfd45fa
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Music-bot/bot.py
+3
-2
3 additions, 2 deletions
Music-bot/bot.py
Music-bot/cogs/music.py
+12
-2
12 additions, 2 deletions
Music-bot/cogs/music.py
with
15 additions
and
4 deletions
Music-bot/bot.py
+
3
−
2
View file @
c48f93b5
...
...
@@ -37,6 +37,7 @@ if __name__ == '__main__':
except
:
print
(
f
'
Failed to load extension
{
extension
}
.
'
,
file
=
sys
.
stderr
)
traceback
.
print_exc
()
bot
.
run
(
dev_token
)
#
# bot.run(production_token)
This diff is collapsed.
Click to expand it.
Music-bot/cogs/music.py
+
12
−
2
View file @
c48f93b5
...
...
@@ -17,6 +17,7 @@ import itertools
import
sys
import
traceback
from
functools
import
partial
from
typing
import
List
import
discord
import
youtube_dl
...
...
@@ -310,11 +311,14 @@ class Music:
vc
.
resume
()
await
ctx
.
send
(
f
'
**`
{
ctx
.
author
}
`**: Resumed the song!
'
)
@commands.command
(
name
=
'
vote_skip
'
)
@commands.command
(
name
=
'
vote_skip
'
,
enabled
=
False
)
async
def
vote_skip_
(
self
,
ctx
):
"""
Skips the song if the required votes have been acquired
"""
vc
=
ctx
.
voice_client
votes
=
[]
votes
:
List
[
str
]
=
[]
votes_needed
=
int
(
3
)
vote_count
=
int
(
0
)
if
not
vc
or
not
vc
.
is_connected
():
return
await
ctx
.
send
(
'
I am not currently playing anything!
'
,
delete_after
=
20
)
...
...
@@ -326,9 +330,15 @@ class Music:
if
not
{
ctx
.
author
}
in
votes
:
votes
.
append
(
f
'
{
ctx
.
author
}
'
)
await
ctx
.
send
(
f
"
There is now
{
len
(
votes
)
}
votes!
"
)
await
ctx
.
send
(
votes
)
elif
{
ctx
.
author
}
in
votes
:
await
ctx
.
send
(
f
"
**`
{
ctx
.
author
}
`**: You have already voted
"
)
if
len
(
votes
)
==
votes_needed
or
len
(
votes
)
>
votes_needed
:
await
ctx
.
send
(
"
We have enough votes to skip, skipping.
"
)
vc
.
stop
()
@commands.command
(
name
=
'
skip
'
)
@checks.song_requester_or_dj
()
async
def
skip_
(
self
,
ctx
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment