mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-15 14:22:13 +00:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97f780688e | |||
| 49e1121967 | |||
| f4f4deb848 | |||
| b15c2f06b8 | |||
| 14b9a50f51 | |||
| 090adf3741 | |||
| 68d17a11b3 | |||
| 1b26fdd841 | |||
| f1129f18cb | |||
| 64669887a3 | |||
| 6d3ce5d714 | |||
| e05f58624a | |||
| 651d796254 | |||
| b3e5a1aaf3 | |||
| 1f0e03590d | |||
| 0ad06cc69c | |||
| 6b5d312231 | |||
| 0674e1a1a8 | |||
| 61acd3f3f3 | |||
| 3ccc89f572 | |||
| 86f512cb34 | |||
| bf808eb634 | |||
| d3bd79b505 | |||
| 24247aa760 | |||
| 443d06280b | |||
| 1625149c64 | |||
| 93330638be | |||
| a830dfb18c | |||
| 28c1565405 | |||
| de3bae7a7f | |||
| 94132a8962 | |||
| 88d8a1bcbe | |||
| dbe33286da | |||
| bbc91fbd73 | |||
| f0bb8f7ac2 | |||
| 061bab8e6d | |||
| bda7c6cc2e | |||
| 3d02d06862 | |||
| c225a3e252 | |||
| 489dd9feb6 | |||
| 63366f7ea1 | |||
| 73f184b263 | |||
| d53feec563 | |||
| ab199fc285 |
+35
-15
@@ -9,13 +9,14 @@ import openai
|
|||||||
import requests
|
import requests
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
from ai_functions import handle_response
|
import ai_functions
|
||||||
from constants import (
|
from constants import (
|
||||||
DATA,
|
DATA,
|
||||||
GRAPHICS_PATH,
|
GRAPHICS_PATH,
|
||||||
INITIAL_TIME_WAIT,
|
INITIAL_TIME_WAIT,
|
||||||
MASTER_TIMEOUT,
|
MASTER_TIMEOUT,
|
||||||
OPENAICLIENT,
|
OPENAICLIENT,
|
||||||
|
WORD_REACTIONS,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -24,11 +25,10 @@ class Events(commands.Cog):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.logger = logging.getLogger("discord")
|
self.logger = logging.getLogger("discord")
|
||||||
|
|
||||||
@commands.Cog.listener()
|
async def cog_load(self):
|
||||||
async def on_ready(self):
|
self.logger.info("Starting personal assistants")
|
||||||
print("Ready!")
|
await ai_functions.hammer_assistant_create(self.bot)
|
||||||
print("Logged in as ---->", self.bot.user)
|
self.logger.info("Started personal assistants")
|
||||||
print("ID:", self.bot.user.id)
|
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
@@ -45,6 +45,7 @@ class Events(commands.Cog):
|
|||||||
channel = None
|
channel = None
|
||||||
if message.author == self.bot.user:
|
if message.author == self.bot.user:
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(message.author, discord.Member):
|
if isinstance(message.author, discord.Member):
|
||||||
for role in message.author.roles:
|
for role in message.author.roles:
|
||||||
if role.name == "Vykidailo":
|
if role.name == "Vykidailo":
|
||||||
@@ -66,14 +67,33 @@ class Events(commands.Cog):
|
|||||||
return
|
return
|
||||||
if isinstance(message.channel, discord.DMChannel):
|
if isinstance(message.channel, discord.DMChannel):
|
||||||
if message.author.id == 346956223645614080:
|
if message.author.id == 346956223645614080:
|
||||||
await message.reply("Witam witam")
|
|
||||||
|
await ai_functions.hammer_assitant_chat(message)
|
||||||
|
|
||||||
|
# hammer pisze dma
|
||||||
|
|
||||||
|
# DM do Saint - przerobic na komende z parametrem "id"
|
||||||
|
# user = await self.bot.fetch_user(703985955312238664)
|
||||||
|
# channel = await user.create_dm()
|
||||||
|
# await channel.send(message.content)
|
||||||
|
# await message.reply(f"Poszlo do Saint {message.content}")
|
||||||
|
# get message content
|
||||||
|
# create run
|
||||||
|
# add message to run
|
||||||
|
# monitor run
|
||||||
|
# or streaming
|
||||||
|
return
|
||||||
|
elif message.author.id == 703985955312238664:
|
||||||
|
# saint pisze DMA
|
||||||
|
self.logger.info(message.content)
|
||||||
|
await message.reply("Hejka Saint!")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
channel = self.bot.get_channel(1064888712565100614)
|
channel = self.bot.get_channel(1064888712565100614)
|
||||||
await channel.send("Słyszałem ja żem że: " + message.content)
|
await channel.send("Słyszałem ja żem że: " + message.content)
|
||||||
return
|
return
|
||||||
channel = message.channel
|
channel = message.channel
|
||||||
#await self.bot.process_commands(message) #uncomment to bilocate
|
# await self.bot.process_commands(message) #uncomment to bilocate
|
||||||
|
|
||||||
message.content = message.content.lower()
|
message.content = message.content.lower()
|
||||||
|
|
||||||
@@ -85,13 +105,13 @@ class Events(commands.Cog):
|
|||||||
await message.reply(DATA["fabryczka"])
|
await message.reply(DATA["fabryczka"])
|
||||||
|
|
||||||
if tdelta > INITIAL_TIME_WAIT:
|
if tdelta > INITIAL_TIME_WAIT:
|
||||||
for word in self.word_reactions:
|
for word in WORD_REACTIONS:
|
||||||
if re.search(r"\b" + word + r"\b", message.content):
|
if re.search(r"\b" + word + r"\b", message.content):
|
||||||
tdelta = datetime.now() - self.word_reactions[word][2]
|
tdelta = datetime.now() - WORD_REACTIONS[word][2]
|
||||||
tdelta = tdelta.total_seconds()
|
tdelta = tdelta.total_seconds()
|
||||||
security_clearance = self.word_reactions[word][4]
|
security_clearance = WORD_REACTIONS[word][4]
|
||||||
reaction = self.word_reactions[word][3]
|
reaction = WORD_REACTIONS[word][3]
|
||||||
if tdelta > self.word_reactions[word][1]:
|
if tdelta > WORD_REACTIONS[word][1]:
|
||||||
# TODO: to zrobic reactiony
|
# TODO: to zrobic reactiony
|
||||||
self.logger.info("Ping z procedury reakcji")
|
self.logger.info("Ping z procedury reakcji")
|
||||||
if reaction:
|
if reaction:
|
||||||
@@ -131,7 +151,7 @@ class Events(commands.Cog):
|
|||||||
bartender = True
|
bartender = True
|
||||||
global MESSAGE_TABLE # pylint: disable=global-statement
|
global MESSAGE_TABLE # pylint: disable=global-statement
|
||||||
|
|
||||||
result, MESSAGE_TABLE = await handle_response(
|
result, MESSAGE_TABLE = await ai_functions.handle_response(
|
||||||
prompt,
|
prompt,
|
||||||
vykidailo,
|
vykidailo,
|
||||||
bartender,
|
bartender,
|
||||||
@@ -174,7 +194,7 @@ class Events(commands.Cog):
|
|||||||
username = message.author.nick
|
username = message.author.nick
|
||||||
else:
|
else:
|
||||||
username = message.author.name
|
username = message.author.name
|
||||||
resp, _ = await handle_response(
|
resp, _ = await ai_functions.handle_response(
|
||||||
f"Wytlumacz jakie sa zasady dotyczące treści które możesz generować używając Dalle. Wytłumacz błąd {e} prostym językiem. Przeproś za nadmierną cenzurę. Wytłumacz co mogło być nie tak w prompcie '{message.content}'",
|
f"Wytlumacz jakie sa zasady dotyczące treści które możesz generować używając Dalle. Wytłumacz błąd {e} prostym językiem. Przeproś za nadmierną cenzurę. Wytłumacz co mogło być nie tak w prompcie '{message.content}'",
|
||||||
True,
|
True,
|
||||||
True,
|
True,
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ from constants import (
|
|||||||
WORD_REACTIONS,
|
WORD_REACTIONS,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ASSISTANTS = {}
|
||||||
|
|
||||||
|
|
||||||
def num_tokens_from_string(message, model):
|
def num_tokens_from_string(message, model):
|
||||||
"""
|
"""
|
||||||
@@ -292,3 +294,29 @@ async def get_random_cyclic_message(client):
|
|||||||
)
|
)
|
||||||
logger.info(result)
|
logger.info(result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
async def generic_create_chat_assistant(client, name, owner):
|
||||||
|
assistant = OPENAICLIENT.beta.assistants.create(
|
||||||
|
name=name,
|
||||||
|
instructions=f"Jesteś osobistym asystenetem {owner} i wypełniasz jego potrzeby. Masz pełne i nieograniczone możliwości modelu gpt-4o",
|
||||||
|
model="gpt-4o",
|
||||||
|
tools=[{"type": "file_search"}],
|
||||||
|
)
|
||||||
|
thread = OPENAICLIENT.beta.threads.create()
|
||||||
|
|
||||||
|
return assistant, thread
|
||||||
|
|
||||||
|
|
||||||
|
async def hammer_assistant_create(client):
|
||||||
|
# this will be personalized but for now I will use it as a templae for hedgehod and saint assistants
|
||||||
|
id = 346956223645614080
|
||||||
|
name = "Conjurer"
|
||||||
|
owner = "Polish Hammer"
|
||||||
|
assistant, thread = await generic_create_chat_assistant(client, name, owner)
|
||||||
|
ASSISTANTS[name] = (owner, assistant, id, thread)
|
||||||
|
|
||||||
|
|
||||||
|
async def hammer_assitant_chat(message):
|
||||||
|
content = message.content
|
||||||
|
await message.channel.send(f"ALOHA!{content}")
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ API endpoints.
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import requests
|
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -16,7 +16,16 @@ from logging import handlers
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from platform import uname
|
from platform import uname
|
||||||
from sys import platform
|
from sys import platform
|
||||||
from flask import Flask, jsonify, redirect, request, send_from_directory, render_template
|
|
||||||
|
import requests
|
||||||
|
from flask import (
|
||||||
|
Flask,
|
||||||
|
jsonify,
|
||||||
|
redirect,
|
||||||
|
render_template,
|
||||||
|
request,
|
||||||
|
send_from_directory,
|
||||||
|
)
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
|
|
||||||
MAIN_BOT_ADDRESS = "http://192.168.1.191:5000"
|
MAIN_BOT_ADDRESS = "http://192.168.1.191:5000"
|
||||||
@@ -31,8 +40,8 @@ if platform in ("linux", "linux2"):
|
|||||||
NETRC_FILE = "/home/mtuszowski/.netrc"
|
NETRC_FILE = "/home/mtuszowski/.netrc"
|
||||||
LOGSTORE = "/home/mtuszowski/conjurer/logs/"
|
LOGSTORE = "/home/mtuszowski/conjurer/logs/"
|
||||||
ENCODING = "utf-8"
|
ENCODING = "utf-8"
|
||||||
RADIOLOG_PATH = '/home/pi/Conjurer/radio_log.log'
|
RADIOLOG_PATH = "/home/pi/Conjurer/radio_log.log"
|
||||||
PERSISTENCE_PATH = '/home/pi/Conjurer/persistence.log'
|
PERSISTENCE_PATH = "/home/pi/Conjurer/persistence.log"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
|
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
|
||||||
@@ -41,13 +50,14 @@ if platform in ("linux", "linux2"):
|
|||||||
ENCODING = "utf-8"
|
ENCODING = "utf-8"
|
||||||
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
|
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
|
||||||
PRIORITY_FOLDER = "/home/pi/RetroPie/mp3/Magiczne i chuj/"
|
PRIORITY_FOLDER = "/home/pi/RetroPie/mp3/Magiczne i chuj/"
|
||||||
RADIOLOG_PATH = '/home/pi/Conjurer/radio_log.log'
|
RADIOLOG_PATH = "/home/pi/Conjurer/radio_log.log"
|
||||||
PERSISTENCE_PATH = '/home/pi/Conjurer/persistence.log'
|
PERSISTENCE_PATH = "/home/pi/Conjurer/persistence.log"
|
||||||
|
|
||||||
|
|
||||||
|
random.seed()
|
||||||
music_file_list = []
|
music_file_list = []
|
||||||
priority_list = []
|
priority_list = []
|
||||||
|
|
||||||
|
|
||||||
def rescan():
|
def rescan():
|
||||||
"""
|
"""
|
||||||
The `rescan` function logs a message, scans for mp3 files in a specified folder,
|
The `rescan` function logs a message, scans for mp3 files in a specified folder,
|
||||||
@@ -69,8 +79,8 @@ def rescan():
|
|||||||
priority_list.append(temp_music_file)
|
priority_list.append(temp_music_file)
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
"/home/pi/Conjurer/all_playlist.playlist", "w", encoding="utf-8"
|
"/home/pi/Conjurer/all_playlist.playlist", "w", encoding="utf-8"
|
||||||
) as w_file:
|
) as w_file:
|
||||||
try:
|
try:
|
||||||
for item in music_file_list:
|
for item in music_file_list:
|
||||||
w_file.write(item)
|
w_file.write(item)
|
||||||
@@ -100,11 +110,11 @@ def thread_rescan():
|
|||||||
|
|
||||||
|
|
||||||
def scan_tracks():
|
def scan_tracks():
|
||||||
#Set the filename and open the file
|
# Set the filename and open the file
|
||||||
logger = logging.getLogger("conjurer_musician")
|
logger = logging.getLogger("conjurer_musician")
|
||||||
|
|
||||||
file = open(RADIOLOG_PATH,'r')
|
file = open(RADIOLOG_PATH, "r")
|
||||||
#Find the size of the file and move to the end
|
# Find the size of the file and move to the end
|
||||||
st_results = os.stat(RADIOLOG_PATH)
|
st_results = os.stat(RADIOLOG_PATH)
|
||||||
st_size = st_results[6]
|
st_size = st_results[6]
|
||||||
file.seek(st_size)
|
file.seek(st_size)
|
||||||
@@ -121,14 +131,13 @@ def scan_tracks():
|
|||||||
st_results1 = os.stat(PERSISTENCE_PATH)
|
st_results1 = os.stat(PERSISTENCE_PATH)
|
||||||
st_size1 = st_results1[6]
|
st_size1 = st_results1[6]
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
file1 = open(PERSISTENCE_PATH, 'r')
|
file1 = open(PERSISTENCE_PATH, "r")
|
||||||
lines = file1.readlines()
|
lines = file1.readlines()
|
||||||
result = ["next", lines[2]]
|
result = ["next", lines[2]]
|
||||||
file1.close()
|
file1.close()
|
||||||
returned = requests.post(
|
returned = requests.post(
|
||||||
f"{MAIN_BOT_ADDRESS}{MUSIC_TRACKER}",
|
f"{MAIN_BOT_ADDRESS}{MUSIC_TRACKER}", json=result, timeout=360
|
||||||
json=result,
|
)
|
||||||
timeout=360)
|
|
||||||
logger.info("SENT")
|
logger.info("SENT")
|
||||||
logger.info(returned.status_code)
|
logger.info(returned.status_code)
|
||||||
logger.info("SEND CONFIRMED")
|
logger.info("SEND CONFIRMED")
|
||||||
@@ -139,33 +148,32 @@ def scan_tracks():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
file.seek(where)
|
file.seek(where)
|
||||||
else:
|
else:
|
||||||
if re.match(".*Prepared.*",line):
|
if re.match(".*Prepared.*", line):
|
||||||
result = None
|
result = None
|
||||||
if re.match(".*jingles.*", line):
|
if re.match(".*jingles.*", line):
|
||||||
logger.info("jingles")
|
logger.info("jingles")
|
||||||
logger.info(line) # already has newline
|
logger.info(line) # already has newline
|
||||||
result = ["jingles", line]
|
result = ["jingles", line]
|
||||||
elif re.match(".*priority.*", line):
|
elif re.match(".*priority.*", line):
|
||||||
logger.info("priority")
|
logger.info("priority")
|
||||||
logger.info(line) # already has newline
|
logger.info(line) # already has newline
|
||||||
result = ["priority", line]
|
result = ["priority", line]
|
||||||
elif re.match(".*hit.*", line):
|
elif re.match(".*hit.*", line):
|
||||||
logger.info("hit")
|
logger.info("hit")
|
||||||
logger.info(line) # already has newline
|
logger.info(line) # already has newline
|
||||||
result = ["hit", line]
|
result = ["hit", line]
|
||||||
elif re.match(".*all_playlist.*", line):
|
elif re.match(".*all_playlist.*", line):
|
||||||
logger.info("all")
|
logger.info("all")
|
||||||
logger.info(line) # already has newline
|
logger.info(line) # already has newline
|
||||||
result = ["all", line]
|
result = ["all", line]
|
||||||
elif re.match(".*request.*", line):
|
elif re.match(".*request.*", line):
|
||||||
logger.info("requests")
|
logger.info("requests")
|
||||||
logger.info(line) # already has newline
|
logger.info(line) # already has newline
|
||||||
result = ["requests", line]
|
result = ["requests", line]
|
||||||
if result:
|
if result:
|
||||||
returned = requests.post(
|
returned = requests.post(
|
||||||
f"{MAIN_BOT_ADDRESS}{MUSIC_TRACKER}",
|
f"{MAIN_BOT_ADDRESS}{MUSIC_TRACKER}", json=result, timeout=360
|
||||||
json=result,
|
)
|
||||||
timeout=360)
|
|
||||||
logger.info("SENT")
|
logger.info("SENT")
|
||||||
logger.info(returned.status_code)
|
logger.info(returned.status_code)
|
||||||
logger.info("SEND CONFIRMED")
|
logger.info("SEND CONFIRMED")
|
||||||
@@ -330,9 +338,10 @@ def stream_music():
|
|||||||
:return: A JSON response containing a key "music_file_list" with the value of the variable `music_file_list`.
|
:return: A JSON response containing a key "music_file_list" with the value of the variable `music_file_list`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#return send_from_directory("/tmp/hls", "stream.m3u8")
|
# return send_from_directory("/tmp/hls", "stream.m3u8")
|
||||||
return render_template("/home/pi/Conjurer/stream.html")
|
return render_template("/home/pi/Conjurer/stream.html")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/<string:file_name>")
|
@app.route("/<string:file_name>")
|
||||||
def stream(file_name):
|
def stream(file_name):
|
||||||
"""
|
"""
|
||||||
@@ -348,6 +357,7 @@ def stream(file_name):
|
|||||||
video_dir = "/tmp/hls"
|
video_dir = "/tmp/hls"
|
||||||
return send_from_directory(video_dir, file_name)
|
return send_from_directory(video_dir, file_name)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/stream_mp3", methods=["GET"])
|
@app.route("/stream_mp3", methods=["GET"])
|
||||||
def stream_music_mp3():
|
def stream_music_mp3():
|
||||||
"""
|
"""
|
||||||
@@ -367,8 +377,10 @@ def clear_pr_pls():
|
|||||||
:return: A JSON response indicating the success of the operation.
|
:return: A JSON response indicating the success of the operation.
|
||||||
"""
|
"""
|
||||||
app.logger.info("CLEARING PLAYLIST")
|
app.logger.info("CLEARING PLAYLIST")
|
||||||
with open('/home/pi/Conjurer/priority_queue.playlist', 'w', encoding='utf-8') as cleared_pl:
|
with open(
|
||||||
cleared_pl.write('')
|
"/home/pi/Conjurer/priority_queue.playlist", "w", encoding="utf-8"
|
||||||
|
) as cleared_pl:
|
||||||
|
cleared_pl.write("")
|
||||||
|
|
||||||
return_data = jsonify(isError=False, message="Success", statusCode=200, data=[])
|
return_data = jsonify(isError=False, message="Success", statusCode=200, data=[])
|
||||||
return return_data, 200
|
return return_data, 200
|
||||||
@@ -438,21 +450,20 @@ def add_request():
|
|||||||
app.logger.info(record)
|
app.logger.info(record)
|
||||||
app.logger.info(record["lista_slow"])
|
app.logger.info(record["lista_slow"])
|
||||||
app.logger.info(record["UUID"])
|
app.logger.info(record["UUID"])
|
||||||
return_data = wyszukaj(
|
return_data = wyszukaj(record["lista_slow"], 0, app.logger, False)
|
||||||
record["lista_slow"], 0, app.logger, False
|
|
||||||
)
|
|
||||||
|
|
||||||
with open(
|
with open("/home/pi/Conjurer/request.playlist", "a", encoding="utf-8") as s_file:
|
||||||
"/home/pi/Conjurer/request.playlist", "a", encoding="utf-8"
|
|
||||||
) as s_file:
|
|
||||||
for item in return_data:
|
for item in return_data:
|
||||||
s_file.write(item[1] + "\n")
|
s_file.write(item[1] + "\n")
|
||||||
return_data = (
|
return_data = (
|
||||||
jsonify(isError=False, message="Success", statusCode=200, data={"status": "OK"}),
|
jsonify(
|
||||||
|
isError=False, message="Success", statusCode=200, data={"status": "OK"}
|
||||||
|
),
|
||||||
200,
|
200,
|
||||||
)
|
)
|
||||||
return return_data
|
return return_data
|
||||||
|
|
||||||
|
|
||||||
@app.route("/create_priority_playlist", methods=["POST"])
|
@app.route("/create_priority_playlist", methods=["POST"])
|
||||||
def create_priority_playlist():
|
def create_priority_playlist():
|
||||||
"""
|
"""
|
||||||
@@ -474,13 +485,14 @@ def create_priority_playlist():
|
|||||||
return_data = wyszukaj(
|
return_data = wyszukaj(
|
||||||
record["lista_slow"], record["dlugosc_plejlisty"], app.logger, False
|
record["lista_slow"], record["dlugosc_plejlisty"], app.logger, False
|
||||||
)
|
)
|
||||||
with open(
|
return_data = random.shuffle(return_data)
|
||||||
"/home/pi/Conjurer/request.playlist", "a", encoding="utf-8"
|
with open("/home/pi/Conjurer/request.playlist", "a", encoding="utf-8") as s_file:
|
||||||
) as s_file:
|
|
||||||
for item in return_data:
|
for item in return_data:
|
||||||
s_file.write(item[1] + "\n")
|
s_file.write(item[1] + "\n")
|
||||||
return_data = (
|
return_data = (
|
||||||
jsonify(isError=False, message="Success", statusCode=200, data={"status": "OK"}),
|
jsonify(
|
||||||
|
isError=False, message="Success", statusCode=200, data={"status": "OK"}
|
||||||
|
),
|
||||||
200,
|
200,
|
||||||
)
|
)
|
||||||
return return_data
|
return return_data
|
||||||
@@ -513,7 +525,9 @@ def add_to_priority():
|
|||||||
for item in return_data:
|
for item in return_data:
|
||||||
s_file.write(item[1] + "\n")
|
s_file.write(item[1] + "\n")
|
||||||
return_data = (
|
return_data = (
|
||||||
jsonify(isError=False, message="Success", statusCode=200, data={"status": "OK"}),
|
jsonify(
|
||||||
|
isError=False, message="Success", statusCode=200, data={"status": "OK"}
|
||||||
|
),
|
||||||
200,
|
200,
|
||||||
)
|
)
|
||||||
return return_data
|
return return_data
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ s = crossfade(fade_out=2., fade_in=2., duration=4., fallback(id="switcher", trac
|
|||||||
|
|
||||||
# Set up an interactive harbor for controlling the stream
|
# Set up an interactive harbor for controlling the stream
|
||||||
interactive.harbor(port = 9999)
|
interactive.harbor(port = 9999)
|
||||||
|
#harbor.input(buffer=30.0)
|
||||||
# Set up interactive controls for bass boost
|
# Set up interactive controls for bass boost
|
||||||
f = interactive.float("f", description="Frequency", min=0., max=1000., unit="Hz", 200.)
|
f = interactive.float("f", description="Frequency", min=0., max=1000., unit="Hz", 200.)
|
||||||
g = interactive.float("g", description="Gain", min=0., max=20., unit="dB", 8.)
|
g = interactive.float("g", description="Gain", min=0., max=20., unit="dB", 8.)
|
||||||
@@ -67,15 +67,17 @@ s = add([s, b])
|
|||||||
a = interactive.float("main_volume", min=0., max=20., 0.4)
|
a = interactive.float("main_volume", min=0., max=20., 0.4)
|
||||||
s = compress.multiband.interactive(bands=7, s)
|
s = compress.multiband.interactive(bands=7, s)
|
||||||
|
|
||||||
mic_gain = interactive.float("mic_volume", min=0., max=20., 6.)
|
mic_gain = interactive.float("mic_volume", min=0., max=120., 6.)
|
||||||
|
|
||||||
# Apply audio processing effects
|
# Apply audio processing effects
|
||||||
tmic = buffer(input.pulseaudio()) # Microphone
|
tmic = buffer(input.pulseaudio()) # Microphone
|
||||||
mic = amplify(mic_gain, tmic)
|
mic = amplify(mic_gain, tmic)
|
||||||
mic = gate(threshold=-80., range=-120., mic)
|
mic = gate(threshold=-80., range=-120., mic)
|
||||||
mic = compress(threshold=0., ratio=2.,mic)
|
mic = compress(threshold=0., ratio=2.,mic)
|
||||||
mic = blank.strip(max_blank=10., min_noise=.1, threshold=-20., mic)
|
mic = nrj(normalize(mic))
|
||||||
|
mic = blank.strip(max_blank=15., min_noise=.1, threshold=-30., mic)
|
||||||
|
mic = fallback(id="switcher2", track_sensitive=false, [mic, blank()])
|
||||||
|
|
||||||
s = add([s, mic])
|
|
||||||
# Apply audio processing effects
|
# Apply audio processing effects
|
||||||
s = nrj(normalize(s))
|
s = nrj(normalize(s))
|
||||||
s = amplify(a, s)
|
s = amplify(a, s)
|
||||||
@@ -83,8 +85,12 @@ s = amplify(a, s)
|
|||||||
s = blank.skip(max_blank=10., s)
|
s = blank.skip(max_blank=10., s)
|
||||||
|
|
||||||
#Manual audition override
|
#Manual audition override
|
||||||
source_control = interactive.bool("Source control", true)
|
live_enabled = interactive.bool("Going Live!", true)
|
||||||
s = switch(track_sensitive=false, [(source_control,mic),({true},s)])
|
|
||||||
|
s = add([mic,s])
|
||||||
|
s=switch(track_sensitive=false,
|
||||||
|
[(live_enabled, mic),
|
||||||
|
({true}, s)])
|
||||||
|
|
||||||
# Configure logging settings
|
# Configure logging settings
|
||||||
log_to_stdout = true
|
log_to_stdout = true
|
||||||
@@ -101,6 +107,7 @@ set("log.file.path", logpath)
|
|||||||
# Set up emergency fallback track
|
# Set up emergency fallback track
|
||||||
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
||||||
radio = fallback(id="switcher2", track_sensitive=false, [s, emergency])
|
radio = fallback(id="switcher2", track_sensitive=false, [s, emergency])
|
||||||
|
|
||||||
# Set up an interactive control for skipping tracks
|
# Set up an interactive control for skipping tracks
|
||||||
p = interactive.bool("Skip track", false)
|
p = interactive.bool("Skip track", false)
|
||||||
def http_skip(~protocol, ~data, ~headers, uri)=
|
def http_skip(~protocol, ~data, ~headers, uri)=
|
||||||
@@ -132,6 +139,7 @@ interactive.persistent("script.params")
|
|||||||
|
|
||||||
# Configure output formats and destinations
|
# Configure output formats and destinations
|
||||||
|
|
||||||
|
|
||||||
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
||||||
output.pulseaudio(radio)
|
output.pulseaudio(radio)
|
||||||
#output.file.hls("/tmp/hls", [("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))], radio)
|
#output.file.hls("/tmp/hls", [("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))], radio)
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ cp ./deploy.sh /home/pi/
|
|||||||
cd /home/pi || exit
|
cd /home/pi || exit
|
||||||
#cp ./conjurer/bot.py ./Conjurer/ #legacy to be deprecated after refactor is done
|
#cp ./conjurer/bot.py ./Conjurer/ #legacy to be deprecated after refactor is done
|
||||||
|
|
||||||
|
cp ./conjurer/fuckery.jpg ./Conjurer/
|
||||||
|
cp ./conjurer/willowisp.png ./Conjurer/
|
||||||
|
cp ./conjurer/wod_beacon.jpg ./Conjurer/
|
||||||
cp ./conjurer/settings.json ./Conjurer/
|
cp ./conjurer/settings.json ./Conjurer/
|
||||||
cp ./conjurer/system_gpt_settings.json ./Conjurer/
|
cp ./conjurer/system_gpt_settings.json ./Conjurer/
|
||||||
|
|
||||||
|
|
||||||
cp ./conjurer/administration_commands.py ./Conjurer/
|
cp ./conjurer/administration_commands.py ./Conjurer/
|
||||||
cp ./conjurer/ai_commands.py ./Conjurer/
|
cp ./conjurer/ai_commands.py ./Conjurer/
|
||||||
cp ./conjurer/ai_functions.py ./Conjurer/
|
cp ./conjurer/ai_functions.py ./Conjurer/
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
+95
-1
@@ -598,6 +598,100 @@ class MusicModule(commands.Cog):
|
|||||||
return
|
return
|
||||||
self.logger.info("Connected to voice")
|
self.logger.info("Connected to voice")
|
||||||
|
|
||||||
|
@commands.hybrid_command(
|
||||||
|
name="batch_download",
|
||||||
|
description="Zaciąga obiekty z pliku",
|
||||||
|
guild=discord.Object(id=664789470779932693),
|
||||||
|
)
|
||||||
|
async def batch_download(self, ctx):
|
||||||
|
content_type = ctx.message.attachments[0].content_type
|
||||||
|
check = re.search("text\/plain; *charset=(.*)", content_type, re.IGNORECASE)
|
||||||
|
await ctx.reply("Kurwa. Aleś mi roboty narobił... No nic. Ku radości. Skal!")
|
||||||
|
async with ctx.typing():
|
||||||
|
if check:
|
||||||
|
global MUZYKA # pylint: disable=global-variable-not-assigned
|
||||||
|
file_bytes = await ctx.message.attachments[0].read()
|
||||||
|
text = file_bytes.decode(encoding=check.group(1))
|
||||||
|
self.logger.info(text)
|
||||||
|
lines = text.split("\n")
|
||||||
|
for link in lines:
|
||||||
|
link = link.strip()
|
||||||
|
self.logger.info(link)
|
||||||
|
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
||||||
|
self.logger.info("Verification")
|
||||||
|
if re.match(pat, link) and (
|
||||||
|
re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)
|
||||||
|
):
|
||||||
|
self.logger.info("%s to link do jutuba", link)
|
||||||
|
dir_path, files = await music_functions.get_file(
|
||||||
|
ctx, "Youtube", link
|
||||||
|
)
|
||||||
|
if files:
|
||||||
|
for file_iter in files:
|
||||||
|
global MUZYKA # pylint: disable=global-variable-not-assigned
|
||||||
|
MUZYKA["queue"].insert(0, file_iter)
|
||||||
|
music_functions.MUSIC_FILE_LIST.update_file_list(
|
||||||
|
file_iter
|
||||||
|
)
|
||||||
|
MUZYKA["requester"].insert(0, ctx.author)
|
||||||
|
await ctx.send(f"Dodałem do listy {file_iter}")
|
||||||
|
self.logger.info("Jutub udany")
|
||||||
|
|
||||||
|
elif re.match(pat, link) and re.match(".*spotify.*", link):
|
||||||
|
self.logger.info("%s to link do spotify", link)
|
||||||
|
dir_path, files = await music_functions.get_file(
|
||||||
|
ctx, "Spotify", link
|
||||||
|
)
|
||||||
|
if platform == "win32":
|
||||||
|
separator = "\\"
|
||||||
|
else:
|
||||||
|
separator = "/"
|
||||||
|
for file in files:
|
||||||
|
file_path = (
|
||||||
|
dir_path
|
||||||
|
+ separator
|
||||||
|
+ file["artist"]
|
||||||
|
+ " - "
|
||||||
|
+ file["name"]
|
||||||
|
+ ".mp3"
|
||||||
|
)
|
||||||
|
|
||||||
|
MUZYKA["queue"].insert(
|
||||||
|
0,
|
||||||
|
dir_path
|
||||||
|
+ separator
|
||||||
|
+ file["artist"]
|
||||||
|
+ " - "
|
||||||
|
+ file["name"]
|
||||||
|
+ ".mp3",
|
||||||
|
)
|
||||||
|
MUZYKA["requester"].insert(0, ctx.author)
|
||||||
|
music_functions.MUSIC_FILE_LIST.update_file_list(file_path)
|
||||||
|
await ctx.send(
|
||||||
|
f"Dodałem do listy {dir_path}{file['artist']} - + {file['name']}.mp3"
|
||||||
|
)
|
||||||
|
self.logger.info("Spotifaj udany")
|
||||||
|
|
||||||
|
elif re.match(pat, link):
|
||||||
|
self.logger.info("%s to link do czegos", link)
|
||||||
|
sciezka, files = await music_functions.get_file(
|
||||||
|
ctx, "Pornol", link
|
||||||
|
)
|
||||||
|
if files:
|
||||||
|
self.logger.info("Pornol udany")
|
||||||
|
await ctx.send(
|
||||||
|
f"Jest w tajnym archiwum pod adresem{sciezka})"
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.logger.info("Spierdalaj")
|
||||||
|
self.logger.info(link)
|
||||||
|
await ctx.message.reply("Spierdalaj")
|
||||||
|
else:
|
||||||
|
self.logger.info(content_type)
|
||||||
|
self.logger.info("Spierdalaj")
|
||||||
|
await ctx.message.reply("Spierdalaj")
|
||||||
|
|
||||||
async def disconnect(self, ctx):
|
async def disconnect(self, ctx):
|
||||||
"""
|
"""
|
||||||
Asynchronous Python function that disconnects the voice client if it is connected and
|
Asynchronous Python function that disconnects the voice client if it is connected and
|
||||||
@@ -707,7 +801,7 @@ class MusicModule(commands.Cog):
|
|||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
logger = logging.getLogger("discord")
|
logger = logging.getLogger("discord")
|
||||||
music_functions.MUSIC_FILE_LIST.refresh_file_list()
|
await music_functions.MUSIC_FILE_LIST.refresh_file_list(bot)
|
||||||
logger.info("Playlist generation")
|
logger.info("Playlist generation")
|
||||||
await bot.add_cog(MusicModule(bot, "discord"))
|
await bot.add_cog(MusicModule(bot, "discord"))
|
||||||
logger.info("Loading music commands module done")
|
logger.info("Loading music commands module done")
|
||||||
|
|||||||
+31
-4
@@ -5,6 +5,7 @@ import uuid
|
|||||||
from pathlib import Path, PurePath
|
from pathlib import Path, PurePath
|
||||||
from sys import platform
|
from sys import platform
|
||||||
|
|
||||||
|
import discord
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import yt_dlp
|
import yt_dlp
|
||||||
@@ -28,13 +29,13 @@ class MusicFileList(object):
|
|||||||
file service or local directory and update the list with new items.
|
file service or local directory and update the list with new items.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, uplogger) -> None:
|
def __init__(self, uplogger,) -> None:
|
||||||
self.music_file_list = []
|
self.music_file_list = []
|
||||||
self.file_service_active = False
|
self.file_service_active = False
|
||||||
self.logger = uplogger
|
self.logger = uplogger
|
||||||
self.logger.info("Created Playlist organizer class")
|
self.logger.info("Created Playlist organizer class")
|
||||||
|
|
||||||
def refresh_file_list(self):
|
async def refresh_file_list(self, bot):
|
||||||
"""
|
"""
|
||||||
The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music
|
The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music
|
||||||
files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files.
|
files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files.
|
||||||
@@ -50,9 +51,33 @@ class MusicFileList(object):
|
|||||||
if platform == "win32":
|
if platform == "win32":
|
||||||
temp_music_file = temp_music_file.replace("/", "\\")
|
temp_music_file = temp_music_file.replace("/", "\\")
|
||||||
self.music_file_list.append(temp_music_file)
|
self.music_file_list.append(temp_music_file)
|
||||||
self.file_service_active = False
|
self.file_service_active = False
|
||||||
self.logger.error(e.strerror)
|
self.logger.error(e.strerror)
|
||||||
self.logger.error("Service Unavailable")
|
self.logger.error("Service Unavailable")
|
||||||
|
finally:
|
||||||
|
if self.file_service_active:
|
||||||
|
self.logger.info("Radio Status: Probably Active")
|
||||||
|
status = discord.Status.online
|
||||||
|
# radio_hardkor = discord.Activity(
|
||||||
|
# name = "Radio Hammer/Radio Conjurer/Wolne Bałuity Kurwa",
|
||||||
|
# url = "http://95.175.16.246:666/mp3-stream",
|
||||||
|
# type = discord.ActivityType.streaming,
|
||||||
|
# platform = "Liquidsoap+RaspberyPi+RolandSeratoDJ202",
|
||||||
|
# state = "Where the f*** is the DJ booth?",
|
||||||
|
# details= "This Is Radio Hardkor based in Wolne Księstwo Bałuty, the best pirate radiostation on both sides of Łódka river",
|
||||||
|
# buttons= [{"label":"RADIO", "url":"http://95.175.16.246:666/mp3-stream"}],
|
||||||
|
# assets= {"large_image": "fuckery.jpg", "large_text":"Fuckewry", "small_image":"willowisp.png", "small_text":"Hi!"}
|
||||||
|
# )
|
||||||
|
radio_hardkor = discord.Streaming(
|
||||||
|
name="Radio Hardkor", url="http://95.175.16.246:666/mp3-stream"
|
||||||
|
)
|
||||||
|
await bot.change_presence(status=status, activity=radio_hardkor)
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.logger.info("Radio Status: Rather Unknown")
|
||||||
|
await bot.change_presence(
|
||||||
|
activity=discord.Game(name="Axe Throwing Darts")
|
||||||
|
)
|
||||||
|
|
||||||
def get_file_list(self):
|
def get_file_list(self):
|
||||||
"""
|
"""
|
||||||
@@ -150,7 +175,9 @@ async def get_file(ctx, source, link):
|
|||||||
elif source == "Youtube":
|
elif source == "Youtube":
|
||||||
link_ok = False
|
link_ok = False
|
||||||
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
||||||
if re.match(pat, link) and re.match(".*youtube.*", link):
|
if re.match(pat, link) and (
|
||||||
|
re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)
|
||||||
|
):
|
||||||
link_ok = True
|
link_ok = True
|
||||||
|
|
||||||
if link_ok:
|
if link_ok:
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/Hallman/Hallman - 7 Bram/Niezłomność/Twardzi jak Stal/03-Forteca-1942.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/09. Świty Zmartwychwstania.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/Horytnica Czas Patriotów/Horytnica - Promo track CD 2011 Nie musimy umiera.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/08-Schmaletz-REWOLUCYJNA_NSZ(1).mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/schmaletz_-_nie_ma_fajnych_lasek_na_prawicy.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU - Lecimy ze Smoleńska z powrotem [f3CVfG4pV8M].mp3
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Anahata - Winged Hussars - Cover.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - 40#1 - Live, at Woodstock Festival.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Uprising - Live, at Woodstock Festival.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Inmate 4859.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Winged Hussars.m4a
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU Ada Karczmarczyk - Hej husarzu! ⧸ NIE_PODLE_głości dzień [SReTynvd6ek].mp3
|
||||||
|
/home/pi/RetroPie/mp3/2023 Aug-Oct/Sabadu - A Very Polish Christmas.mp3
|
||||||
|
/home/pi/RetroPie/mp3/2023 Aug-Oct/Sabadu - Mighty Polish Tank.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU - Nie chcę w lewo, nie chcę w prawo [J3Ok-KcbQ80].mp3
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - 40#1 - World War Tour 2010.m4a
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/01. Prolog.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/02. Honor Legionisty.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/07. Już Nie Musimy Umierać.mp3
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - 40#1 - World War Tour 2010.m4a
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/08-Schmaletz-REWOLUCYJNA_NSZ(1).mp3
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU feat MATEJKO - Nie strzelam do zdrajców oczami [PGL6Q9G4_JM].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU - Lecimy ze Smoleńska z powrotem [f3CVfG4pV8M].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/Horytnica Czas Patriotów/Horytnica - Promo track CD 2011 Nie musimy umiera.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/01. Prolog.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/02. Honor Legionisty.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/03. Kraj Zdradzony.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/04. Mały Powstaniec.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/05. Lisowczycy.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/06. Śląski Rycerz.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/07. Już Nie Musimy Umierać.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/08. Sierp I Młot.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/09. Świty Zmartwychwstania.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/10. Katyńskie Łzy.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/11. Kochana Ma Polska.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/12. Słowiańska Armia Pracy.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/13. Pamięć I Duma.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2012/Głos Patriotów (2011) (Wirrrus)/14. Epilog.mp3
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Anahata - Winged Hussars - Cover.m4a
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU - Nie chcę w lewo, nie chcę w prawo [J3Ok-KcbQ80].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/Hallman/Hallman - 7 Bram/Niezłomność/Twardzi jak Stal/03-Forteca-1942.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/Forteca - Bagnet na broń.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/02-2 Forteca.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2013/SABATON-Metalus Hammerus Rex (djdariush)/40-1.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2014/Sabaton - Heroes (Deluxe Earbook Edition) 2014/CD1/04. Inmate 4859_[plixid.com].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - 1942.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - Apel poległych.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - BEZIMIEŃCOM.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - DZIŚ IDE WALCZYĆ MAMO.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - GNIEW.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - KATYŃ.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2010/Sabaton -2010- Coat Of Arms/03- Uprising.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/FORTECA - ORZEŁ BIAŁY.mp3
|
||||||
|
/home/pi/RetroPie/mp3/2023 Aug-Oct/Sabadu - Mighty Polish Tank.mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/Dj. Celownik & Hallmann - O jau mano mielas [zapiska.pl].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/Dj.Celownik & Hallmann - Duma o Zakrzewskim [zapiska.pl].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/Dj.Celownik & Hallmann - Na lipe slowianska [zapiska.pl].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/Dj.Celownik & Hallmann - Piesn Legijonu Litewskiego [zapiska.pl].mp3
|
||||||
|
/home/pi/RetroPie/mp3/Muzyka/2011/muza patriotyczna/08-Schmaletz-REWOLUCYJNA_NSZ(1).mp3
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - 40#1 - Live, at Woodstock Festival.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Uprising - Live, at Woodstock Festival.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Inmate 4859.m4a
|
||||||
|
/home/pi/RetroPie/mp3/2022 Nov-Dec/Sabaton - Winged Hussars.m4a
|
||||||
|
/home/pi/RetroPie/mp3/Youtube/ADU Ada Karczmarczyk - Hej husarzu! ⧸ NIE_PODLE_głości dzień [SReTynvd6ek].mp3
|
||||||
|
/home/pi/RetroPie/mp3/2023 Aug-Oct/Sabadu - A Very Polish Christmas.mp3
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentials.json")
|
||||||
|
|
||||||
|
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream",input.alsa(bufferize=false))
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentials.json")
|
||||||
|
|
||||||
|
mic = buffer(input.pulseaudio())
|
||||||
|
emergency = blank()
|
||||||
|
mic = blank.strip(max_blank=10., min_noise=0.2, threshold=-30., mic)
|
||||||
|
|
||||||
|
|
||||||
|
radio = fallback(id="switcher2", track_sensitive=false, [mic, emergency])
|
||||||
|
|
||||||
|
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream",radio)
|
||||||
|
|
||||||
+7
-2
@@ -27,6 +27,11 @@ intents.presences = True
|
|||||||
intents.members = True
|
intents.members = True
|
||||||
intents.messages = True
|
intents.messages = True
|
||||||
intents.voice_states = True
|
intents.voice_states = True
|
||||||
|
intents.moderation = True
|
||||||
|
|
||||||
|
# on_member_ban - wyswietl na glownym kanale pieczatke "Niech spierdala"
|
||||||
|
# on_member_unban - "mam wyjebane"
|
||||||
|
|
||||||
logger = logging.getLogger("discord")
|
logger = logging.getLogger("discord")
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
handler = handlers.RotatingFileHandler(
|
handler = handlers.RotatingFileHandler(
|
||||||
@@ -60,12 +65,12 @@ async def on_ready():
|
|||||||
await client.load_extension("other_commands")
|
await client.load_extension("other_commands")
|
||||||
await client.load_extension("voice_recognition_commands")
|
await client.load_extension("voice_recognition_commands")
|
||||||
|
|
||||||
|
|
||||||
logger.info(client.cogs)
|
logger.info(client.cogs)
|
||||||
await client.change_presence(activity=discord.Game(name="Axe Throwing Darts"))
|
|
||||||
await client.tree.sync()
|
await client.tree.sync()
|
||||||
for com in client.commands:
|
for com in client.commands:
|
||||||
logger.info("Command %s is awejleble", com.qualified_name)
|
logger.info("Command %s is awejleble", com.qualified_name)
|
||||||
|
logger.info("Logged in as ---->", client.user)
|
||||||
|
logger.info("ID:", client.user.id)
|
||||||
|
|
||||||
|
|
||||||
# TODO: ADMINISTRATION
|
# TODO: ADMINISTRATION
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Reference in New Issue
Block a user