diff --git a/testbot.py b/testbot.py index 4daf22d..e3ecc26 100644 --- a/testbot.py +++ b/testbot.py @@ -4,6 +4,17 @@ import aiofiles import argparse +from tweepy import OAuthHandler +from tweepy import API +from tweepy import Cursor +from datetime import datetime, date, time, timedelta +from collections import Counter +import sys +import csv +from io import BytesIO + +import asyncio +import aiofiles import os import random import discord @@ -197,7 +208,12 @@ async def help(self, ctx): inline=False) embed.add_field(name="volume", value="adjust volume to n%", inline=False) + embed.add_field(name="eggs", value="eggs", inline=False) embed.add_field( + name="emote", + value="doge will send an emote he has access to. ", + inline=False, + ) embed.add_field( name="stop", value="stops playback and disconnects", inline=False ) @@ -216,24 +232,20 @@ async def join(self, ctx, *, channel: discord.VoiceChannel): @commands.command() async def shibe(self, ctx): -<<<<<<< HEAD await ctx.send( "https://www." + str(get_video("shibes")).replace('"', "")) @commands.command() -======= - await ctx.send("https://www." + str(get_video("shibes")).replace('"', "")) - - @commands.command() - async def dogedream(self, ctx): + async def dogedream(self, ctx, arg): + """ + Doge Dream command for helping Ziad + """ + try: + url = ctx.message.attachments[0].url except Exception: ctx.send("Error! please use attachments") -<<<<<<< HEAD # Note: you can pass url from message.content, # I suggest using mimetypes to indentify if URL has image. -======= - # Note: you can pass url from message.content, I suggest using mimetypes to indentify if URL has image. ->>>>>>> bdb928325678154451558126ef9213daccd39517 return () # Used aiohttp-requests for simplicity rather than aiohttp @@ -283,16 +295,10 @@ async def sounds(self, ctx, args=1): pagecnt += 1 embedlist.append( discord.Embed( -<<<<<<< HEAD title="πŸ”ŠπŸ”ŠπŸ”ŠLIST OF SOUNDS Page 1" + "/" + str( pagecnt) + " πŸ”ŠπŸ”ŠπŸ”Š", description="do doge!sounds pagenumber for another page. example: " "doge!sounds 2", -======= - title="πŸ”ŠπŸ”ŠπŸ”ŠLIST OF SOUNDS Page 1" + "/" + str(pagecnt) + " πŸ”ŠπŸ”ŠπŸ”Š", - description="do doge!sounds pagenumber for another page. example: " - "doge!sounds 2", ->>>>>>> bdb928325678154451558126ef9213daccd39517 color=0xE8E361, ) ) @@ -312,33 +318,20 @@ async def sounds(self, ctx, args=1): embedlist.append( discord.Embed( title="πŸ”ŠπŸ”ŠπŸ”ŠLIST OF SOUNDS Page " -<<<<<<< HEAD + str(pageno + 1) + "/" + str(pagecnt) + " πŸ”ŠπŸ”ŠπŸ”Š", -======= - + str(pageno + 1) - + "/" - + str(pagecnt) - + " πŸ”ŠπŸ”ŠπŸ”Š", ->>>>>>> bdb928325678154451558126ef9213daccd39517 description="Command format is doge!play " "nameofsound", color=0xE8E361, ) ) embedlist[pageno].set_author( -<<<<<<< HEAD name="GodEmperorDoge", url="https://www.github.com" "/rustyraptor" ) embedlist[pageno].set_thumbnail( url="https://i.imgur.com/ddy9MGr.jpg") -======= - name="GodEmperorDoge", url="https://www.github.com" "/rustyraptor" - ) - embedlist[pageno].set_thumbnail(url="https://i.imgur.com/ddy9MGr.jpg") ->>>>>>> bdb928325678154451558126ef9213daccd39517 inln = True if len(name) > 10: @@ -354,14 +347,9 @@ async def sounds(self, ctx, args=1): @commands.command() async def cheems(self, ctx): -<<<<<<< HEAD await ctx.send( "https://www." + str(get_video("cheems")).replace('"', "")) path = random.choice(os.listdir("cheems/")) -======= - await ctx.send("https://www." + str(get_video("cheems")).replace('"', "")) - path = random.choice(os.listdir("cheems/")) # change dir name to whatever ->>>>>>> bdb928325678154451558126ef9213daccd39517 await ctx.send(file=discord.File("cheems/" + path)) @commands.command() @@ -392,20 +380,12 @@ async def vibecheck(self, ctx, args=-1): counter += 1 if counter > 10: break -<<<<<<< HEAD -======= - import requests ->>>>>>> bdb928325678154451558126ef9213daccd39517 score = 0 for i in messages: r = requests.post( "https://api.deepai.org/api/sentiment-analysis", -<<<<<<< HEAD data={"text": i, }, -======= - data={"text": i,}, ->>>>>>> bdb928325678154451558126ef9213daccd39517 headers={"api-key": "485f6ea6-1175-428f-9bff-43e04ee8fa09"}, ) print(r.json()) @@ -431,26 +411,17 @@ async def vibecheck(self, ctx, args=-1): await ctx.channel.send(embed=embed) else: embed = discord.Embed( -<<<<<<< HEAD title="You passed the vibecheck", description="Hooray", color=0xFBFF00 -======= - title="You passed the vibecheck", description="Hooray", color=0xFBFF00 ->>>>>>> bdb928325678154451558126ef9213daccd39517 ) embed.set_author(name="Doge Bot") embed.set_image(url="https://i.imgur.com/l3FplOj.jpg") await ctx.channel.send(embed=embed) @commands.command(aliases=["EGGS", "eggs", "Eggs"]) -<<<<<<< HEAD async def play(self, ctx, folder="eggs", cut="full"): source = discord.PCMVolumeTransformer( discord.FFmpegPCMAudio(get_sound(folder))) -======= - async def play(self, ctx, args="eggs"): - source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(get_sound(args))) ->>>>>>> bdb928325678154451558126ef9213daccd39517 emote = "ERROR: EMOTE NOT FOUND" for i in bot.emojis: if i.name == "cooldoge": @@ -459,7 +430,6 @@ async def play(self, ctx, args="eggs"): ctx.voice_client.play( source, after=lambda e: print("Player error: %s" % e) if e else None ) -<<<<<<< HEAD if cut != "full": if cut == "short": time.sleep(6) @@ -489,15 +459,6 @@ async def say(self, ctx, args="You need to specify what you want me to " ctx.voice_client.play( source, after=lambda e: print("Player error: %s" % e) if e else None ) -======= - if args == "dorime": - path = random.choice( - os.listdir("dorimepic/") - ) # change dir name to whatever - await ctx.send(file=discord.File("dorimepic/" + path)) - await ctx.send(random.choice(dorimes)) - # await ctx.send("We need more prayers! Say DORIME") ->>>>>>> bdb928325678154451558126ef9213daccd39517 @commands.command() async def yt(self, ctx, *, url): @@ -505,12 +466,8 @@ async def yt(self, ctx, *, url): async with ctx.typing(): player = await YTDLSource.from_url(url, loop=self.bot.loop) ctx.voice_client.play( -<<<<<<< HEAD player, after=lambda e: print("Player error: %s" % e) if e else None -======= - player, after=lambda e: print("Player error: %s" % e) if e else None ->>>>>>> bdb928325678154451558126ef9213daccd39517 ) await ctx.send("Now playing: {}".format(player.title)) @@ -519,17 +476,11 @@ async def yt(self, ctx, *, url): async def stream(self, ctx, *, url): async with ctx.typing(): -<<<<<<< HEAD player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) ctx.voice_client.play( player, after=lambda e: print("Player error: %s" % e) if e else None -======= - player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) - ctx.voice_client.play( - player, after=lambda e: print("Player error: %s" % e) if e else None ->>>>>>> bdb928325678154451558126ef9213daccd39517 ) await ctx.send("Now playing: {}".format(player.title)) @@ -584,69 +535,10 @@ async def ensure_voice(self, ctx): async def on_ready(): print("Logged in as {0} ({0.id})".format(bot.user)) print("------") -<<<<<<< HEAD -======= - - -# @bot.event -# async def on_message(message): -# import requests -# if not message.author.bot and "deepdream" in message.content: -# url = message.attachments[0].url -# r = requests.get(url, allow_redirects=True) -# open('./imagesdb/testfile', 'wb').write(r.content) -# imgList = os.listdir('./imagesdb') # Creates a list of filenames from your folder -# imgString = random.choice(imgList) -# path = "./imagesdb/" + imgString # Creates a string for the path to the file -# -# import requests -# r = requests.post( -# "https://api.deepai.org/api/deepdream", -# files={ -# 'image': open(path, 'rb'), -# }, -# headers={'api-key': '485f6ea6-1175-428f-9bff-43e04ee8fa09'} -# ) -# print(r.json()) -# await message.channel.send("Iteration 1 " + r.json()['output_url']) -# -# async def fetch(session, url): -# async with session.get(url) as response: -# return await response.text() -# -# async def asrange(n): -# for a in range(n): -# yield a -# -# async for i in asrange(50): -# print("Iteration", i) -# url = r.json()['output_url'] -# r = fetch(url, allow_redirects=True) -# open('./imagesdb/' + str(message.id) + str(i), 'wb').write(r.content) -# imgList = os.listdir('./imagesdb/') # Creates a list of filenames from your folder -# path = './imagesdb/' + str(message.id) + str(i) -# # Creates a string for the path to the file -# r = requests.post( -# "https://api.deepai.org/api/deepdream", -# files={ -# 'image': open(path, 'rb'), -# }, -# headers={'api-key': '485f6ea6-1175-428f-9bff-43e04ee8fa09'} -# ) -# -# await message.channel.send("Iteration 50" + r.json()['output_url']) -# -# # if message.author.id == 250453739046043659: -# # for channel in message.guild: -# # await channel.send('<@125260119691755521>') -# -# await bot.process_commands(message) ->>>>>>> bdb928325678154451558126ef9213daccd39517 bot.add_cog(Music(bot)) bot.run(os.getenv("DISCORD_TOKEN")) -<<<<<<< HEAD # !/usr/bin/env python @@ -669,5 +561,3 @@ async def on_ready(): python synthesize_text.py --text "hello" python synthesize_text.py --ssml "Hello there." """ -======= ->>>>>>> bdb928325678154451558126ef9213daccd39517