Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9408137

Browse files
Wishing Bot 😎
1 parent fd21822 commit 9408137

File tree

9 files changed

+109
-0
lines changed

9 files changed

+109
-0
lines changed

‎Wishing Bot/Demo Video.mp4

4.37 MB
Binary file not shown.

‎Wishing Bot/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Wishing Bot
2+
3+
_______________________________________________________________________
4+
5+
## What is it
6+
7+
- This program can greetings to the people in the coding style.
8+
- Generated different emojis will give a very attractive and shiny look.
9+
- Playing song in the background will impress more and more.
10+
- You can as many songs in the directory **music** will automatically fetch by the program.
11+
- After fetching program will give you a suggesion of playing songs.
12+
- Add more and more songs to expand this **Wishing bot model**
13+
14+
<br>
15+
16+
## TechStack
17+
18+
1. Module Used:
19+
20+
- time
21+
- random
22+
- pygame
23+
- threading
24+
- sys
25+
- os
26+
27+
First install these libraries and use python 3 to enjoy this **Wishing bot model**
28+
29+
<br>
30+
31+
## Demo Video
32+
33+
https://github.com/avinashkranjan/Amazing-Python-Scripts/assets/114330097/c0ccf866-c8f2-4850-9519-9e7d1ea1bbf3
34+
35+
<br>
36+
37+
## Author
38+
39+
[Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
40+

‎Wishing Bot/WishingBot.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import time
2+
from random import randint
3+
import pygame
4+
import threading
5+
import sys
6+
import os
7+
8+
pygame.init()
9+
emojis = ['😃', '🐻‍❄️', '🐏', '🌲', '🎆', '❤️', '⛄', '🎮', '🔊', '⚙️', '😍', '😴', '🤑', '💀', '👻', '👽', '🐭', '🐸', '🐢', '🐬', '🧟', '🥷', '🎈', '🎉', '😷', '🕸️', '🎯', '🔒', '🔑', '🧲', '☎️', '🏧', '⏰', '🧭', '🏚️', '☢️', '📵', '🚓']
10+
11+
# Fetching songs from the given directory
12+
musicDir = './Wishing Bot/musics'
13+
songs = os.listdir(musicDir)
14+
15+
def wishingBot():
16+
for i in range(len(songs)):
17+
print(f"[{i}] - {songs[i][:-4]}")
18+
id = int(input("\nEnter your occasion number - "))
19+
20+
# emojis printing function
21+
def playEmojis():
22+
for i in range(1, 85):
23+
print('')
24+
space = ''
25+
26+
l = len(emojis)
27+
28+
i = 0
29+
while pygame.mixer.music.get_busy():
30+
count = randint(1, 100)
31+
while count > 0:
32+
space += ' '
33+
count -= 1
34+
35+
if i % 10 == 0:
36+
print(space + songs[id][:-4] + emojis[0])
37+
else:
38+
print(space + emojis[i % l])
39+
40+
space = ''
41+
i = i+1
42+
time.sleep(0.2)
43+
44+
def playSong():
45+
pygame.mixer.music.load(os.path.join(musicDir, songs[id]))
46+
pygame.mixer.music.play()
47+
48+
# Wait for the song to finish playing
49+
while pygame.mixer.music.get_busy():
50+
time.sleep(1)
51+
52+
# Song has finished playing, stop the printing function
53+
thread1.join()
54+
55+
thread1 = threading.Thread(target=playEmojis)
56+
thread2 = threading.Thread(target=playSong)
57+
58+
# Start threads
59+
thread1.start()
60+
thread2.start()
61+
62+
# Wait for the song to finish playing
63+
thread2.join()
64+
65+
# Exit the program
66+
sys.exit()
67+
68+
# Start the bot
69+
wishingBot()

‎Wishing Bot/musics/Children Day.mp3

2.33 MB
Binary file not shown.

‎Wishing Bot/musics/Happy New Year.mp3

225 KB
Binary file not shown.
4.65 MB
Binary file not shown.
6.6 MB
Binary file not shown.
3.44 MB
Binary file not shown.

‎Wishing Bot/musics/Jai Ho Bhole.mp3

3.57 MB
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /