Mods
This commit is contained in:
2196
data/aves.txt
Normal file
2196
data/aves.txt
Normal file
File diff suppressed because it is too large
Load Diff
19
main.py
19
main.py
@@ -99,7 +99,7 @@ async def on_message(ws, message):
|
|||||||
|
|
||||||
elif cmd == "help":
|
elif cmd == "help":
|
||||||
update_time()
|
update_time()
|
||||||
await send_message(ws, f"Commands: describe | wins | numbers | date", room_id)
|
await send_message(ws, f"Commands: describe | wins | numbers | date | bird", room_id)
|
||||||
|
|
||||||
elif cmd == "describe":
|
elif cmd == "describe":
|
||||||
if len(args) >= 1:
|
if len(args) >= 1:
|
||||||
@@ -119,6 +119,10 @@ async def on_message(ws, message):
|
|||||||
update_time()
|
update_time()
|
||||||
await gif_date(None, room_id)
|
await gif_date(None, room_id)
|
||||||
|
|
||||||
|
elif cmd == "bird" or cmd == "birds" or cmd == "birb" or cmd == "birbs" or cmd == "brb":
|
||||||
|
update_time()
|
||||||
|
await gif_bird(None, room_id)
|
||||||
|
|
||||||
def get_input_path(name):
|
def get_input_path(name):
|
||||||
return str(Path(HERE, name))
|
return str(Path(HERE, name))
|
||||||
|
|
||||||
@@ -174,6 +178,19 @@ async def gif_date(who, room_id):
|
|||||||
|
|
||||||
await run_gifmaker(command, room_id)
|
await run_gifmaker(command, room_id)
|
||||||
|
|
||||||
|
async def gif_bird(who, room_id):
|
||||||
|
input_path = get_input_path("bird.png")
|
||||||
|
|
||||||
|
command = [
|
||||||
|
gifmaker,
|
||||||
|
gm_common,
|
||||||
|
f"--input '{input_path}'",
|
||||||
|
"--words '[randomx]' --randomfile data/aves.txt --bgcolor 0,0,0",
|
||||||
|
"--filter anyhue2 --frames 3 --fontsize 42 --fillwords",
|
||||||
|
]
|
||||||
|
|
||||||
|
await run_gifmaker(command, room_id)
|
||||||
|
|
||||||
async def run_gifmaker(command, room_id):
|
async def run_gifmaker(command, room_id):
|
||||||
process = await asyncio.create_subprocess_shell(
|
process = await asyncio.create_subprocess_shell(
|
||||||
" ".join(command),
|
" ".join(command),
|
||||||
|
Reference in New Issue
Block a user