Advertisement
plytalent

reeeeeeee.py

Sep 8th, 2019
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 14.55 KB | None | 0 0
  1. import discord
  2. import os
  3. import threading
  4. import subprocess
  5. import asyncio
  6. import CONFIG_YEET
  7. #import importlib
  8. from discord.ext import commands
  9. from discord.utils import get
  10. import youtube_dl
  11. import ffmpeg
  12. import logging
  13. import random
  14. #import consoles
  15. prefix = CONFIG_YEET.prefix
  16. token = CONFIG_YEET.token
  17. logging.info("bot token: {}".format(token))
  18. client = commands.Bot(command_prefix=CONFIG_YEET.prefix)
  19. listqueue = []
  20. radioqueue=os.listdir("/termux/After The Flash 7: Mirage OST")
  21. commandYEET=""
  22. botname = ""
  23. randomnum = 0
  24. @client.event
  25. async def on_ready():
  26.    print("bot online")
  27.    botname=client.user.id
  28.    print(botname)
  29. @client.event
  30. async def on_message(message):
  31.    commandYEET = message
  32.    messageYEET = commandYEET
  33.    author = messageYEET.author
  34.    content = messageYEET.content
  35.    authorid = author.id
  36.    print(messageYEET)
  37.    print("author name: {}\ncontent: {}".format(author.name,content))
  38.    logchannel = message.channel
  39.    if content =="<@309164174313914368>":
  40.       await logchannel.send("meow {} why you ping me".format("<@"+str(authorid)+">"))
  41.    if not messageYEET.author.id == botname:
  42.       if message.guild == None or str(message.guild.id) == "387190332149727242":
  43.          if content == "Creeper" :
  44.             await logchannel.send("Aw man.")
  45.          elif content == "Aw man":
  46.             await logchannel.send("So we back in the mine.")
  47.          elif content == "So we back in the mine":
  48.             await logchannel.send("Got our pickaxe swinging from side to side.")
  49.          elif content == "Got our pickaxe swinging from side to side":
  50.             await logchannel.send("Side-side to side.")
  51.          elif content == "Side-side to side":
  52.             await logchannel.send("This task, a grueling one.")
  53.          elif content == "This task, a grueling one":
  54.             await logchannel.send("Hope to find some diamonds tonight, night, night.")
  55.          elif content == "Hope to find some diamonds tonight, night, night":
  56.             await logchannel.send("Diamonds tonight.")
  57.          elif content == "Diamonds tonight":
  58.             await logchannel.send("Heads up.")
  59.          elif content =="Heads up":
  60.             await logchannel.send("You hear a sound, turn around and look up.")
  61.          elif content =="You hear a sound, turn around and look up":
  62.             await logchannel.send("Total shock fills your body.")
  63.          elif content =="Total shock fills your body":
  64.             await logchannel.send("Oh, no, it's you again.")
  65.          elif content =="Oh, no, it's you again":
  66.             await logchannel.send("I can never forget those eyes, eyes, eyes.")
  67.          elif content =="I can never forget those eyes, eyes, eyes":
  68.             await logchannel.send("Eyes-eye-eyes.")
  69.          elif content =="Eyes-eye-eyes":
  70.             await logchannel.send("'Cause, baby, tonight.")
  71.          elif content =="'Cause, baby, tonight":
  72.             await logchannel.send("The creeper's tryna steal all our stuff again.")
  73.          elif content =="The creeper's tryna steal all our stuff again":
  74.             await logchannel.send("'Cause, baby, tonight.")
  75.          elif content =="'Cause, baby, tonight":
  76.             await logchannel.send("You grab your pick, shovel, and bolt again (Bolt again-gain).")
  77.          elif content =="You grab your pick, shovel, and bolt again (Bolt again-gain)":
  78.             await logchannel.send("And run, run until it's done, done.")
  79.          elif content =="And run, run until it's done, done":
  80.             await logchannel.send("Until the sun comes up in the morn'.")
  81.          elif content =="Until the sun comes up in the morn'":
  82.             await logchannel.send("'Cause, baby, tonight.")
  83.          elif content =="'Cause, baby, tonight":
  84.             await logchannel.send("The creeper's tryna steal all our stuff again (Stuff again-gain).")
  85.          elif content =="The creeper's tryna steal all our stuff again (Stuff again-gain)":
  86.             await logchannel.send("Just when you think you're safe.")
  87.          elif content =="Just when you think you're safe":
  88.             await logchannel.send("Overhear some hissing from right behind.")
  89.          elif content =="Overhear some hissing from right behind":
  90.             await logchannel.send("Right-right behind.")
  91.          elif content =="Right-right behind":
  92.             await logchannel.send("That's a nice life you have.")
  93.          elif content =="That's a nice life you have":
  94.             await logchannel.send("Shame it's gotta end at this time, time, time.")
  95.          elif content =="Shame it's gotta end at this time, time, time":
  96.             await logchannel.send("Time-time-time-time.")
  97.          elif content =="Time-time-time-time":
  98.             await logchannel.send("Blows up.")
  99.          elif content =="Blows up":
  100.             await logchannel.send("Then your health bar drops and you could use a one-up.")
  101.          elif content =="Then your health bar drops and you could use a one-up":
  102.             await logchannel.send("Get inside, don't be tardy.")
  103.          elif content =="Get inside, don't be tardy":
  104.             await logchannel.send("So, now you're stuck in there.")
  105.          elif content =="So, now you're stuck in there":
  106.             await logchannel.send("Half a heart is left, but don't die, die, die.")
  107.          elif content =="Half a heart is left, but don't die, die, die":
  108.             await logchannel.send("Die-die-die.")
  109.          elif content =="Die-die-die":
  110.             await logchannel.send("'Cause, baby, tonight.")
  111.          elif content =="'Cause, baby, tonight":
  112.             await logchannel.send("The creeper's tryna steal all our stuff again.")
  113.          elif content =="The creeper's tryna steal all our stuff again":
  114.             await logchannel.send("'Cause, baby, tonight.")
  115.          elif content =="'Cause, baby, tonight":
  116.             await logchannel.send("You grab your pick, shovel, and bolt again (Bolt again-gain).")
  117.          elif content =="You grab your pick, shovel, and bolt again (Bolt again-gain)":
  118.             await logchannel.send("And run, run until it's done, done.")
  119.          elif content =="And run, run until it's done, done":
  120.             await logchannel.send("Until the sun comes up in the morn'.")
  121.          elif content =="Until the sun comes up in the morn'":
  122.             await logchannel.send("'Cause, baby, tonight.")
  123.          elif content =="'Cause, baby, tonight":
  124.             await logchannel.send("The creeper's tryna steal all our stuff again.")
  125.          elif content =="The creeper's tryna steal all our stuff again":
  126.             await logchannel.send("(Creepers, you're mine, haha).")
  127.          elif content =="(Creepers, you're mine, haha)":
  128.             await logchannel.send("Dig up diamonds and craft those diamonds.")
  129.          elif content =="Dig up diamonds and craft those diamonds":
  130.             await logchannel.send("And make some armor, get it, baby.")
  131.          elif content =="And make some armor, get it, baby":
  132.             await logchannel.send("Go and forge that like you so MLG pro.")
  133.          elif content =="Go and forge that like you so MLG pro":
  134.             await logchannel.send("The sword's made of diamonds, so come at me, bro, huh.")
  135.          elif content =="The sword's made of diamonds, so come at me, bro, huh":
  136.             await logchannel.send("Training in your room under the torchlight.")
  137.          elif content =="Training in your room under the torchlight":
  138.             await logchannel.send("Hone that form to get you ready for the big fight.")
  139.          elif content =="Hone that form to get you ready for the big fight":
  140.             await logchannel.send("Every single day and the whole night.")
  141.          elif content =="Every single day and the whole night":
  142.             await logchannel.send("Creeper's out prowlin', hoo, alright.")
  143.          elif content =="Creeper's out prowlin', hoo, alright":
  144.             await logchannel.send("Look at me, look at you.")
  145.          elif content =="Look at me, look at you":
  146.             await logchannel.send("Take my revenge, that's what I'm gonna do.")
  147.          elif content =="Take my revenge, that's what I'm gonna do":
  148.             await logchannel.send("I'm a warrior, baby, what else is new?.")
  149.          elif content =="I'm a warrior, baby, what else is new?":
  150.             await logchannel.send("And my blade's gonna tear through you, bring it.")
  151.          elif content =="And my blade's gonna tear through you, bring it":
  152.             await logchannel.send("'Cause, baby, tonight.")
  153.          elif content =="'Cause, baby, tonight":
  154.             await logchannel.send("The creeper's tryna steal all our stuff again.")
  155.          elif content =="The creeper's tryna steal all our stuff again":
  156.             await logchannel.send("(Gather your stuff, yeah, let's take back the world).")
  157.          elif content =="(Gather your stuff, yeah, let's take back the world)":
  158.             await logchannel.send("Yeah, baby, tonight (Haha).")
  159.          elif content =="Yeah, baby, tonight (Haha)":
  160.             await logchannel.send("Grab your sword, armor and go (It's on).")
  161.          elif content =="Grab your sword, armor and go (It's on)":
  162.             await logchannel.send("Take your revenge (Woo), oh-oh, oh-oh.")
  163.          elif content =="Take your revenge (Woo), oh-oh, oh-oh":
  164.             await logchannel.send("So fight, fight, like it's the last, last night.")
  165.          elif content =="So fight, fight, like it's the last, last night":
  166.             await logchannel.send("Of your life, life, show them your bite (Woo).")
  167.          elif content =="Of your life, life, show them your bite (Woo)":
  168.             await logchannel.send("'Cause, baby, tonight.")
  169.          elif content =="'Cause, baby, tonight":
  170.             await logchannel.send("The creeper's tryna steal all our stuff again.")
  171.          elif content =="The creeper's tryna steal all our stuff again":
  172.             await logchannel.send("'Cause, baby, tonight.")
  173.          elif content =="'Cause, baby, tonight":
  174.             await logchannel.send("You grab your pick, shovel and bolt again (Bolt again-gain, woo).")
  175.          elif content =="You grab your pick, shovel and bolt again (Bolt again-gain, woo)":
  176.             await logchannel.send("And run, run until it's done, done.")
  177.          elif content =="And run, run until it's done, done":
  178.             await logchannel.send("Until the sun comes up in the morn'.")
  179.          elif content =="Until the sun comes up in the morn'":
  180.             await logchannel.send("'Cause, baby, tonight (Come on, swing your sword up high).")
  181.          elif content =="'Cause, baby, tonight (Come on, swing your sword up high)":
  182.             await logchannel.send("The creeper's tryna steal all our stuff again (Come on, jab your sword down low).")
  183.          elif content =="The creeper's tryna steal all our stuff again (Come on, jab your sword down low)":
  184.             await logchannel.send("(Woo).")
  185.          elif content =="Country road":
  186.             await logchannel.send("Take me home.")
  187.          elif content =="Take me home":
  188.             await logchannel.send("To the place i belong.")
  189.          elif content =="To the place i belong":
  190.             await logchannel.send("*DEEP INHALE*")
  191.             await asyncio.sleep(1)
  192.             await logchannel.send("WEST VIRGINIA.")
  193.          elif content =="West Virginia":
  194.             await logchannel.send("Mountain mama.")
  195.    if not message.guild == None:
  196.       print("avatar url: {}".format(message.guild.get_member(authorid).avatar_url))
  197.    await client.process_commands(messageYEET)
  198. @client.group()
  199. async def cogs(ctx):
  200.    if ctx.invoked_subcommand is None:
  201.       await ctx.send('Invalid cogs command passed...')
  202. @cogs.command()
  203. async def load(ctx,*,cogs):
  204.    client.load_extension("cogs.{}".format(cogs))
  205. @cogs.command()
  206. async def unload(ctx,*,cogs):
  207.    client.unload_extension("cogs.{}".format(cogs))
  208. @commands.group(aliases=["root","fullp"])
  209. async def full_permission(ctx):
  210.    if ctx.invoked_subcommand is None:
  211.       await ctx.send("Invalid full_permission command passed...")
  212.    elif not str(ctxauthor.id) == CONFIG_YEET.full_permission_guy:
  213.       await ctx.send("you can't use this command :(")
  214.       return
  215. @full_permission.command(pass_context=True, aliases=["file","fe"])
  216. async def send_file(ctx,path,*,filename):
  217.    await ctx.send(file=discord.File(str(path)+"/"+str(filename)))
  218. @commands.group()
  219. async def music(ctx):
  220.    if ctx.invoked_subcommand is None:
  221.       await ctx.send('Invalid music command passed...')
  222. @music.command(pass_context=True)
  223. async def join(ctx):
  224.    channelvc = ctxmessage.author.voice.channel
  225.    await channelvc.connect()
  226. @music.command(pass_context=True)
  227. async def test_radio(ctx,path,*,file):
  228.    await ctxmessage.author.voice.channel.connect()
  229.    ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(radioqueue[randomnum],executable='ffmpeg',pipe=False,before_options=None,options=None),1),after=None)
  230. @music.command(pass_context=True)
  231. async def playfromyoutube(ctx,message,*,name):
  232.    os.system("youtube-dl -x --audio-format mp3 --audio-quality 0 -o '/YOUTUBE_DOWNLOAD/{}.%(ext)s' '{}'".format(str(name),str(message) ) )
  233.    ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio("/YOUTUBE_DOWNLOAD/"+name+".mp3", executable='ffmpeg',pipe=False,before_options=None,options=None),1),after=None)
  234. @music.command(pass_context=True)
  235. async def play(ctx,path,*,file):
  236.    if str(file) ==  "meme1.mp3":
  237.       ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio("{}/{}".format(str(path) , str(file) ), executable='ffmpeg',pipe=False,before_options=None,options=None),5),after=None)
  238.    else:
  239.       ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio("{}/{}".format(str(path),str(file)),executable='ffmpeg',pipe=False,before_options=None,options=None),1),after=None)
  240.    await ctx.send("{}/{}".format(str(path),str(file) ) )
  241. @music.command(pass_context=True)
  242. async def queue(ctx,message):
  243.    listqueue.append(str(message))
  244. @music.command(pass_context=True)
  245. async def queuelist(ctx):
  246.    await ctx.send(str(listqueue))
  247. @commands.command(pass_context=True, aliases=['j',"joi"])
  248. async def rewrite_music_join(ctx):
  249.    global voice
  250.    channelvc = ctx.message.author.voice.channel
  251.    voice = get(client.voice_clients,guild=ctx.guild)
  252.    if voice and voice.is_connected():
  253.       await voice.move_To(channelvc)
  254.    else:
  255.       voice = await channelvc.connect()
  256. @commands.command(pass_context=True, aliases=['l','lea'])
  257. async def rewrite_music_leave(ctx):
  258.    channelvc = ctx.message.author.voice.channel
  259.    voice = get(client.voice_clients,guild=ctx.guild)
  260.    if voice and voice.is_connected():
  261.       await voice.disconnect()
  262. client.run(token,bot=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement