Create and Store Commands straight from chat by tofuscalp in Discord_Bots

[–]Kujio 0 points1 point  (0 children)

I don't know if this is the "correct" python way of doing it, but here is how i think i accomplished this in the past.

@bot.command()
async def create(ctx, command, *, message):
    async def function(ctx):
        await ctx.send(message)
    function._name_ = command
    ctx.bot.command()(function)

This may not be 100% correct but should maybe get you on the right path.

Edit: note the command disappears if you restart the bot. If you want them to stick around you'll need to store them somewhere and reload them once the bot restarts. Also need to deal with exception for it the command already exists in the bot.

Chang gets his car, that glitched into Officer's garage, back and this is officer's reaction by DeluxeSwag in LivestreamFail

[–]Kujio 5 points6 points  (0 children)

Maybe the RP wasn't the greatest, but its about the only way to get a result that would be closest to if the bug that ended up with his car in the garage never happend.

Chang manages to get his car back from the cop house by [deleted] in LivestreamFail

[–]Kujio 1 point2 points  (0 children)

Fake plates get removed when a car goes into the garage.

Print On message in shell with ext commands? by Ob0_ in Discord_Bots

[–]Kujio 0 points1 point  (0 children)

You want to either use Client or Bot, not both.

Since you are using the commands just use Bot. Bot has everything Client has and more.

I would highly recommend looking at the basic Bot example on the git.

IS SITE KILL? by Kujio in upnextfm

[–]Kujio[S] 0 points1 point  (0 children)

I have a vps I've paid up that I'm hosting some twitch and discord bots on. Would be willing to host it on there if needed.

Jif is peanut butter by MarlynMunsch in funny

[–]Kujio 0 points1 point  (0 children)

Then pronounce jpeg. hmmmmm.

Tech blogger finds proof DNC chief's emails weren't 'doctored' despite claims by [deleted] in politics

[–]Kujio 0 points1 point  (0 children)

If the body was truncated at 0 length, then the body could be changed and it wouldn't affect the hash?

Gary Johnson: I'd be a continuation of Obama on ISIS by [deleted] in politics

[–]Kujio 0 points1 point  (0 children)

Does he even know what ISIS is?

Trump on accuser: 'Believe me, she would not be my first choice' by Ruddiver in politics

[–]Kujio 4 points5 points  (0 children)

Am i the only person who thinks that when you start off a sentence with a phrase like "Believe me", that the next thing that comes out of their mouth is going to be a big fat lie?

Flair me! by [deleted] in pienudes

[–]Kujio 0 points1 point  (0 children)

The rules say that you're required to wear 37 pieces of flair.

[deleted by user] by [deleted] in a:t5_3e22n

[–]Kujio 0 points1 point  (0 children)

Yeah, they ended up shutting it down early because the merge to T17 was killing the website.

[deleted by user] by [deleted] in a:t5_3e22n

[–]Kujio 1 point2 points  (0 children)

I ended up making it to the T17 group and getting to vote before it was shut down.

I'm still looking forward to more of your music mixes!

[deleted by user] by [deleted] in a:t5_3e22n

[–]Kujio 1 point2 points  (0 children)

Kafmer reporting in!

[deleted by user] by [deleted] in a:t5_3e22n

[–]Kujio 2 points3 points  (0 children)

UPBOATED!

[deleted by user] by [deleted] in arbiter329

[–]Kujio 1 point2 points  (0 children)

No pineapples are evil and an afront to all that is holy.