import asyncio import discord from discord.ext import commands import os import praw from random import randint class Porno(object): """Porno commando's. Jij weet wat er aan is.""" def __init__(self, bot): self.bot = bot self.voice_states = {} self.fileIndex = {} self.r = praw.Reddit( user_agent='StroopwafelBot', client_secret='Z4K17T8TC26cNAgDSRxCkE9jYR4', client_id='aWeyKpzdHMtmJQ' ) self.r.read_only = True def __check(self, ctx): #Todo: Is dit het porno kanaal? return True def randomJpgFromFolder(self, dir): if dir not in self.fileIndex.keys(): self.fileIndex[dir] = [] #empty list for dirname, dirnames, filenames in os.walk('./'+ dir): for filename in filenames: if filename.endswith('.jpg'): self.fileIndex[dir].append(os.path.join(dirname, filename)) #now we should have an index for the selected folder, but it might still be empty (i.e. empty folder given) if self.fileIndex[dir]: return self.fileIndex[dir][randint(0,len(self.fileIndex[dir])-1)] #get a random element from the newly created index else: return 'default file here' @commands.command(pass_context=True) @asyncio.coroutine def nsfw(self, ctx): """ random post uit een nsfw subreddit, ... """ print(type(ctx.message.channel)) try: if(not ctx.message.channel.is_nsfw()): yield from ctx.channel.send("Alleen toegestaan in een NSFW kanaal") return except: print("borf") randnsfw = self.r.subreddit('randnsfw') post = randnsfw.random() try: yield from ctx.message.delete() except: print("No permission to delete message") yield from ctx.channel.send(ctx.author.mention + " Uit r/"+ randnsfw.display_name +": " + post.url) @commands.command(pass_context=True) @asyncio.coroutine def nya(self, ctx): """ nya? """ print(type(ctx.message.channel)) try: if(not ctx.message.channel.is_nsfw()): yield from ctx.channel.send("Alleen toegestaan in een NSFW kanaal") return except: print("borf") meow = self.r.subreddit('cat_girls+NekoIRL+Nekomimi') post = meow.random() try: yield from ctx.message.delete() except: print("No permission to delete message") yield from ctx.channel.send(ctx.author.mention + " " + post.url) @commands.command(pass_context=True) @asyncio.coroutine def gay(self, ctx): """ Gay & NSFW. Wat wilt een mens nog meer? """ print(type(ctx.message.channel)) try: if(not ctx.message.channel.is_nsfw()): yield from ctx.channel.send("Alleen toegestaan in een NSFW kanaal") return except: print("borf") gaynsfw = self.r.subreddit('autofellatio+Balls+baramanga+BHMGoneWild+bigbrotherbros+Bisexy+blackballed+blackcock+blackmale+Boners+BonersInPublic+broslikeus+Bulge+Bulges+CelebrityPenis+chesthairporn+ChubbySilverDaddies+circumcisions+cock+CockOutline+CubsGoneWild+CumCannonAddicts+CuteGuyButts+daddybears+DickSlips+FMN+foreskin+gayasshole+gaybears+gaybrosgonemild+GaybrosGoneWild+GayChubs+gaycumsluts+GayDaddiesPics+GayGifs+gayholdthemoan+gayincest+GayKink+gaymersgonewild+GayMuscleWorship+gaynsfw+gayotters+gayporn+gaypornhunters+gaypornornotgayporn+gaypornwithplot+GaySnapchatImages+gaystoriesgonewild+gaystrugglefuck+gayvideos+GayWatersports+gfur+gingerdudes+grower+guyskissing+HeSquats+Homosexual+hotguyswithtattoos+insanelyhairymen+jockstraps+jockwatch+ladybonersgw+leathermen+LegionairresGoneWild+LGBTGoneWild+LGBTreesGoneWild+lovegaymale+MaleArmpits+malemodels+malepornstars+malespandex+MaleUnderwear+manass+mangonewild+manlove+ManSex+MassiveCock+MensHighJinx+menslegs+MrBlowJob+nocategory+nopullingout+NSFW_GAY+NSFW_gay_porn+OhCumOn+penis+POCLadyBoners+PublicBoys+RedditorCum+SceneBoys+selfservice+Singlets+softies+speedos+TotallyStraight+TwinkLove+twinks+UniformedMen+VintageGayPics') post = gaynsfw.random() try: yield from ctx.message.delete() except: print("No permission to delete message") yield from ctx.channel.send(ctx.author.mention + " " + post.url)