-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
116 lines (101 loc) · 4.46 KB
/
bot.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import discord
import random
import giphy_client
from discord.ext import commands
from discord.utils import get
from discord import FFmpegPCMAudio
token="" #insert bot token here
client=discord.Client()
server_id= #Insert server ID here
giphy_token='' #insert giphy token here
api_instance=giphy_client.DefaultApi()
pro_members=["Severia", "Hieren1"]
players=[]
#Librerias de imagenes
jesh_images=["https://imgur.com/iXGV53S", "https://imgur.com/ox4D6Uv", "https://imgur.com/FXRsXHw", "https://imgur.com/ujsX0fr",
]
chango="https://imgur.com/a/NUdNIkA"
chango_pies="https://imgur.com/a/hr5bu9w"
chango_rezando="https://imgur.com/a/kmKgO9Y"
client=commands.Bot(command_prefix="")
@client.event
async def on_message(message):
id=client.get_guild(server_id)
sent_message=str(message.content).lower()
print(sent_message)
block="```"
if sent_message.find("matex say ")!=-1:
message_list=str(message.content).split(" ")
message_list[0]=message_list[0].lower()
message_list[1] = message_list[1].lower()
fixed_message=" ".join(message_list)
print(fixed_message)
new_message=fixed_message.split("matex say ")[1]
await message.channel.send(f"{block}{new_message}{block}")
elif sent_message=="matex count users":
await message.channel.send(f"{block}There are #{id.member_count} users in this server{block}")
elif sent_message=="matex gay":
await message.channel.send(f"{block}{message.author.name} is GAY{block}")
elif sent_message=="matex iq":
if message.author.name in pro_members:
await message.channel.send(f"{block}{message.author.name}'s IQ is over 5000{block}")
else:
await message.channel.send(f"{block}{message.author.name}'s IQ is less than 3{block}")
#{message.author.name} is retarded
#Librerias de imagenes para comendos MATEX SEND
elif sent_message=="matex send jesh" or sent_message=="matex send jeshua" or sent_message=="matex send pigihunter":
await message.channel.send(f"{random.choice(jesh_images)}")
elif sent_message=="matex send chango":
await message.channel.send(f"{chango}")
elif sent_message=="matex send chango rezando":
await message.channel.send(f"{chango_rezando}")
elif sent_message=="matex send chango pies":
await message.channel.send(f"{chango_pies}")
#Matex gifs
elif sent_message.find("matex gif")!=-1:
if sent_message=="matex gif":
#tema=sent_message.split("matex gif ")[1]
response=api_instance.gifs_search_get(giphy_token, "random", limit=100, rating='g')
gif_list=list(response.data)
gif=random.choices(gif_list)
await message.channel.send(f"{gif[0].url}")
else:
tema = sent_message.split("matex gif ")[1]
response = api_instance.gifs_search_get(giphy_token, tema, limit=5, rating='g')
gif_list=list(response.data)
gif=random.choices(gif_list)
await message.channel.send(f"{gif[0].url}")
"""
elif sent_message.find("matex play ")!=-1:
print("attempting to play")
message_list=str(sent_message).split(" ")
message_list[0]=message_list[0].lower()
message_list[1] = message_list[1].lower()
fixed_message=" ".join(message_list)
print(fixed_message)
url=fixed_message.split("matex play ")[1]
channel = message.author.voice.channel
guild=message.guild
voice_client=await channel.connect()
YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
'options': '-vn'}
voice = get(client.voice_clients, guild=message.guild)
with YoutubeDL(YDL_OPTIONS ) as ydl:
info = ydl.extract_info("https://www.youtube.com/watch?v=dQw4w9WgXcQ", download=False)
URL = info['formats'][0]['url']
voice.play(FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
"""
"""
channel = message.author.voice.channel
guild=message.guild
voice_client=await channel.connect()
player = await voice_client.create_ytdl_player(url)
players[guild.id]=player
player.start
print("Success")
"""
#754146281969942619
#754146053049155645
#754145713692344410
client.run(token)