-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared_lists.py
65 lines (52 loc) · 2.03 KB
/
shared_lists.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import discord
from tinytag import TinyTag
execute = "C:/ffmpeg-20200315-c467328-win64-static/bin/ffmpeg.exe"
directory = "C:/Users/Stephen/PycharmProjects/MafiaBot/data/"
crimes = []
mafia_players = []
mafia_game = []
mafia_vc = None
story = None
story_length = 0
mafia_sounds = []
# Mute [True, False]
async def mute_manage_mafia_players(mute):
for person in mafia_game[0].players:
if person.alive:
try:
await person.info.edit(mute=mute)
except:
pass
async def change_music(index):
global mafia_vc
rewrite_sounds()
mafia_vc.stop()
if index == 100:
mafia_vc.play(story)
else:
mafia_vc.play(mafia_sounds[index])
async def music_init_(channel):
global mafia_vc
mafia_vc = await channel.connect()
def update_story():
global story
global story_length
story = discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}story.mp3")
track = TinyTag.get(f"{directory}story.mp3")
story_length = track.duration
def rewrite_sounds():
global mafia_sounds
mafia_sounds.clear()
mafia_sounds = [discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}midsummer_theme.mp3"),
discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}wwtbam.mp3"),
discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}scream.mp3"),
discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}pink_panther.mp3"),
discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}victory.mp3"),
discord.FFmpegPCMAudio(executable=execute,
source=f"{directory}defeat.mp3")]