· 6 years ago · Feb 09, 2019, 03:48 PM
1import discord
2from discord.ext import commands
3from discord.ext.commands import Bot
4import asyncio
5import datetime, time
6import random
7#import pynacl
8import youtube_dl
9from discord.voice_client import VoiceClient
10import os
11import json
12global chat_filter
13global bypass_list
14vc_clients = {}
15
16players = {}
17queues = {}
18playing = "Jelenleg nem megy semmilyen zene!"
19
20helpcmds = ["kick", "clear", "warn", "infractions", "mute", "tempmute", "unmute", "ban", "tempban", "unban"]
21
22def check_queue(id):
23 if queues[id] != []:
24 players = queues[id].pop(0)
25 players[id] = players
26 players.start()
27
28class bot():
29 class data():
30 version = "v1.2 BETA"
31 created_at = ""
32 prefix = "&"
33 servers = len(client.servers)
34 class author():
35 name = "TheInfiniteCode"
36 id = "338748699129937930"
37 def start():
38 client.start()
39 def stop():
40 client.stop()
41 def say(x):
42 client.say(x)
43 def log(x):
44 print(x)
45
46data = {
47 "Version": "v1.2 BETA",
48 "Servers": {
49 "serverList": ["DevHungary", "Magmanity", "CostaSpeak", "Djokerelek", "Magyar Programozók"]
50 },
51 "Author": "TheInfiniteCode",
52 "MineDiamonds": True
53}
54with open('data.json', 'w') as data1:
55 data1.write(json.dumps(data, indent=8))
56#print(json.dumps(data, indent=4, separators=(". ", " = ")))
57#print(json.dumps(data, indent=2, sort_keys=True))
58
59
60with open('data.json', 'r') as data2:
61 #json_str = data2.read()
62# json_value = json.loads(json_str)
63# print(type(json_value))
64# print(json_value["Servers"])
65 asd = data2.read()
66
67########################################################################
68chat_filter = ["BAROM", "FASZ", "PICSA", "KÚRVA", "GECI", "FOS"]
69bypass_list = ["338748699129937930"]
70developers = ["338748699129937930"]
71#bypass_list = ["414391316059783172", "416226732966936577"]
72developers = []
73
74
75version = "v1.2 BETA"
76prefix = "&"
77client = commands.Bot(command_prefix=prefix)
78client.remove_command('help')
79
80print ('StormBot indÃtása...')
81
82@client.event
83async def on_ready():
84 print ("A bot elindult!")
85 counter = 0
86 while not counter > 0:
87 await client.change_presence(game=discord.Game(name="{} szerveren | &help".format(len(client.servers)), type=0))
88 await asyncio.sleep(5)
89
90@client.command(pass_context=True)
91async def ping(ctx):
92 try:
93 ping = time.monotonic() / 1000
94 embed = discord.Embed(colour=discord.Colour.blue())
95 embed.add_field(name='Pong!', value='**{}**ms'.format(int(ping)))
96 embed.set_footer(text="StormBot | {}".format(version))
97 await client.say(embed=embed)
98 except:
99 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
100
101'''
102@client.command(pass_context=True)
103async def getJsonData(ctx):
104 try:
105 if ctx.message.author.id == "338748699129937930":
106 embed = discord.Embed(title='client data.json', description=asd, colour=discord.Colour.red())
107 embed.set_footer(text="StormBot | {}".format(version))
108 await client.say(embed=embed)
109 else:
110 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
111 embed.set_footer(text="StormBot | {}".format(version))
112 await client.say(embed=embed)
113 except:
114 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
115'''
116'''
117@client.event
118async def on_message(message):
119 print("{} : {} : {} » {}".format(message.server, message.channel, message.author, message.content))
120'''
121#Ãltalános
122@client.command(pass_context=True)
123@asyncio.coroutine def help(ctx, cmd: str):
124 if cmd == "warn":
125 #...
126 elif cmd == "infractions":
127 #...
128 elif cmd == "kick":
129 #...
130 elif cmd == "clear":
131 #...
132 elif cmd == "ban":
133 #...
134 elif cmd == "tempban":
135 #...
136 elif cmd == "unban":
137 #...
138 elif cmd == "mute":
139 #...
140 elif cmd == "tempmute":
141 #...
142 elif cmd == "unmute":
143 #...
144 else:
145 embed = discord.Embed(title='Hiba!', description='Ismeretlen fejezet!', colour=discord.Colour.red())
146 embed.set_footer("StormBot | {}".format(version))
147 await client.say(embed=embed)
148
149@help.error
150async def help_error(error, ctx)
151 embed = discord.Embed(
152 title = 'Parancsok',
153 colour = discord.Colour.blue()
154 )
155 embed.add_field(name='&general', value='Ãltalános parancsok megjelenÃtése', inline=False)
156 embed.add_field(name='&moderation', value='Moderációs parancsok megjelenÃtése', inline=False)
157 embed.add_field(name='&music', value='Zene parancsok megjelenÃtése', inline=False)
158 embed.add_field(name='&giveaway', value='Nyereményjáték parancsok megjelenÃtése', inline=False)
159 embed.add_field(name='&management', value='Vizsgálati napló parancsok megjelenÃtése', inline=False)
160 embed.set_footer(text="StormBot | {}".format(version))
161 await client.say(embed=embed)
162'''
163
164@client.command(pass_context=True)
165async def help(ctx):
166 embed = discord.Embed(
167 title = 'Parancsok',
168 colour = discord.Colour.red()
169 )
170 embed.add_field(name='&general', value='Ãltalános parancsok megjelenÃtése', inline=False)
171 await client.say(embed=embed)
172'''
173@client.command(pass_context=True)
174async def general(ctx):
175 embed = discord.Embed(
176 title = 'Ãltalános',
177 colour = discord.Colour.blue()
178 )
179 embed.add_field(name='&about', value='Bot információk megjelenÃtése', inline=False)
180 embed.add_field(name='&user-info (emlÃtés)', value='Felhasználó információinak megjelenÃtése', inline=False)
181 embed.add_field(name='&server-info', value='Szerver információk megjelenÃtése', inline=False)
182 embed.add_field(name='&channel-info', value='&Csatorna információk megjelenÃtése', inline=False)
183 embed.add_field(name='&invite', value='Bot meghÃvása', inline=False)
184 embed.add_field(name='&support', value='client discord link megjelenÃtése', inline=False)
185 embed.add_field(name='&feedback', value='Visszajelzés küldése', inline=False)
186 embed.add_field(name='&email', value='client email cÃmének megjelenÃtése', inline=False)
187 embed.add_field(name='&partners', value='client partnerek megjelenÃtése', inline=False)
188 embed.add_field(name='&donate', value='client fejlesztésének támogátása', inline=False)
189 embed.set_footer(text="StormBot | {}".format(version))
190 await client.say(embed=embed
191 # await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
192
193@client.command(pass_context=True, no_pm=True)
194async def moderation(ctx):
195 embed = discord.Embed(
196 title = 'Moderáció',
197 colour = discord.Colour.blue(),
198 )
199 embed.add_field(name='&kick (emlÃtés) (indok)', value='Felhasználó kirúgása', inline=False)
200 embed.add_field(name='&tempban (emlÃtés) (idÅ‘[nap]) (indok)', value='Felhasználó ideiglenes kitiltása', inline=False)
201 embed.add_field(name='&ban (emlÃtés) (indok)', value='Felhasználó kitiltása', inline=False)
202 embed.add_field(name='&unban (emlÃtés', value='Felhasználó kitiltásának feloldása', inline=False)
203 embed.add_field(name='&tempmute (emlÃtés) (idÅ‘)', value='Nyereményjáték parancsok megjelenÃtése', inline=False)
204 embed.add_field(name='&mute (emlÃtés) (indok)', value='Vizsgálati napló parancsok megjelenÃtése', inline=False)
205 embed.add_field(name='&unmute (emlÃtés)')
206 embed.add_field(name='&warn (emlÃtés) (indok)')
207 embed.add_field(name='&warns (emlÃtés)')
208 embed.set_footer(text="StormBot | {}".format(version))
209 await client.say(embed=embed)
210# await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
211
212@client.command(pass_context=True, no_pm=True)
213async def music(ctx):
214 embed = discord.Embed(
215 title = 'Zene',
216 colour = discord.Colour.blue(),
217 )
218 embed.add_field(name='&play (CÃm)', value='Zene lejátszása', inline=False)
219 embed.add_field(name='&join', value='Bot csatlakoztatása hangcsatotnához', inline=False)
220 embed.add_field(name='&leave', value='Bot lecsatlakoztatása', inline=False)
221 embed.add_field(name='&skip', value='Vizsgálati napló parancsok megjelenÃtése', inline=False)
222 embed.set_footer(text="StormBot | {}".format(version))
223 try:
224 await client.say(embed=embed)
225 except:
226 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
227
228@client.command(pass_context=True, no_pm=True)
229async def giveaway(ctx):
230 embed = discord.Embed(
231 title = 'Nyereményjáték',
232 colour = discord.Colour.blue(),
233 )
234 embed.add_field(name='&gcreate (Csatorna) (IdÅ‘) (Nyeremény) (Nyertesek száma)', value='Nyereményjáték indÃtása', inline=False)
235 embed.add_field(name='&gcancel', value='Moderációs parancsok megjelenÃtése', inline=False)
236 embed.add_field(name='&gend', value='Nyereményjáték parancsok megjelenÃtése', inline=False)
237 embed.set_footer(text="StormBot | {} ".format(version))
238 try:
239 await client.say(embed=embed)
240 except:
241 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
242
243@client.command(pass_context=True, no_pm=True)
244async def management(ctx):
245 await client.say(":white_check_mark: {}, Kiküldtem szamodra a parancsokat!".format(ctx.message.author.mention))
246 embed = discord.Embed(
247 title = 'Konfigurálás',
248 colour = discord.Colour.blue(),
249 )
250 embed.add_field(name='&general', value='Ãltalános parancsok megjelenÃtése', inline=False)
251 embed.add_field(name='&moderation', value='Moderációs parancsok megjelenÃtése', inline=False)
252 embed.add_field(name='&giveaway', value='Nyereményjáték parancsok megjelenÃtése', inline=False)
253 embed.add_field(name='&logger', value='Vizsgálati napló parancsok megjelenÃtése', inline=False)
254 embed.set_footer(text="StormBot | {}".format(version))
255 try:
256 await client.say(embed=embed)
257 except:
258 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
259
260#Ãltalános
261@client.command(pass_context=True)
262async def bot-info(ctx):
263 embed = discord.Embed(
264 title = 'Bot információk',
265 colour = discord.Colour.blue(),
266 )
267 embed.add_field(name='Fejlesztő', value='TheInfiniteCode', inline=False)
268 embed.add_field(name='Verzió', value=version, inline=False)
269 embed.add_field(name='Email', value='devhungary@gmail.com', inline=False)
270 embed.add_field(name='Support Szerver', value='DevHungary', inline=False)
271 embed.add_field(name='Készült', value='2019.01.14', inline=False)
272 embed.set_footer(text="StormBot | {}".format(version))
273 try:
274 await client.say(embed=embed)
275 except:
276 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
277
278
279@client.command(pass_context=True)
280async def donate(ctx):
281 embed = discord.Embed(title='StormBot fejlesztésének támogatása', value='Hamarosan', inline=False)
282 try:
283 await client.say(embed=embed)
284 except:
285 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!"
286
287
288#Moderáció
289@client.command(pass_context = True)
290async def mute(ctx, member: discord.Member, *, reason: str):
291 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "338748699129937930":
292 try:
293 role = discord.utils.get(member.server.roles, name='Muted')
294 except:
295 embed = discord.Embed(title='Hiba!', description='Nincs létrehozva a `muted` rang!', colour=discord.Colour.red())
296 embed.set_footer(text="StormBot | {}".format(version))
297 await client.say(embed=embed)
298 return
299 await client.add_roles(member, role)
300 embed=discord.Embed(title="Sikeres némÃtás!", colour=discord.Colour.green())
301 embed.add_field(name='LenémÃtva', value=member.mention, inline=False)
302 embed.add_field(name='NémÃtó', value=ctx.message.author.mention, inline=False)
303 if not reason == None:
304 embed.add_field(name='Indok', value=reason, inline=False)
305 else:
306 embed.add_field(name='Indok', value='Nincs megadva', inline=False)
307 embed.set_footer(text="StormBot | {}".format(version))
308 await client.say(embed=embed)
309 else:
310 embed=discord.Embed(title="Hiba!", description="Nincs jogod ehhez!", colour=discord.Colour.red())
311 embed.set_footer(text="Stormabot | {}".format(version))
312 await client.say(embed=embed)
313
314@mute.error
315async def mute_error(error, ctx, message):
316 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == '338748699129937930':
317 embed = discord.Embed(title='Hiba!', description='Használat: &mute (@Játékosnév) (Indok)', colour=discord.Colour.red())
318 embed.set_footer(text="StormBot | {}".format(version))
319 await client.say(embed=embed)
320 else:
321 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
322 embed.set_footer(text="StormBot | {}".format(version))
323 await client.say(embed=embed)
324'''
325
326@client.command(pass_context=True)
327async def mute(ctx, user: discord.Member = None, *, reason: str = None)
328 if not ctx.message.server == None:
329 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "":
330 if not user == "None":
331 try:
332 role = discord.utils.get(member.server.roles, name='Muted')
333 except:
334 embed = discord.Embed(title='Hiba!', description='Nincs beállÃtva a némÃtás!\n&setupMuteRole (@Rang)', colour=discord.Colour.red())
335 embed.set_footer(text="StormBot | {}".format(version))
336 return await client.say(embed=embed)
337 if reason == "None":
338 reason ="Nincs megadva!"
339 try:
340 embed = discord.Embed(title='Sikeres némÃtás', colour=discord.Colour.green())
341 embed.add_field(name='NémÃtva', value=user.mention, inline=False)
342 embed.add_field(name='NémÃtó', value=ctx.message.author.mention, inline=False)
343 embed.add_field(name='Indok', value=reason, inline=False)
344 await client.say(embed=embed)
345 await client.add_roles(user, role)
346 embed = discord.Embed(title='Figyelmeztetés!', description='Le lettél némÃtva a(z) {} szerveren!'.format(ctx.message.server), colour=discord.Colour.red())
347 embed.add_field(name='NémÃtó', value=ctx.message.author.mention, inline=False)
348 embed.add_field(name≠'Indok', value=reason, inline=False)
349 await client.send_message(user, embed=embed)
350 except:
351 await client.say(":x: A bot ismetetlen okokból nem tud embedeket kezelni!\nEllenÅ‘rizd a szerver beállÃtásait és a bot hozzáféréseit!")
352 else:
353 embed = discord.Embed(title='Hiba!', description='Használat: &mute (@Felhasználónév) (Indok[opcionális])', colour=discord.Colour.red())
354 embed.set_footer(text="StormBot | {}".format(version))
355 await client.say(embed=embed)
356 else:
357 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
358 embed.set_footer(text="StormBot | {}".format(version))
359 await client.say(embed=embed)
360 else:
361 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem tudod privát üzenetekben használni!', colour=discord.Colour.red())
362 embed.set_footer(text="StormBot | {}".format(version))
363 await client.say(embed=embed)
364'''
365@client.command(pass_context=True)
366async def tempban(user: discord.Member = None, time: int, *, reason: str = None):
367 if not ctx.message.server == None:
368 if not user == "None":
369 if time > 0:
370 if reason == "None":
371 reason = "Nincs megadva!"
372 embed = discord.Embed(title='Sikeres kitiltás!', colour=discord.Colour.green())
373 embed.add_field(name='Kitiltott', value="**{}**".format(user.name), inline=False)
374 embed.add_field(name='Kitiltó', value=ctx.message.author.mention, inline=False)
375 embed.add_field(name='Lejárat', value='**{} nap**'.format(int(time)), inline=False)
376 embed.add_field(name='Indok', value=reason, inline=False)
377 embed.set_footer(text="StormBot | {}".format(version))
378 await client.say(embed=embed)
379 await client.ban(user, time)
380 embed = discord.Embed(title='Figyelmeztetés!', description='Ki lettél kiltva a(z) {} szerveren!', colour=discord.Colour.red())
381 embed.add_field(name='Kitiltó')
382 else:
383 embed = discord.Embed(title='Hiba!', description='A tempban idelye nem lehet 0!', colour=discord.Colour.red())
384 embed.set_footer(text="StormBot | {}".format(version))
385 await client.say(embed=embed)
386 else:
387 embed = discord.Embed(title='Hiba!', description='Használat: &tempban (@Felhasználónév) (Idő[nap]) (Indok[opcionális])', colour=discord.Colour.red())
388 embed.set_footer(text="StormBot | {}".format(version))
389 await client.say(embed=embed)
390 else:
391 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem tudod privát üzenetekben használni!', colour=discord.Colour.red())
392 embed.set_footer(text="StormBot | {}".format(version))
393 await client.say(embed=embed)
394
395@tempban.error
396async def tempban_error(error, ctx):
397 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "":
398 embed = discord.Embed(title='Hiba!', description='Használat: &mute (@Felhasználónév) (Indok[, colour=discord.Colour.red())
399 embed.set_footer(text="StormBot | {}".format(version))
400 await client.say(embed=embed)
401 else:
402 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
403 embed.set_footer(text="StormBot | {}".format(version))
404 await client.say(embed=embed)
405
406@client.command(pass_context = True)
407async def unmute(ctx, member: discord.Member):
408 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "338748699129937930":
409 try:
410 role = discord.utils.get(member.server.roles, name='Muted')
411 except:
412 embed = discord.Embed(title='Hiba!', description='Nincs létrehozva a `muted` rang!', colour=discord.Colour.red())
413 embed.set_footer(text="StormBot | {}".format(version))
414 await client.say(embed=embed)
415 return
416 await client.remove_roles(member, role)
417 embed=discord.Embed(title="Sikeres némÃtás feloldás!", colour=discord.Colour.green())
418 embed.add_field(name='Feloldva', value=member.mention, inline=False)
419 embed.add_field(name='Feloldó', value=ctx.message.author.mention, inline=False)
420 embed.set_footer(text="StormBot | {}".format(version))
421 await client.say(embed=embed)
422 else:
423 embed=discord.Embed(title="Hiba!", description="Nincs jogod ehhez!", colour=discord.Colour.red())
424 embed.set_footer(text="Stormabot | {}".format(version))
425 await client.say(embed=embed)
426@mute.error
427async def mute_error(ctx, error):
428 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "338748699129937930":
429 embed = discord.Embed(title='Hiba!', description='Használat: &unmute (@Felhasználónév)', colour=discord.Colour.red())
430 embed.set_footer(text="StormBot | {}".format(version))
431 await client.say(embed=embed)
432
433
434'''
435@client.event
436async def on_message(message) :
437 await client.process_commands(message)
438 contents = message.content.split(" ")
439 for word in contents:
440 if word.upper() in chat_filter:
441 if not message.author.id in bypass_list:
442 try:
443 await client.delete_message(message)
444 embed = discord.Embed(title='Figyelmeztetés!', description='{}, ne használj trágár szavakat kérlek!'.format(message.author.mention), colour=discord.Colour.red())
445 await client.send_message(message.channel, " :eyes: **HÉKÃS** Te nem beszélhetsz Ãgy, mivel az nem szép dolog! Ha nem hagyod abba a csúnya szavak használatát, mute-ot is kaphatsz! :angry:")
446 except discord.errors.NotFound:
447 return
448
449
450
451'''
452'''
453@client.command(pass_context=True)
454async def ban(ctx, user: discord.Member, *, reason: str):
455 if not ctx.message.server == None:
456 if not user or not reason:
457 embed = discord.Embed(title='Hiba', description='Hibás használat!', colour=discord.Colour.red())
458 await client.say(embed=embed)
459 return
460 if not ctx.message.author.server_permissions.administrator:
461 embed = discord.Embed(title='Hiba!', description=':x: Nincs jogod ehhez!', colour=discord.Colour.red())
462 await client.say(embed=embed)
463 else:
464 if user.server_permissions.administrator:
465 if not ctx.message.server.owner == ctx.message.author:
466 embed = discord.Embed(title='Hiba', description=':x: Åt nem tilthatod ki!', colour=discord.Colour.red())
467 await stobot.say(embed=embed)
468 else:
469 await client.ban(user)
470
471 embed = discord.Embed(
472 title = 'Kitiltások',
473 colour = discord.Colour.red()
474 )
475 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
476 embed.add_field(name='Kitiltott', value=user, inline=False)
477 embed.add_field(name='Indok', value=reason, inline=False)
478 embed.add_field(name='Lejárat', value='Soha', inline=False)
479 embed.add_field(text="StormBot | {}".format(version))
480 await client.say(embed=embed)
481
482 embed = discord.Embed(
483 title = 'Ki lettél tiltva',
484 colour = discord.Colour.yellow()
485 )
486 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
487 embed.add_field(name='Indok', value=reason, inline=False)
488 embed.add_field(name='Lejárat', value='Soha', inline=False)
489 embed.set_footer(text="StormBot | {}".format(version))
490 await client.send_message(user, embed=embed)
491 else:
492 await client.say(":boot: {} ki lett tiltva a szerverről!".format(user.name))
493 await client.ban(user)
494
495 embed = discord.Embed(
496 title = 'Kitiltások',
497 colour = discord.Colour.red()
498 )
499 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
500 embed.add_field(name='Kitiltott', value=user, inline=False)
501 embed.add_field(name='Indok', value=reason, inline=False)
502 embed.add_field(name='Lejárat', value='Soha', inline=False)
503 embed.add_field(text="StormBot | {}".format(version))
504 await client.say(embed=embed)
505
506 embed = discord.Embed(
507 title = 'Ki lettél tiltva',
508 colour = discord.Colour.rex()
509 )
510 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
511 embed.add_field(name='Indok', value=reason, inline=False)
512 embed.add_field(name='Lejárat', value='Soha', inline=False)
513 embed.set_footer(text="SormBot | {}".format(version))
514 await client.send_message(user, embed=embed)
515 else:
516 await client.say(":x: Ezt a parancsot nem lehet privát üzenetekben használni!")
517@client.command(pass_context=True, no_pm=True)
518async def kick(ctx, user: discord.Member, *, reason: str):
519 try:
520 if not ctx.message.author.server_permissions.administrator:
521 nope = discord.Embed(title='Hiba!', description=':x: Nincs jogod ehhez!', colour=discord.Colour.red())
522 await client.say(embed=nope)
523 if ctx.message.author.server_permissions.administrator:
524 if user.server_permissions.administrator:
525 nope = discord.Embed(title='Hiba', description=':x: Åt nem tilthatod ki!', colour=discord.Colour.red())
526 await stobot.say(embed=nope)
527 else:
528 await client.say(":boot: {} ki lett rúgva a szerverről!".format(user.name))
529 await client.kick(user)
530 embed = discord.Embed(
531 title = 'Kitiltások',
532 colour = discord.Colour.yellow()
533 )
534 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
535 embed.add_field(name='Kitiltott', value=user, inline=False)
536 embed.add_field(name='Indok', value=reason, inline=False)
537 embed.add_field(name='Lejárat', value='Soha', inline=False)
538 embed.add_field(text="StormBot | {}".format(version))
539 await client.say(embed=embed)
540
541 embed = discord.Embed(
542 title = 'Ki lettél tiltva',
543 colour = discord.Colour.yellow()
544 )
545 embed.add_field(name='Kitiltó', value=ctx.message.author, inline=False)
546 embed.add_field(name='Indok', value=reason, inline=False)
547 embed.add_field(name='Lejárat', value='Soha', inline=False)
548 embed.set_footer(text="StormBot | {}".format(version)
549 await client.send_message(user, embed=embed)
550 except:
551 await client.say(":x: Ismeretlen hiba lépett fel! :c")
552@kick.error
553async def kick_error():
554 await client.say(":x: Hibás használat!")
555'''
556#Nyerrményjáték
557'''
558@stobot.command(pass_context=True)
559async def gcreate(channel: discord.Channel, time: int, winners: int, *, price: str):
560 if not ctx.message.server == None:
561 if not not channel or not time or not winners or not price:
562
563 else:
564 await client.say(":x: Hibás használat!")
565 else:
566 await client.say(":x: Ezt a parancsot nem tudod privát üzenetekben használni!")
567@gcreate.error
568async def gcreate_error(ctx, error):
569 await client.say(":x: Ismeretlen hiba lépett fel! Próbálkozz később!")
570'''
571@client.command(pass_context=True)
572async def clear(ctx, amount=0):
573 if not ctx.message.server == None:
574 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "338748699129937930":
575 channel = ctx.message.channel
576 messages = []
577 async for message in client.logs_from(channel, limit=int(amount)):
578 messages.append(message)
579 await client.delete_messages(messages)
580 await client.say(":white_check_mark: Sikeresen töröltem `{}` üzenetet".format(int(amount)))
581 else:
582 await client.say(":x: Nincs jogod ehhez!")
583 else:
584 await client.say(":x: Ezt a parancsot nem használhatod privát üzenetekben!")
585@clear.error
586async def clear_error(error, ctx):
587 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == "338748699129937930":
588 embed = discord.Embed(title='Hiba!', description='Használat: &clear (Szám)', colour=discord.Colour.red())
589 embed.set_footer(text="StormBot | {}".format(version))
590 await client.say(embed=embed)
591 else:
592 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
593 embed.set_footer(text="StormBot | {}".format(version))
594 await client.say(embed=embed)
595
596
597#Management
598'''
599@client.command(pass_context=True)
600async def echo(ctx, ch: str, *, text: str):
601 if not ctx.message.server == None:
602 if not channel or not text:
603 embed = discord.Embed(title='Hiba', description='Használat: &echo (csatorna) (szöveg)', colour=discord.Colour.red())
604 await client.say(embed=embed)
605 else:
606 embed = discord.Embed(title='Sikeresen kiküldtem a szöveget!', description=text, colour=discord.Colour.red())
607 await client.say(embed=embed)
608 await client.send_message(client.get_channel(ch), text)
609 else:
610 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem használhatod privát üzenetekben!', colour=discord.Colour.red())
611 await client.say(embed=embed)
612'''
613@client.command(pass_context=True)
614async def say(ctx, *, text: str):
615 if not ctx.message.server == None:
616 await client.delete_message(ctx.message)
617 await client.say(text)
618 else:
619 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem használhatod privát üzenetekben!', colour=discord.Colour.red())
620 embed.set_footer(text="StormBot | {}".format(version))
621 await client.say(embed=embed)
622@say.error
623async def say_error(ctx, error):
624 if not text:
625 await client.say(":x:")
626
627@client.command(pass_context=True)
628async def info(ctx, user: discord.Member):
629 if not ctx.message.server == None:
630 if not user:
631 return
632 embed = discord.Embed(
633 title = 'Felhasználói információk',
634 colour = discord.Colour.green()
635 )
636 embed.add_field(name='Felhasználónév', value=user.name, inline=False)
637 embed.add_field(name='AzonosÃtója', value=user.id, inline=False)
638 embed.add_field(name='Státusz', value=user.status, inline=False)
639 embed.add_field(name='Legmagasabb rang', value=user.top_role, inline=False)
640 embed.add_field(name='Csatlakozott', value=user.joined_at, inline=False)
641 embed.set_footer(text="StormBot | {}".format(version))
642 else:
643 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem tudod privát üzenetekben használni!', colour=discord.Color.red())
644 await client.say(embed=embed)
645
646@client.command(pass_context=True, no_pm=True)
647async def serverinfo(ctx):
648 embed = discord.Embed(
649 title = 'Szerver információk',
650 colour = discord.Colour.green()
651 )
652 embed.add_field(name='Szerver neve', value=ctx.message.server, inline=False)
653 embed.add_field(name='Tulajdonos', value=ctx.message.server.owner, inline=False)
654 embed.add_field(name='Régió', value=ctx.message.server.region, inline=False)
655 embed.add_field(name='Résztvevők', value=ctx.message.server.members, inline=False)
656 embed.add_field(name='Létrehozva', value=ctx.message.server.created_at, inline=False)
657 embed.set_footer(text="StormBot | {}".format(version))
658
659@client.command(pass_context=True)
660async def channelinfo(ctx):
661 embed = discord.Embed(
662 title = 'Csatorna információk',
663 colour = discord.Colour.green()
664 )
665 embed.add_field(name='Szerver', value=ctx.message.server)
666 embed.add_field(name='Csatorna Neve', value=ctx.message.channel, inline=False)
667 embed.add_field(name='AzonosÃtója', value=ctx.message.channel.id, inline=False)
668 embed.add_field(name='Létrehozva', value=ctx.message.channel.created_at, inline=False)
669 embed.set_footer(text="StormBot | {}".format(version))
670
671'''
672@client.command(pass_context=True)
673async def feedback(ctx, *, text: str):
674 dev = discord.Member(id="338748699129937930")
675 if not ctx.message.server == None:
676 await client.say("Köszönjük visszajelzésedet! Igyekszünk minnél hamarabb orvosolni a hibát!")
677 embed = discord.Embed(title= 'Feedback rendszer', description = 'Visszajelzés érkezett!', colour = discord.Colour.green())
678 embed.add_field(name='Feladó', value=ctx.mesage.author, inline=False)
679 embed.add_field(name='Üzenet', value=text, inline=False)
680 embed.set_footer(text="StormBot | {}".format(version))
681 await client.send_message(dev, embed=embed)
682 else:
683 embed = discord.Embed(title='Hiba!', value='Ezt a parancsot nem használhatod privát üzenetekben!', colour=discord.Colour.red())
684 embed.set_footer(text="StormBot | {}".format(version))
685 await client.say(embed=embed)
686'''
687
688#Management
689@client.command(pass_context=True)
690async def echo(ctx, ch: str, *, txt: str):
691 try:
692 channel = client.get_channel(ch)
693 except:
694 embed = discord.Embed(title='Hiba!', description='Ismeretlen csatorna!', colour=discord.Colour.red())
695 embed.set_footer(text="StormBot | {}".format(version))
696 return
697 embed = discord.Embed(title='KözvetÃtés', description=txt, colour=discord.Colour.red())
698 embed.set_footet(text="StormBot | {}".format(version))
699 await client.say(embed=embed)
700
701@client.command(pass_context=True)
702async def broadcast(ctx, *, text: str):
703 if not ctx.message.server == None:
704 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == '338748699129937930':
705 embed=discord.Embed(title='KözvetÃtés', description=text, colour=discord.Colour.red())
706 embed.set_footer(text="StormBot | {}".format(version))
707 await client.delete_message(ctx.message)
708 await client.say(embed=embed)
709 else:
710 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
711 embed.set_footer(text="StormBot | {}".format(version))
712 else:
713 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem tudod privát üzenetekben használni!', colour=discord.Colour.red())
714 embed.set_footer(text="StormBot | {}".format(version))
715 await client.say(embed=embed)
716@broadcast.error
717async def broadcast_error(error, ctx):
718 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == '338748699129937930':
719 embed = discord.Embed(title='Hiba!', description='Használat: &broadcast (Üzenet)', colour=discord.Colour.red())
720 embed.set_footer(text="StormBot | {}".format(version))
721 await client.say(embed=embed)
722 else:
723 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
724 embed.set_footer(text="StormBot | {}".format(version))
725 await client.say(embed=embed)
726
727@client.command(pass_context=True)
728async def coinflip(ctx):
729 embed = discord.Embed(title='Coinflip', description='Végerednény: {}'.format(random.choice(["Fej", "Ãrás"])))
730 embed.set_footer(text="StormBot | {}".format(version))
731 await client.say(embed=embed)
732
733
734
735
736@client.command(pass_context=True)
737async def shutdown(ctx):
738 if ctx.message.author.id == "338748699129937930":
739 embed = discord.Embed(title='LeállÃtás folyamatban...', description='A rendszer 10 másodperc múlva leáll!', colour=discord.Colour.green())
740 embed.set_footer(text="StormBot | {}".format(version))
741 await client.say(embed=embed)
742 await asyncio.sleep(10)
743 await client.say(":white_check_mark: A rendszer leállt!")
744 await client.close()
745
746 else: #
747 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
748 embed.set_footer(text="StormBot | {}".format(version))
749 await client.say(embed=embed)
750
751@client.command(pass_context=True)
752async def fstop(ctx):
753 if ctx.message.author.id == "338748699129937930":
754 embed = discord.Embed(title='A rendszer leállt!', description='Cya, {}'.format(ctx.message.author.mention), colour=discord.Colour.green())
755 embed.set_footer(text="StormBot | {}".format(version))
756 await client.say(embed=embed)
757 await client.close()
758
759 else: #
760 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
761 embed.set_footer(text="StormBot | {}".format(version))
762 await client.say(embed=embed)
763
764'''
765@client.command(pass_context=True)
766async def restart(ctx):
767 if ctx.message.author.id == "338748699129937930":
768 embed = discord.Embed(title='ÚjraindÃtás folyamatban...', description='A rendszer 10 másodperc múlva leáll!', colour=discord.Colour.green())
769 embed.set_footer(text="StormBot | {}".format(version))
770 await client.say(embed=embed)
771 await asyncio.sleep(10)
772 await client.say(":white_check_mark: A rendszer újraindult!")
773 await client.close()
774 await asyncio.sleep(5)
775 await client.open()
776
777 else: #
778 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
779 embed.set_footer(text="StormBot | {}".format(version))
780 await client.say(embed=embed)
781'''
782'''
783while True:
784 cmd = input()
785 if cmd == "start":
786 print ("StormBot | {} IndÃtása...".format(version))
787 try:
788 client.start()
789 print ("A rendszer elindult!")
790 except:
791 print ("Hiba lépett fel!")
792 if cmd == "stop":
793 print ("StormBot | {} LeállÃtása...".format(version))
794 try:
795 client.close()
796 print ("A rendszer leállt!")
797 except:
798 print ("Hiba lépett fel!")
799 if cmd != "start" and cmd != "stop":
800 print ("Ismeretlen parancs!")
801'''
802
803'''
804@client.command(pass_context=True)
805async def warn(ctx, *,text :str = None):
806 dev = discord.Member(id="338748699129937930")
807 msg = ctx.message.content.split(" ")
808 msg2 = " ".join(msg[2:])
809 await client.send_message(member, "Figyelmeztetést kaptál **{}** által a **{}** szerveren! Oka: **{}**".format(ctx.message.author , ctx.message.server.name , reason))
810 await client.say(f"Ok, a figyelmeztetést elküldtem {member.name}-nek ezért: {msg2}")
811# await client.say(":white_check_mark: A figyelmeztetést sikeresen elküldtem! :thumbsup:")
812 channel = client.get_channel(id="497472635412938755")
813 embed = discord.Embed(title="Warn log", color=discord.Color.red())
814 embed.add_field(name="Felhasználó", value=member.mention)
815 embed.add_field(name="Moderátor", value=ctx.message.author.mention)
816 embed.add_field(name="Ok", value=reason)
817 embed.set_footer(text=client.member.name, icon_url=client.member.avatar_url)
818 embed.set_thumbnail(url=member.avatar_url)
819 await client.send_message(channel, embed=embed)
820
821@client.command(pass_context=True)
822async def broadcast(ctx, *, text: str):
823 dev = discord.Member(id="ide az idm")
824 if not ctx.message.server == None:
825 if ctx.message.author.server_permissions.administrator or ctx.message.author.id == '338748699129937930':
826 if text == None:
827 embed=discord.Embed(title='Hiba!', description='Használat: &say (Üzenet)', colour=discord.Colour.red())
828 embed.set_footer(text="StormBot | {}".format(version))
829 await client.say(embed=embed)
830 return
831 embed=discord.Embed(title='KözvetÃtés', description=text, colour=discord.Colour.red())
832 embed.set_footer(text="StormBot | {}".format(version))
833 await client.delete_message(ctx.message)
834 await client.send_message(dev, embed=embed)
835
836 if not ctx.message.author.server_permissions.administrator or ctx.message.author.id == '338748699129937930':
837 embed = discord.Embed(title='Hiba!', description='Nincs jogod ehhez!', colour=discord.Colour.red())
838 embed.set_footer(text="StormBot | {}".format(version))
839 else:
840 embed = discord.Embed(title='Hiba!', description='Ezt a parancsot nem tudod privát üzenetekben használni!', colour=discord.Colour.red())
841 embed.set_footer(text="StormBot | {}".format(version))
842 await client.say(embed=embed)
843'''
844
845@client.command(pass_context=True)
846async def warn(ctx, member: discord.Member,*,reason :str = None):
847 await client.delete_message(ctx.message)
848 msg = ctx.message.content.split(" ")
849 msg2 = " ".join(msg[2:])
850 await client.send_message(member, "Figyelmeztetést kaptál **{}** által a **{}** szerveren! Oka: **{}**".format(ctx.message.author , ctx.message.server.name , reason))
851 await client.send_message(member, "``FIGYELEM! A BOT JELENLEG BÉTA VERZIÓBAN VAN, EZÉRT LEHETNEK BENNE HIBÃK! HA NEM VOLT MEGÉRDEMELT A FIGYELMEZTETÉS, VAGY EREDETILEG NEM NEKED SZÃNTÃK, KÉRLEK SZÓLJ ANNAK A SZERVERNEK AZ EGYIK MODERÃTORÃNAK A HELYTELEN ELJÃRÃS MIATT, AHOL EZT A FIGYELMEZTETÉST KAPTAD, VAGY KERESD FEL A KÉSZÃTÅMET!``(__**modfejlesztÅ‘**__ parancsot használva)")
852 await client.say(f"Ok, a figyelmeztetést elküldtem {member.name}-nek ezért: {msg2}")
853# await client.say(":white_check_mark: A figyelmeztetést sikeresen elküldtem! :thumbsup:")
854 channel = client.get_channel(id="497472635412938755")
855 embed = discord.Embed(title="Warn log", color=discord.Color.red())
856 embed.add_field(name="Felhasználó", value=member.mention)
857 embed.add_field(name="Moderátor", value=ctx.message.author.mention)
858 embed.add_field(name="Ok", value=reason)
859 embed.set_footer(text=client.member.name, icon_url=client.member.avatar_url)
860 embed.set_thumbnail(url=member.avatar_url)
861 await client.send_message(channel, embed=embed)
862@warn.error
863async def warn_error(ctx, error):
864 embed = discord.Embed(title='Hiba!', description='Használat: &warn (@Felhasználónév)', colour=discord.Colour.red())
865 await client.say(embed=embed)
866
867#zene
868@client.command(pass_context=True)
869async def belépés(ctx):
870 channel = ctx.message.author.voice.voice_channel
871 await client.join_voice_channel(channel)
872 await client.say("Beléptem a hangcsatornába, indÃthatjátok a zenéket!")
873
874
875
876@client.command(pass_context=True)
877async def kilépés(ctx):
878 server = ctx.message.server
879 voice_client = client.voice_client_in(server)
880 await voice_client.disconnect()
881 await client.say("Elhagytam a hangcsatornát, remélem tetszettek a zenék!")
882
883
884@client.command(aliases=['p'], pass_context=True)
885async def play(ctx, * ,url, ytdl_options=None, **kwarg):
886 if not ctx.message.author.bot:
887 server = ctx.message.server
888 voice_client = client.voice_client_in(server)
889 if voice_client == None:
890 await client.say("Kérlek várj, a zene mindjárt indul! :musical_note:")
891 try:
892 channel = ctx.message.author.voice.voice_channel
893 await client.join_voice_channel(channel)
894 except:
895 return False
896 try:
897 server = ctx.message.server
898 voice_client = client.voice_client_in(server)
899 ydl_opts = {
900 'format': 'bestaudio/best',
901 'postprocessors': [{
902 'key': 'FFmpegExtractAudio',
903 'preferredcodec': 'mp4',
904 'preferredquality': '192',
905 }],
906 }
907 player = await voice_client.create_ytdl_player("ytsearch: {}".format(url), before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5")
908 player.start()
909 global players
910 players[server.id] = player
911 player.volume = 0.2
912 global playing
913 playing = "Jelenlegi zene: **{}**".format(player.title)
914 global last_played
915 last_played = player.url
916 await client.say("Azonnal indul :thumbsup:")
917 except:
918 print(Exception)
919 await client.say("Oops! Valami nem jó! Kérlek próbáld meg a ``modkilépés``, utánna a ``modbelépés`` parancsot! :x:")
920 while not player.is_done():
921 await asyncio.sleep(2)
922 try:
923 server = ctx.message.server
924 voice_client = client.voice_client_in(server)
925 await voice_client.disconnect()
926 await client.say("A zene véget ért, úgyhogy én most megyek is... :wave: :white_check_mark: ")
927 except:
928 return False
929 else:
930 await client.say(":thinking: Úgy látszik most megy egy zene! Kérlek várd meg a végét, vagy használd a ``modkilépés``, majd a ``modbelépés`` parancsokat! :x:")
931 else:
932 return False
933
934
935@play.error
936async def play_error(error, ctx):
937 await client.say("Figyi te$$... MielÅ‘tt használnál egy parancsot, tudakold meg, hogy hogyan kell használni\nDe inkább most elmondom... Szóval, ez kell: **modplay [url vagy a zene cÃme]**")
938
939
940
941
942@client.command(pass_context=True)
943async def szünet(ctx):
944 id = ctx.message.server.id
945 players[id].pause()
946 await client.say("A zenét megállÃtottam!")
947
948
949@client.command(pass_context=True)
950async def leállÃtás(ctx):
951 try:
952 id = ctx.message.server.id
953 players[id].stop()
954 await client.say("A zenét leállÃtottam!")
955 except:
956 await client.say("Jelenleg nem szól egy zene sem!")
957
958
959@client.command(pass_context=True)
960async def folytatás(ctx):
961 try:
962 id = ctx.message.server.id
963 players[id].resume()
964 await client.say("A zene folytatódik!")
965 except:
966 await client.say("Jelenleg nem szól egy zene sem!")
967 return False
968
969
970@client.command(pass_context=True)
971async def skip(ctx):
972 try:
973 id = ctx.message.server.id
974 players[id].stop()
975 except:
976 return False
977
978@client.command(pass_context=True)
979async def playlist(ctx, aliases=['p', 'start']):
980 await client.say("Kérlek várj, indÃtom az elsÅ‘ zenét! :musical_note: ")
981 await client.say("A jelenlegi zene: ***Call me maybe***")
982 try:
983 server = ctx.message.server
984 url = "https://youtu.be/fWNaR-rxAic"
985 voice_client = client.voice_client_in(server)
986 player = await voice_client.create_ytdl_player(url)
987 players[server.id] = player
988 player.start()
989 await client.say("Szép napot kÃvánok {}!".format(ctx.message.author.mention))
990 except:
991 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
992 playlist.cancel()
993 while not player.is_done():
994 await asyncio.sleep(1)
995 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
996 await client.say("A jelenlegi zene: ***Dejavu***")
997 try:
998 server = ctx.message.server
999 url = "https://www.youtube.com/watch?v=dv13gl0a-FA"
1000 voice_client = client.voice_client_in(server)
1001 player = await voice_client.create_ytdl_player(url)
1002 players[server.id] = player
1003 player.start()
1004 await client.say("Azonnal indul! :thumbsup:")
1005 except:
1006 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1007 playlist.cancel()
1008 while not player.is_done():
1009 await asyncio.sleep(1)
1010 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1011 await client.say("A jelenlegi zene: ***Resistance***")
1012 try:
1013 server = ctx.message.server
1014 url = "https://www.youtube.com/watch?v=SKnRdQiH3-k"
1015 voice_client = client.voice_client_in(server)
1016 player = await voice_client.create_ytdl_player(url)
1017 players[server.id] = player
1018 player.start()
1019 await client.say("Azonnal indul! :thumbsup:")
1020 except:
1021 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1022 playlist.cancel()
1023 while not player.is_done():
1024 await asyncio.sleep(1)
1025 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1026 await client.say("A jelenlegi zene: ***Havanna***")
1027 try:
1028 server = ctx.message.server
1029 url = "https://www.youtube.com/watch?v=HCjNJDNzw8Y"
1030 voice_client = client.voice_client_in(server)
1031 player = await voice_client.create_ytdl_player(url)
1032 players[server.id] = player
1033 player.start()
1034 await client.say("Azonnal indul! :thumbsup:")
1035 except:
1036 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1037 playlist.cancel()
1038 while not player.is_done():
1039 await asyncio.sleep(1)
1040 await client.say("Ez a playlist véget ért, remélem tetszett, és még lesz mit hallgatni, mivel folyamatusan fejlesztem, bÅ‘vÃtem a botot, ami lehetÅ‘vé teszi több playlist lejátszását! Ha szeretnéd tudni, hogy mi van ebben a playlist-ben, használd a **?playlist2** parancsot!")
1041
1042
1043
1044
1045@client.command(pass_context=True)
1046async def playlist2(ctx, aliases=['p2', 'start2']):
1047 await client.say("Kérlek várj, indÃtom az elsÅ‘ zenét! :musical_note: ")
1048 await client.say("A jelenlegi zene: ***Tiësto & Dzeko: Jackie Chan***")
1049 try:
1050 server = ctx.message.server
1051 url = "https://www.youtube.com/watch?v=6DaL-Z4dwzI"
1052 voice_client = client.voice_client_in(server)
1053 player = await voice_client.create_ytdl_player(url)
1054 players[server.id] = player
1055 player.start()
1056 await client.say("Szép napot kÃvánok {}!".format(ctx.message.author.mention))
1057 except:
1058 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1059 playlist2.cancel()
1060 while not player.is_done():
1061 await asyncio.sleep(1)
1062 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1063 await client.say("A jelenlegi zene: ***5 seconds of summer***")
1064 try:
1065 server = ctx.message.server
1066 url = "https://www.youtube.com/watch?v=Jqs5EaAaueA"
1067 voice_client = client.voice_client_in(server)
1068 player = await voice_client.create_ytdl_player(url)
1069 players[server.id] = player
1070 player.start()
1071 await client.say("Azonnal indul! :thumbsup:")
1072 except:
1073 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1074 playlist2.cancel()
1075 while not player.is_done():
1076 await asyncio.sleep(1)
1077 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1078 await client.say("A jelenlegi zene: ***Joey trap: Sesame Street***")
1079 try:
1080 server = ctx.message.server
1081 url = "https://www.youtube.com/watch?v=WUH1TfMSQKc"
1082 voice_client = client.voice_client_in(server)
1083 player = await voice_client.create_ytdl_player(url)
1084 players[server.id] = player
1085 player.start()
1086 await client.say("Azonnal indul! :thumbsup:")
1087 except:
1088 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1089 playlist2.cancel()
1090 while not player.is_done():
1091 await asyncio.sleep(1)
1092 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1093 await client.say("A jelenlegi zene: ***Phoneix***")
1094 try:
1095 server = ctx.message.server
1096 url = "https://www.youtube.com/watch?v=5hDZbroaQDc"
1097 voice_client = client.voice_client_in(server)
1098 player = await voice_client.create_ytdl_player(url)
1099 players[server.id] = player
1100 player.start()
1101 await client.say("Azonnal indul! :thumbsup:")
1102 except:
1103 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1104 playlist2.cancel()
1105 while not player.is_done():
1106 await asyncio.sleep(1)
1107 await client.say("Kérlek várj, indÃtom a következÅ‘ zenét! :musical_note: ")
1108 await client.say("A jelenlegi zene: ***Centuries***")
1109 try:
1110 server = ctx.message.server
1111 url = "https://www.youtube.com/watch?v=LBr7kECsjcQ"
1112 voice_client = client.voice_client_in(server)
1113 player = await voice_client.create_ytdl_player(url)
1114 players[server.id] = player
1115 player.start()
1116 await client.say("Azonnal indul! :thumbsup:")
1117 except:
1118 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1119 playlist2.cancel()
1120 while not player.is_done():
1121 await asyncio.sleep(1)
1122 await client.say("Ez a playlist véget ért, remélem tetszett, és még lesz mit hallgatni, mivel folyamatusan fejlesztem, bÅ‘vÃtem a botot, ami lehetÅ‘vé teszi több playlist lejátszását! Ha szeretnéd tudni, hogy mi van ebben a playlist-ben, használd a **?playlist** parancsot!")
1123 server = ctx.message.server
1124 voice_client = client.voice_client_in(server)
1125 await voice_client.disconnect()
1126
1127
1128
1129#Rádió
1130@client.command(pass_context=True)
1131async def rádió(ctx):
1132 await client.say("Kérlek várj, indÃtom az élÅ‘ adást! :musical_note:")
1133 await client.say("A jelenlegi adó: ***Rádió 1***")
1134 try:
1135 server = ctx.message.server
1136 url = "http://213.181.210.106:80/high.mp3"
1137 voice_client = client.voice_client_in(server)
1138 player = await voice_client.create_ytdl_player(url)
1139 players[server.id] = player
1140 player.start()
1141 await client.say("Már megy is! :thumbsup:")
1142 embed = discord.Embed(title="Jelenlegi adó", color=0x00ffed)
1143 embed.add_field(name="Rádió1, Budapest",value=".",inline=True)
1144 embed.add_field(name=".",value=".",inline=True)
1145 await client.say(embed=embed)
1146 except:
1147 await client.say("Hiba történt! Kérlek próbáld meg a *modkilépés* parancsot, majd a *modbelépés* parancsot! :x:")
1148 rádió.cancel()
1149 while not player.is_done():
1150 await asyncio.sleep(1)
1151 await client.say("A rádió stream leállt, vagy hiba lépett fel a lejátszás közben! Kérlek indÃtsad újra, ha nem te kapcsoltad ki! Amúgy meg szép napot... :grin:")
1152
1153
1154@client.command(pass_context = True)
1155async def uptime(self):
1156 current_time = time.time()
1157 difference = int(round(current_time - start_time))
1158 text = str(datetime.timedelta(seconds=difference))
1159 embed = discord.Embed(colour=discord.Colour.gold())
1160 embed.add_field(name="", value='Current Uptime: **{}**'.format(text))
1161 embed.set_footer(text="GidBot | v1.1")
1162 try:
1163 await client.say(embed=embed)
1164 except discord.HTTPException:
1165 await client.say("Current uptime: " + text)
1166
1167@client.command(pass_context=True)
1168async def IQ200(ctx):
1169 await client.say("https://cdn.discordapp.com/attachments/414707187999571978/507526445526941696/GranularSameAmericanwarmblood-size_restricted.png")
1170
1171with open('token.txt', 'r') as token:
1172 secret_key = token.read()
1173
1174client.run(secret_key)