Spaces:
Running
Running
UPDATE
Browse files
app.py
CHANGED
@@ -3,6 +3,13 @@ import secrets
|
|
3 |
import gradio as gr
|
4 |
from AudioFusion import Fusion
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def process_audio(input_file,
|
7 |
effect_8d, pan_boundary, jump_percentage, time_l_to_r, volume_multiplier,
|
8 |
effect_slowed, speed_multiplier,
|
@@ -125,4 +132,22 @@ with gr.Blocks(title="Audio Fusion") as iface:
|
|
125 |
btnClear.add(components=output)
|
126 |
btnRun.click(fn=process_audio, inputs=inputs, outputs=output, api_name="AudioFusion")
|
127 |
|
128 |
-
iface.launch(share=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import gradio as gr
|
4 |
from AudioFusion import Fusion
|
5 |
|
6 |
+
from telethon.sync import TelegramClient, events
|
7 |
+
from decouple import config
|
8 |
+
|
9 |
+
API_ID = config("API_ID")
|
10 |
+
API_HASH = config("API_HASH")
|
11 |
+
BOT_TOKEN = config("BOT_TOKEN")
|
12 |
+
|
13 |
def process_audio(input_file,
|
14 |
effect_8d, pan_boundary, jump_percentage, time_l_to_r, volume_multiplier,
|
15 |
effect_slowed, speed_multiplier,
|
|
|
132 |
btnClear.add(components=output)
|
133 |
btnRun.click(fn=process_audio, inputs=inputs, outputs=output, api_name="AudioFusion")
|
134 |
|
135 |
+
iface.launch(share=False)
|
136 |
+
|
137 |
+
|
138 |
+
client = TelegramClient('session_name', API_ID, API_HASH)
|
139 |
+
|
140 |
+
@client.on(events.NewMessage(pattern='/start'))
|
141 |
+
async def start_handler(event):
|
142 |
+
await event.respond("Welcome to the bot!")
|
143 |
+
|
144 |
+
@client.on(events.NewMessage(pattern='/broadcast'))
|
145 |
+
async def broadcast_handler(event):
|
146 |
+
message_to_broadcast = "This is a broadcast message!"
|
147 |
+
await event.respond(message_to_broadcast)
|
148 |
+
|
149 |
+
|
150 |
+
if __name__ == '__main__':
|
151 |
+
client.start(bot_token=BOT_TOKEN)
|
152 |
+
print("Bot started succefully!")
|
153 |
+
client.run_until_disconnected()
|