updated after a while because local stuff

This commit is contained in:
2017-11-10 22:58:01 +01:00
parent 4e44b73542
commit 21df9b0df5
95 changed files with 27441 additions and 25 deletions
+74 -10
View File
@@ -15,13 +15,39 @@ class Shitpost(object):
self.voice_states = {}
def __check(self, ctx): #Todo: Is dit het shitpost kanaal?
return True
@commands.command(pass_context=True, hidden=True)
@asyncio.coroutine
def mark(self, ctx, boven: str, onder: str):
"""Maakt een mark meem.
Bijvoorbeeld:
!mark \"je moeder\" \"is een hoer\"
"""
params = dict(
template_id = '112898841', #de marku
username = 'Stroopwafel',
password = 'ruyter118',
text0 = boven,
text1 = onder
)
#self.bot.say("deed ik het ding?")
resp = requests.get(url='https://api.imgflip.com/caption_image', params=params)
#todo check for success
photourl = resp.json()['data']['url']
em = discord.Embed(title='De Mark heeft gesproken.', type='photo')
em.set_image(url=photourl)
try:
yield from ctx.message.delete()
except:
print("No permission to delete message")
yield from ctx.channel.send(ctx.author.mention, embed=em)
@commands.command(pass_context=True)
@commands.command(pass_context=True, hidden=True)
@asyncio.coroutine
def eriku(self, ctx, boven: str, onder: str):
"""Maakt een erik meem.
Bijvoorbeeld:
@Stroopwafel eriku \"je moeder\" \"is een hoer\"
!eriku \"je moeder\" \"is een hoer\"
"""
params = dict(
template_id = '93296473', #de eriku
@@ -30,18 +56,50 @@ class Shitpost(object):
text0 = boven,
text1 = onder
)
self.bot.say("deed ik het ding?")
#self.bot.say("deed ik het ding?")
resp = requests.get(url='https://api.imgflip.com/caption_image', params=params)
#todo check for success
photourl = resp.json()['data']['url']
em = discord.Embed(title='De Eriku heeft gesproken. Prijs hem!', type='photo')
em.set_image(url=photourl)
yield from self.bot.say(embed=em)
try:
yield from ctx.message.delete()
except:
print("No permission to delete message")
yield from ctx.channel.send(ctx.author.mention, embed=em)
@commands.command(pass_context=True, hidden=True)
@asyncio.coroutine
def zout(self, ctx, boven: str, onder: str):
"""Maakt een martijn-zout meem.
Bijvoorbeeld:
!zout \"je moeder\" \"is een hoer\"
"""
params = dict(
template_id = '116231806', #de martijn
username = 'Stroopwafel',
password = 'ruyter118',
text0 = boven,
text1 = onder
)
#self.bot.say("deed ik het ding?")
resp = requests.get(url='https://api.imgflip.com/caption_image', params=params)
#todo check for success
photourl = resp.json()['data']['url']
em = discord.Embed(title='De Martijn heeft gesproken.', type='photo')
em.set_image(url=photourl)
try:
yield from ctx.message.delete()
except:
print("No permission to delete message")
yield from ctx.channel.send(ctx.author.mention, embed=em)
@commands.command(pass_context=True, hidden=True)
@asyncio.coroutine
def nihao(self,ctx):
yield from self.bot.say("Kankerlauw")
#yield from self.bot.say("Kankerlauw")
yield from ctx.channel.send("kankerlauw")
@commands.command(pass_context=True)
@asyncio.coroutine
@@ -49,7 +107,7 @@ class Shitpost(object):
"""Vertelt je hoe laat het is..
Misschien geeft het ook wel een leuke meem terug.
Wie weet.
Probeer het eens op verschillende tijdstippen
Probeer het eens op verschillende tijdstippen.
"""
time=datetime.now().strftime('%H%M')
@@ -64,9 +122,15 @@ class Shitpost(object):
filepath = filejpg
elif os.path.isfile(filepng):
filepath = filepng
try:
yield from ctx.message.delete()
except:
print("No permission to delete message")
if filepath is not '':
file = open(filepath, 'rb')
yield from self.bot.upload(file, filename = filepath)
#file = open(filepath, 'rb')
#yield from self.bot.upload(file, filename = filepath)
yield from ctx.channel.send(ctx.author.mention + ' Het is nu ' + datetime.now().strftime('%H:%M'), file=discord.File(filepath, 'tijd.png'))
else:
yield from self.bot.say('Het is nu ' + datetime.now().strftime('%H:%M'))
yield from ctx.channel.send(ctx.author.mention + ' Het is nu ' + datetime.now().strftime('%H:%M'))
def setup(bot):
bot.add_cog(Shitpost(bot))