sleepyfoxen / moobot Goto Github PK
View Code? Open in Web Editor NEWpython version of moobot
python version of moobot
for the sake of documentation...
cls_.c.execute('''update harambe
set last=?, number=number+1, chain=chain+1
where server=?''', [d[0], server_id[0]])
instead of having d[0]
, and so on, we should not have the line d = (whatever,)
as a tuple, but instead pass the second argument to sqlite3.execute
as a tuple and (possibly) set up those arguments before...
this is really stupid
not really sure what causes this...
traceback:
Ignoring exception in command fortune
Traceback (most recent call last):
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/
core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "/home/joe/moobot/cogs/plugins/fortune.py", line 68, in fortune
await self.bot.say(cowsay)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 309, in _augmented_msg
msg = yield from coro
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/client.py", line 1152, in send_message
data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/http.py", line 211, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 848, in process_commands
yield from command.invoke(ctx)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line 369, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: BAD REQUEST (status code: 400)
INFO:discord.gateway:Unhandled event CHANNEL_PINS_UPDATE
Ignoring exception in command fortune
Traceback (most recent call last):
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "/home/joe/moobot/cogs/plugins/fortune.py", line 68, in fortune
await self.bot.say(cowsay)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/
bot.py", line 309, in _augmented_msg
msg = yield from coro
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/client.py", line 1152, in send_message
data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/http.py", line 211, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 848, in process_commands
yield from command.invoke(ctx)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line 369, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/home/joe/moobot/.venv/lib/python3.5/site-packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: BAD REQUEST (status code: 400)
eh
we are working towards moobot's goal of getting better memes
it'll massively reduce the shittyness.
the basic idea is to use a dictionary (with the keys being the message to match) and the values being functions which we can import. Or, we can import the whole dictionary. I'm ambivalent.
def f(message):
'''handle respect incrementation'''
pass
def respect(message):
'''handle telling people their respect'''
pass
def harambe(message)
'''handle harambe'''
pass
def skip(message):
'''no action'''
return
commands = {
'f': f,
'x': f,
'respect': respect,
'harambe': harambe,
}
### in moobot.py
# ...
def on_message(message):
commands.get(message.content, skip)(message)
title
this exists:
https://github.com/the-obsidian/DiscordBridge
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.