#development

1 messages · Page 418 of 1

tardy hatch
#

For owner only

spring ember
#

Read the docs

#

Look for the check in ext.commands

tardy hatch
#

@spring ember is okay @bot.check(is_owner)?

#

Or need @is_owner

#

Or commands.check(is_owner)

#

:))

spring ember
#

It is the way to do it @bot.check(is_owner)?

tardy hatch
#

Idk

earnest phoenix
#

you should open up the docs

ruby dust
#

if I'm gonna try to get a message object, how far can it go into the channel's history before it fails to find that message?

earnest phoenix
#

wdym fails?

#

any specific lib you're using or talking in general

tardy hatch
#

@spring ember u can help me? Don t work with any check owner

#

I can stop it without perms

#
async def is_owner(ctx):
    return ctx.author.id == 316026178463072268

@bot.command(pass_context=True)
@bot.check(is_owner)
async def stop(ctx):
    await bot.say('Shutting down..')
    await bot.logout()```
#

At bot check

#

Is not okay

#

And idk what is not okay

earnest phoenix
#

idk py but im pretty sure that needs to be a string

knotty steeple
#

^

tardy hatch
#

Anyone can help me?

#
async def is_owner(ctx):
        return ctx.author.id == 25419821441522071

@bot.command(pass_context=True)
@is_owner()
async def stop(ctx):
    await bot.say('Shutting down..')
    await bot.logout()```
#

I have this

#

And i can use stop without permission

#

id is one random, not my

fierce atlas
#

hey guys, i have a question about discordbots.
many bots that i see online have their stats as online or idle. while mine keeps at ???. anyone knows what the reason for this is?

night imp
#

@fierce atlas the bot has to be in this server. Was it kicked from here?

fierce atlas
#

i do not know. i am approved and all. i can even post to the discordbots site (how many servers my bot has).

#

perhaps its because i edited the discordbots page? who do i go to, to have my bot invited?

night imp
#

I just checked and it seems to not be in the server

#

You can check in modlog for the reason for the kick and ask a mod to add it back

fierce atlas
#

ty

sinful lotus
#

do someone know stuff around snekfetch here?

fierce atlas
#

ah, its this.

#

never had my bot dm me with "unknown command". gotta fix that issue then.

#

thank you @night imp

glossy saddle
#

what is the command to playing

#

java

tardy hatch
#

Guys

#
async def is_owner(ctx):
        return ctx.author.id == 25419821441522071

@bot.command(pass_context=True)
@is_owner()
async def stop(ctx):
    await bot.say('Shutting down..')
    await bot.logout()```
#

Okay?

#

At this

#

Is a random id

#

And i have access to stop the bot

#

Anyone can help me please

lament meteor
#

doesnt it have to be a string? not numbers

ruby dust
#

depends on the lib's version

#

in async yeah, but in rewrite it's int

tardy hatch
#

..

lament meteor
#

@sinful lotus uh.... read https://listen.moe/donate ```That's why we have set up a Patreon where you can show your support and in exchange earn a few nice perks! So by becoming a supporter, you'll get:

  • Access to requesting songs. Let every listener know of your good taste.```
It's time to ditch other radios.

Taking after late Giga's Grooveshark stream, we ensure to keep delivering the best Anime and Japanese music!

sinful lotus
#

its requesting I believe

#

what im just doing is getting the song.title from the webpage and I think its not related to the api stuff im doing

lament meteor
#

¯_(ツ)_/¯

#

never used it

sinful lotus
#

well imma try to find a way for now thanks

earnest phoenix
lament meteor
#

you are using client.channels.find() not like message.guild.channels.find()

earnest phoenix
#

because you're retrieving the channel from client channels

#

I told you yesterday you might have an overlap problem

#

xD

#

What is better eris or discord.js

prime cliff
#

Oof

slender thistle
#

Python.

weak parrot
#

Oof > Eris > Discord.js

slender thistle
earnest phoenix
#

clearly eris

#

Lol

halcyon abyss
#

oof ?

austere meadow
#

clearly the best lib is mine

#

zdiscord

weak parrot
#

Should have been zBlakeCord

austere meadow
#

nah too long

#

zCord

weak parrot
#

That works too

earnest phoenix
#

message.guild.channels.find("name", settings.modLogChannel)

#

does not work? ;/

austere meadow
#

Which library should I pick? Eris or discord.js?
discord.js ─ more tailored towards beginners starting out with Discord bot development or programming in general, very nice and easy to follow syntax/types and it's quite powerful. Comes at the downside of being very memory hungry.
Eris ─ not as beginner friendly, designed for heavy use and abuse, very powerful and doesn't use as much memory as discord.js. If you plan to grow your bot and optimize it for the future, Eris is the way to go.
Both libraries cover the entire Discord API, and it's ultimately down to you which library you decide to use. Don't start arguments over which library is better, it's down to choice on which library they pick.

#

@earnest phoenix what does it return

#

either the channel doesn't exist in that guild or you are finding it based on the wrong thing

earnest phoenix
#

send of null means cant find channel?

#

right?

austere meadow
#

yeah

earnest phoenix
#

ok

halcyon abyss
#

What's that oof thing

earnest phoenix
#

thx it works

#

:))

lament meteor
#

Oof is discord.nou

earnest phoenix
#

i Cant figure out how to acces a json file with html.

uncut slate
austere meadow
#

im humbled

earnest phoenix
#

wait nvm i figured it out,

tardy hatch
#

Guys

#

I have a problem at permission..

#

How can i set only owner command?

quiet bobcat
#

server owner or you?

tardy hatch
#

Me

quiet bobcat
#

check for an id equal to you?

tardy hatch
#

Yes

quiet bobcat
#

there's your solution

tardy hatch
#

Python bot

#

:))

quiet bobcat
#

I don't know python

tardy hatch
#

I looked..

#

But

#

I have access to stop bot

#

And i setted another id

#

..

tardy hatch
#

Guys

#

For a python bot, anyone can help me?

#

To add only owner command?

#

For example add shitdown

#

Shutdown

woeful wadi
#

I don't use python but I get the id of who issued the command and check if it equals my id

#

oh wait you already got an answer

prime cliff
#

Yea that is pretty easy to do

woven flame
slender thistle
#

@tardy hatch You probaby need an if statement in the code for checking if ctx.author.message.id is equal to yours.

tardy hatch
#

@slender thistle

#

U can help me

prime cliff
#

🍿 this is

tardy hatch
#

To make code

#

For stop

#

@slender thistle man

slender thistle
#

Do you Python?

tardy hatch
#

Tep

#

Oh))

prime cliff
#

Constantly pinging people isnt gonma help also google can solve alot of code problems

tardy hatch
#

U don t know

#

Or

slender thistle
#

I do.

tardy hatch
#

Ik

#

But i need help, is okay this code:

prime cliff
#

You can google your question

slender thistle
#

I mean, I can help with python3, but spoon-feeding is disallowed. Think

tardy hatch
#
@bot.command(pass_context=True)
async def stop(ctx):
    await bot.say(":smiley: Shutting down..")
    await bot.logout()```
#

Ik

slender thistle
#
if ctx.message.author.id == 'YourIDHere'):
    # your code
tardy hatch
#

i ll add that if

#

At

ruby dust
#

are you on async or rewrite?

slender thistle
#

I don't remember if logout is a coroutine, but w/e.

tardy hatch
#
async def stop(ctx):
Here if
    await bot.say(":smiley: Shutting down..")
    await bot.logout()```
slender thistle
#

Async.

#

Can you post a code with the full if statement?

tardy hatch
#

Is okay there if?

slender thistle
#

Yes.

#

But also don't forget about the indentation.

ruby dust
#
@bot.command(pass_context=True)
async def stop(ctx):
    if ctx.message.author.id != 'YourID':
        return

    await bot.say(":smiley: Shutting down..")
    await bot.logout()
```there, you can stop asking now
tardy hatch
#

Thanks

#

Finnaly

slender thistle
#

Deive spoon-feeding. OMEGAROLL

tardy hatch
#

..

ruby dust
#

idc

woven flame
#

System.ArgumentOutOfRangeException at WebResponse response = request.GetResponse(); or string text = "";

#

every time

mental solstice
#

Can u show more code?

sturdy mortar
#

Someone help me code this bot

#

What do I need too do.

#

/???

sinful lotus
#

Add more features

sturdy mortar
#

?

mental solstice
#

Pick a language, get the discord api lib.. would be the first 2 steps

sinful lotus
#

theres a saying that you learn as you code

#

theres a lot of support for d.js as well, to point you into the right direction. But that is if you know basic js

#

if you don't know basic js and basically copy pasted codes then ¯_(ツ)_/¯

shy verge
#

go learn how to download/deserialize json from simple rest APIs

#

if you wanna make a good bot then you need to have at least some knowlege of network IO

sturdy mortar
#

I don't know how too code.

shy verge
#

then go learn too code

sturdy mortar
#

Where?

sinful lotus
#

how did you write that bot if you dont have knowledge of basic js

#

owo

shy verge
sturdy mortar
#

Python

shy verge
sturdy mortar
#

I don't know

#

Thx

uncut slate
#

that's not really appropriate for picking a language for bots imo

shy verge
#

ok then

#

@sturdy mortar fuck everything I just said, just pick and learn a language you think looks cool

uncut slate
shy verge
#

yes I know

#

I picked that mostly cause making a discord bot surely isn't your endgame, it's just something to chase while you learn your chosen language so you can do the real shit

sinful lotus
#

I learned js because I want to code bot tho I cant do real things yet

shy verge
#

then go learn to do real things

toxic oracle
#

oh wait.

shy verge
#

oops

earnest phoenix
#

how do I make my bot to tweet lastest tweets?

#

from a specific twitter feed

prime cliff
#

You would need to use the twitter api for that good luck

spring ember
#

Webhooks

#

😃

#

That's how twittercord probably works

uncut slate
#

twittercord

earnest phoenix
#

rings buzzer What is twittercord?

spring ember
#

A bot aeth made

#

Google it up

earnest phoenix
#

O

spring ember
#

Tweetcord

#

Whoops

uncut slate
#

smh

#

also I don't use webhooks, twitter timeline data is currently implemented in http streams

#

which are worse than webhooks

earnest phoenix
#

lol

#

btw I want to make a looping functins that makes a task

#

but the actual functions that will be looped is supposed to be separate JS files

#

how do I loop over functions calls which includes full JS files?

spring ember
#

I think Twitter do support webhooks

uncut slate
#

they're closed beta afaik

#

and very restricted, not production ready imo

spring ember
#

Bummer

ruby dust
#

what's the best way to continue a loop at forbidden error when my code looks like this:

for channel in ctx.guild.text_channels:
    if discord.Forbidden:
        continue
    async for message in channel.history(limit = 500):
floral stone
#

try and except it

inner jewel
#

^

floral stone
#

pass if failed

ruby dust
#

at which parts of the code? cause I've done that like dozen times and it seemed like I was using it wrong

desert bough
#

can someone help me im trying to add 1 everytime someone does a command in a .json file and idk how

inner jewel
#

use a proper database

#

don't store data on json files

floral stone
#

do use the with statement

#

don't

#

use the one line flatten()

tepid laurel
desert bough
#

@inner jewel not important data just adds the number 1 everytime someone does my *report command

tepid laurel
#

And heberror

#

The error*

ruby dust
#

oh yeah... the with statement is there...

#

but I actually need it to be there

#
async with ctx.channel.typing():
floral stone
#

I'm not talking about the channel just

#

history

tardy hatch
#

Lel

#
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "bot.py", line 18, in greet
    await bot.add_reaction('😂')
TypeError: add_reaction() missing 1 required positional argument: 'emoji'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_reaction() missing 1 required positional argument: 'emoji'
ruby dust
#

hmm

floral stone
#

@tardy hatch add reaction is missing emoji

tardy hatch
#

Lma

#

Lmao

floral stone
#

add_reaction(emoji)

tardy hatch
#

Emoji is 😂

#

Okay

#

And emoji

#

Must be

#

😂

#

Or

floral stone
#

msg.add_reaction()

#

rewrite, right?

tardy hatch
#

Yep

floral stone
#

msg.add_reaction(emoji)

tardy hatch
#

Okay

ruby dust
#

I've been struggling with this for over 2 days, can you just tell me the proper way of continuing in this code?

async with ctx.channel.typing():
    for channel in ctx.guild.text_channels:
        async for message in channel.history(limit = 500):
            if discord.Forbidden:
                continue
            if msg == message.id:
                if message.author.color != discord.Color.default():
                    embed = discord.Embed(description = message.content, color = message.author.color)
                else:
                    embed = discord.Embed(description = message.content)
                embed.set_author(name = message.author.name + '#' + message.author.discriminator, icon_url = message.author.avatar_url)
                if message.attachments:
                    embed.set_image(url = message.attachments[0].url)
                elif message.embeds:
                    embed.set_image(url = message.embeds[0].url)
                embed.set_footer(text = 'in channel: ' + message.channel.name)
                return await ctx.send(content = None, embed = embed)
earnest phoenix
#

discord.py owner checks? like it'll check for your ID and then it'll do the command and if you dont it doesn't

tardy hatch
#

And where i set emoji =))

floral stone
#

@ruby dust give me a few hours

#

I'm on mobile

#

unless someone can

tardy hatch
#

@floral stone and i need to replace (em

#

(Emoji) with emoji

#

Or..

#

Ffs

floral stone
#

needs to be an emoji or hard coded emoji string

tardy hatch
#
@bot.command(pass_context=True)
async def greet(ctx):
    await bot.add_reaction(emoji)```
floral stone
#

that's not async

tardy hatch
#

At emoji

#

Oh

floral stone
#

that's not rewrite

#

i mean

earnest phoenix
#

how to add owner only permission commands

floral stone
#

remove pass_context

tardy hatch
#

Okay

#

I ll remove

#

And?

#

Replace emoji with ':emoji'?

floral stone
#

it's await ctx.message.add_reaction(emoji)

tardy hatch
#

And where i can set emoji

#

=))))))))))

floral stone
#

you need to define emoji as an emoji thingy or string

#

emoji = "name:id"

tardy hatch
#
@bot.command()
async def greet(ctx):
    await ctx.message.add_reaction(emoji = ":wave:")```
floral stone
#

no

tardy hatch
floral stone
#

emoji = :wav on new line

#

before it

#

basic defining a variable

#

@ruby dust remind me as well

tardy hatch
#

Without "

ruby dust
#

hmm?

floral stone
#

I'll give you a better code

tardy hatch
#

Aaaa

#

Ph

ruby dust
#

so you need a code again?

floral stone
#

no

#

did you delete it

ruby dust
#

no

floral stone
#

dm it

tardy hatch
#
@bot.command()
emoji = :wave:
async def greet(ctx):
    await ctx.message.add_reaction(emoji)```
#

Okay?

floral stone
#

no

tardy hatch
#

Ffs

floral stone
#

inside the function

ruby dust
#

my dms are locked, temporarily accept fr then

floral stone
#

same

tardy hatch
#
@bot.command()
async def greet(ctx):
emoji = :wave:
    await ctx.message.add_reaction(emoji)```
floral stone
#

I added you though

#

you forgot to indent

ruby dust
#

yeah you need to accept it, cause I'm blocking frs as well xd

floral stone
#

add ne

tardy hatch
#

@floral stone

#

Where need to be indent

floral stone
#

the emlji

#

var

tardy hatch
#
@bot.command()
var emoji = :wave:
async def greet(ctx):
    await ctx.message.add_reaction(emoji)```
#

Or

#

Lmao

#

I m so confused

#

=))))))

ruby dust
#

man you aren't being pending in friend requests

desert bough
#

could someone help me with writing things to a json file

floral stone
#
@bot.command()
async def greet(ctx):
    emoji = ":wave:"
    await ctx.message.add_reaction(emoji)```
#

remove var though

uncut slate
#

and make it a string

floral stone
#

^

tardy hatch
#

Okay

prime cliff
#

@desert bough You should probably include more details like which lang you are using

desert bough
#

JS

#

Dicsord.js

south finch
#

^

prime cliff
desert bough
#

@prime cliff it was more adding a numver to a value inside the file already

prime cliff
#

Yea you can look it up on google about reading and changing json files

#

Should be simple enough to do in JS

desert bough
#

im a little stuck with it tho ive tried [Object]++; but it dont seem to work

floral stone
#

json[key] = json[key] + 1

desert bough
#

?

#

im a bit of a newb you'll have to explain it in newb terms XD

floral stone
#

get the file from json

#

assign the json to var json

desert bough
#

like this? const reportfile = JSON.parse(fs.readFileSync("./reports.json", "utf8"));

floral stone
#

I guess

#

I don't use js often

#

you know how you get a field

#

or add something to the json

desert bough
#

not really

floral stone
#

I'm on mobile so I really can't help

desert bough
#

damn

earnest phoenix
#

how do I do so I can tag the channel I wanna have as a mod channel in settings+
so it looks like <command> <action> <#something>
?

#

without getting the channel id's like <@Numbers>

#

which messes up my message.guild.channels.find("name", settings.modLogChannel)

spring ember
#

do you have the channel as a channel object?

#

channel.mention I think will tag

earnest phoenix
#

Does someone know how i can define an enter trough code in a discord codeblock?

acoustic juniper
#

Donku to mention just inerlope Message.Author or use reply instead which will tag the last person who said anything at the begginging

earnest phoenix
#

For example :

#
'offline\nonline\nonline\noffline\noffline\noffline\nonline\nonline\noffline\nonline\nonline\noffline'
spring ember
#

?

earnest phoenix
#

How do i define enters in a discord codeblock?

#

clearly \n are all being seen as text

knotty steeple
#

enters?

earnest phoenix
#

ye

knotty steeple
#

the \n thing should work

earnest phoenix
#

clearly not ^

spring ember
#

umm weird

knotty steeple
#

thats weird Thonk

spring ember
#

send code

elder rapids
#

Unless you're escaping \n it should work fine

earnest phoenix
#
offline\nonline\nonline\noffline\noffline\noffline\nonline\nonline\noffline\nonline\nonline\noffline
#

Hmmm, i think i know where the issue lies

#

Let me revisit it

#

issue found and fixed.. 😃 Thanks for the help Not fixed :/

#

So this is the code @spring ember :

bashCommand = bash
        process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
        output, error = process.communicate()

        await ctx.send("**Output:**\n```py\n{}\n```\n**Error:**\n```py\n{}\n```".format(output, error))
#

Its a bit of a mess 😛

#

bashCommand = bash
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()

    await ctx.send("**Output:**\n```py\n{}\n```\n**Error:**\n```py\n{}\n```".format(output, error))
#

but it outputs as :

b'              total        used        free      shared  buff/cache   available\nMem:           1952         510         178          48        1263        1125\nSwap:             0           0  
#

and you can clearly see the \n's in the codeblock :/

spring ember
#

umm weird

floral stone
#

@earnest phoenix is that a bytes object?

earnest phoenix
#

str

floral stone
#

b'

#

^

#

What's that then

tardy hatch
#

Guys

#

I have a problem

earnest phoenix
#

Thats something i am not sure about yet either 😛

tardy hatch
#

Bot don t add reaction

#

I got this error

floral stone
#

@desert bough It's bytes

tardy hatch
#
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "bot.py", line 20, in greet
    await ctx.message.add_reaction(emoji)
NameError: name 'ctx' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'ctx' is not defined```
floral stone
#

Convert output and error with str()

tardy hatch
#

I know, ctx is not defined

floral stone
#

@tardy hatch ctx is not defined

tardy hatch
#

But, idk to define id

floral stone
#

onbiously

tardy hatch
#

It

floral stone
#

what's the code

tardy hatch
#

How to define ctx

earnest phoenix
#

ok, gonna give it a try @floral stone

tardy hatch
#
@bot.command()
async def greet():
    emoji = ":wave:"
    await bot.say(':smile: :wave: Hello there!')
    await ctx.message.add_reaction(emoji)```
#

That is the code

floral stone
#
@bot.command()
async def greet(ctx):
    emoji = ":wave:"
    await bot.say(':smile: :wave: Hello there!')
    await ctx.message.add_reaction(emoji)```
tardy hatch
#

One secons

floral stone
#

ctx wasn't an argument in the function

tardy hatch
#

Again

#

Ignoring exception in command greet
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 367, in invoke
yield from self.prepare(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.

floral stone
#

Is that all the code?

tardy hatch
#

Yes

floral stone
#

All of it?

#

Like the whole file

#

did you reload it

#

@earnest phoenix did it work

tardy hatch
#

@floral stone u want full file?

floral stone
#

yes

#

hastebin it

earnest phoenix
#

@floral stone Still trying, my devtools module just crashed on me

floral stone
#

hm

tardy hatch
#

@floral stone a site where i can paste a code?

floral stone
earnest phoenix
#

got .format(str(output), str(error))) now

floral stone
#

@earnest phoenix put the code and imports in a hastebin

#

be much easier to copy and use.

#

so I can debug it

earnest phoenix
tardy hatch
#

I can t upload from phone @floral stone ..

mental solstice
#

U think the .format function is doing it?

floral stone
#

pastebin then

#

@earnest phoenix what bash are you doing again

earnest phoenix
#

@tardy hatch Are you using latest or rewrite version?

#

free -m

#

just a simple command

tardy hatch
earnest phoenix
#

You are missing @bot.command(pass_context=True) on line 16 @tardy hatch

floral stone
#

What are the imports

#

He said he was using rewrite...

#

@earnest phoenix

earnest phoenix
#

import subprocess

tardy hatch
#

@earnest phoenix idk =))

earnest phoenix
#

@tardy hatch The error is saying that you are missing context.
This is because you have @bot.command() instead of @bot.command(pass_context=True)

tardy hatch
#

One second

earnest phoenix
#

Your using the latest version.

#

rewrite passes context by default.

tardy hatch
#

Ffs

#

I don t know how bcs im a noob

#

Bot send message

#

Put

earnest phoenix
#

how what?

tardy hatch
#

Don t reacy

earnest phoenix
#

got await in front of it?

tardy hatch
#

How to rewrite passes

spring ember
#

?

tardy hatch
#

Yep

floral stone
#

output.decode("utf-8")

#

@earnest phoenix

earnest phoenix
#

I need to add that in the format?

floral stone
#

yes

earnest phoenix
#

Ok, lets give that a try

tardy hatch
#

``
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/usr/local/lib/python3.5/dist-packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'add_reaction'``

#

ctx.add_reaction(emoji) don t work

floral stone
#

that's becauser you ar e using async

#

hold up

tardy hatch
#

What

#

Need to add output.decode("utf-8") ?

floral stone
#

no

#

thta's not for you

#
await bot.add_reaction(ctx.message, emotion)```
tardy hatch
#

Okay

floral stone
#

Remember, you are using async.

tardy hatch
#

@floral stone thanks

#

And i have one more question

#

Is possible to make bot to react at his message

#

For example add an await bot.say('Like or flower')

floral stone
#
await bot.add_reaction(msg, emoji)```
#

@tardy hatch

tardy hatch
#

Okay

main isle
#

how can I send pm to a specific user id with discord.js?

shy verge
#

are you fetching a user or getting it out of a message?

main isle
#

what?

#

i have a user id

#

i a wanna send PM

shy verge
#

client.users.get()

#

that returns a user object

main isle
#

ty

#

i'll try

#

It works! TY

worn sparrow
uncut slate
worn sparrow
#

@uncut slate 👍

earnest phoenix
#

Anyone know a free and good host for Node.js eris?

tawny lava
#

"free" and "good" don't go together very well mmLol

#

if you want any good paid servers look at the pins

verbal night
#

If it's for a discord bot which i'm assuming it is, if it's a small bot running it off your PC would probably work >.>

earnest phoenix
#

Yes.

verbal night
#

can't really say anything about medium/large bots however 🤷

earnest phoenix
#

It is a small bot and I am running it on my PC.

verbal night
#

If it's not lagging or anything, don't really bother spending money on something you don't really need

earnest phoenix
#

Does discord.py has a way or function to trigger a event manually? (like the client.emit from Javascript)

daring hollow
#

when do i get my api key to post stats? (I have submitted my bot)

halcyon torrent
#

first just wait for you bot to be approved ^^

daring hollow
#

oh ok

halcyon torrent
#

(when staff will test if it has some non-basic functions)

verbal night
#

(They also make sure it doesn't break the discord TOS)

halcyon torrent
#

(yeah but it's pretty obvious ablobeyes )

topaz fjord
#

free + good = null

lament meteor
#

@topaz fjord is ur bot free?

topaz fjord
#

Wut

lament meteor
#

ur bot is free + good = null

topaz fjord
#

No

#

Servers

#

Free servers + good = null

lament meteor
#

ok

low rivet
#

@earnest phoenix just call await bot.on_connect() etc

earnest phoenix
#

That simple!? O_o

#

Damn, thanks @low rivet !

gilded thunder
#

Why doesn't this work correctly? Discord.py async

# botcheck
def botcheck(ctx):
    return ctx.message.author.bot == True
slender thistle
#

Why would you need that if you can use if x.x.author.bot: or if not x.x.author.bot:

#

But anyways, try with only one =.

gilded thunder
#

Invalid syntax.

slender thistle
#

Yeah, got it wrong.

gilded thunder
#

What if parse it as a variable?

slender thistle
#

Might work.

#

Should.

gilded thunder
#

Now it throws check errors.

slender thistle
gilded thunder
#
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 367, in invoke
    yield from self.prepare(ctx)
  File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 344, in prepare
    self._verify_checks(ctx)
  File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 339, in _verify_checks
    raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
discord.ext.commands.errors.CheckFailure: The check functions for command test failed.```
slender thistle
#

Mind sending your code?

static bramble
#

Why are you doing ctx.message.author.bot instead of just ctx.bot @gilded thunder

gilded thunder
#

¯_(ツ)_/¯

#

@slender thistle which part?

slender thistle
#

@static bramble Because they are not using rewrite.

#

The whole thing, Ig.

trim saddle
#

you don't even need to do that much to make sure your bot doesn't respond to other bots

gilded thunder
#

That's the check that I'm doing.

trim saddle
#

under the on message event:
if ctx.message.author.bot:
pass

gilded thunder
#

I don't do on message.

#

I do async def

slender thistle
#

Under the function, then. Thinkmas

gilded thunder
#

For all of them?

#

Well.

#

ignore dat

slender thistle
#

Oh, btw. Don't you need to use await bot.process_commands() on on_message if you use async def?

gilded thunder
#

me being dum dum

trim saddle
#

@slender thistle ye

gilded thunder
#
@bot.command()
async def test(ctx):
    await bot.say("despacito")```
static bramble
#

when everyone is using bot and i’m still using client

gilded thunder
#

That's a command.

trim saddle
#

ewww.

#

you're just adding extra code to yourself

static bramble
#

eh

slender thistle
#

Then:
if not message.author.bot:
await bot.process_command()

static bramble
#

does bot support aliases for the commands tho

slender thistle
#

I don't remember the arguments, though.

trim saddle
#

@quartz dune.command(aliases=['one', 'two', 'oatmeal'])

#

oof.

#

you get the point

earnest phoenix
#

fooooooooking python

static bramble
#

wow

#

Maybe i’ll use bot in the future but eh..

verbal night
#

@static bramble or do your own command handler?

static bramble
#

yeah

#

a crappy one i need to rewrite but it’s my baby

verbal night
#

That's what i do with java 🤷

static bramble
#

i tried learning java by writing a bot, i just can’t with java libraries and philosophy of “everything has to be a class” tho

verbal night
#

ah

static bramble
#

is java worth learning for a hobbyist programmer

earnest phoenix
#

ye

native narwhal
#

I would say so but it also depends on what you're doing

#

Or want to be doing

static bramble
#

Mainly web backend for different projects of mine.

That’s why i tried learning java in the first place (only really tried for a few days before I decided to come back later). I already knew python so I stared writing stuff in python

native narwhal
#

I see, Java is pretty good for web backend in my opinion

earnest phoenix
#

asp.net is the one true web backend and nothing will ever surpass it

native narwhal
#

I certainly do disagree

tame marsh
#

r!ping

quiet bobcat
elder rapids
#

Personally I just like the regular old nodejs web backend stuff

sturdy mortar
#

Is there any coding programs for tablets?

earnest phoenix
#

research GWlulurdWaitWhat

static bramble
#

Depends on your language bruh

#

I use python a lot and got Pythonista, I have also found apps for Java, C++, Lua, Swift, and Ruby

earnest phoenix
#

and 95% of them are paid

static bramble
#

All of the languages i listed except for python had free ones

earnest phoenix
#

the good ones are paid

static bramble
#

Tru

earnest phoenix
#

the free ones are ugly

#

ive seen half of them

static bramble
#

Pythonista ftw

#

only $10 app i’ve ever bought

earnest phoenix
#

how do I print out time after the persons typing the command timezone?

verbal night
#

I'm pretty sure you can't get someone's timezone when it comes to discord bots, i could be wrong though

sturdy mortar
#

Can I advertise?

verbal night
#

probably not 🤷

sturdy mortar
earnest phoenix
#

rip, then I gotta make them have to choose timezone?

verbal night
#

@sturdy mortar

  1. No self promotion / advertising including but not limited to:
    a. Server invites (providing official Discord guild invites or bot support guild invites when asked for is allowed), these can be in the guild or in DMs.
    b. YouTube/streams
    c. Begging people to use your bot
#

@earnest phoenix yup

earnest phoenix
#

ok

#

thx mate

sturdy mortar
#

I don't even know how to code my two bots i made.

earnest phoenix
#

how have you made two bots then?

verbal night
#

I was about to ask that

earnest phoenix
#

2 bot accounts mmLol

verbal night
#

....i had to re-read his message a few times first because i had to find some sense in it xD

earnest phoenix
#

-bots @sturdy mortar

gilded plankBOT
#
Vunction Potato#3109
Bots

@night idol
@frigid hatch

earnest phoenix
#

they’re just empty bots then

#

why dows it only pop up numbers as id?

#

no code or anything

#

and not names ?

static bramble
#

why would you advertise an empty bot

earnest phoenix
#

-bots @earnest phoenix

gilded plankBOT
#
Indrit#1621
Bots

@rapid roost
@green dune

earnest phoenix
restive silo
#

please dont use luca commands in here

#

thanks

earnest phoenix
#

oh ok

#

srry

#

@sturdy mortar what languages do you know?

#

english? XD

static bramble
#

boi

earnest phoenix
#

French

quiet bobcat
#

Also, up there it shows ids because discord loads on demand now and it doesn't work for tags in embeds as far as I'm aware of

sand roost
#

What am I doing wrong? ```js
client.guilds.get("439866052684283905").channels.get("439874502520864769").send("Bot added to the queue" + req.params.id);

#

getting no message

restive silo
#

you know that you can use client.channels right 👀

topaz fjord
#

@restive silo ur weeb

sand roost
#

@restive silo oh lol

restive silo
#

@sand roost also you should catch if the Promise rejects since that could happen due a lack of permissions

sand roost
#

its a server specific bot 👀 @restive silo

restive silo
#

still

#

good practise AngeryBOYE

topaz fjord
#

Practise @restive silo

#

English

restive silo
#

could you stop

#

kthx

#

this isn't general

topaz fjord
#

Ok

restive silo
topaz fjord
#

Let's take this to general

manic salmon
#

my bot at random times, even when not being used (having someone send commands, dm it, or try to interact with it in general), will send me this: `events.js:183
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at TLSWrap.onread (net.js:615:25)
`

#

am i just stupid

knotty steeple
#

interaction with the bot causes that error?

#

if so then Thonk

ruby dust
#

it has to be a specific reason

#

if you show your code people might see the issue

knotty steeple
#

but that error is for connection

#

i think

ruby dust
#

well im not js so idk

#

¯_(ツ)_/¯

trim plinth
#

that usually happens when your internet connection kicks the bucket

knotty steeple
#

yea

#

sometimes i get this also

Error: getaddrinfo ENOTFOUND discordapp.com discordapp.com:443
at errnoException (dns.js:53:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)
elder rapids
#

Because Discord

#

You know how many times my bot's connection gets randomly closed

trim plinth
#

that's Discord being Discord GWllentShibeWink

knotty steeple
#

so @manic salmon get better internet

trim plinth
#

no

#

just make sure your connection doesn't break

manic salmon
#

it doesnt

trim plinth
#

or make sure your internet isn't being dumb

elder rapids
#

Discord will always break your connection bloblul

manic salmon
#

internet companys screwing me over? who ever heard of such a thing

trim plinth
manic salmon
#

how can i make it not do that though

ruby dust
#

you mean isp?

#

are you hosting on your computer?

manic salmon
#

yes

ruby dust
#

you could get yourself a vps and host there instead

elder rapids
#

Trust me ECONNRESET is because Discord Thonk

manic salmon
#

i cant find any free ones and i dont want to pay money for a side project

ruby dust
#

use skysilk, they are currently in beta testing with 100% discount, and there will also be a free plan once beta will be closed

#

and it's also a legit vps, not something like heroku

trim plinth
#

cough cough don't use glitch cough cough

ruby dust
#

yeah, blacklist heroku and glitch by default

elder rapids
#

Did you know about 90% of the developers here program bots as a side project (and they still pay)

topaz fjord
#

@ruby dust >beta testing

#

100% free

#

tf

ruby dust
#

yes

uncut slate
#

that sounds sketchy as fuck

topaz fjord
#

thats pretty cool

#

and sketchy

ruby dust
#

any plan you choose will grant you 100% discount

uncut slate
#

I wouldn't trust your bot token with a "free host"

topaz fjord
#

how get profit????

elder rapids
#

You'll end up with the guy that had 20 bots "hacked" then :^)

ruby dust
#

it's not free, it's a new vps so they are in beta testing for now

elder rapids
#

Forgot who they were lmao

trim plinth
#

that was ipad + he had a public vps

elder rapids
#

oh yeah

topaz fjord
#

ipad

#

wut

trim plinth
#

Public VPS !== Free Hosting

ruby dust
trim plinth
#

sketchy stuffos

trim saddle
#

y'all dissin heroku >:L

trim plinth
#

maybe

knotty steeple
#

i sent an application for hyperhost 👀

trim plinth
#

hyperhost Thonk

manic salmon
#

thanks

knotty steeple
#

they have a free vps section

trim plinth
#

hm

knotty steeple
#

seems sketchy tho

topaz fjord
#

Rule 1. Never trust something thats free

#

unless its good food

trim saddle
#

has heroku ever used your tokens?

knotty steeple
ruby dust
#

sigh

trim plinth
#

"I'm not trusting this textbook. It was given to me by the school for free" bloblul

knotty steeple
#

xd

elder rapids
#

That site looks sketchy as fuck

knotty steeple
#

i know

ruby dust
elder rapids
#

Tf it's a ukraine site

manic salmon
#

why do people always shit on ukrainian and russian websites

#

smh

trim plinth
#

SkyPoints GWchadMEGATHINK

manic salmon
#

they host it their so they dont get shut down

#

there

topaz fjord
#

I can host in U.S and not get shutdown

ruby dust
trim plinth
#

Oof

manic salmon
#

because russias law enforcement is a bottle of vodka

#

ok

topaz fjord
#

then abide by the laws

#

its that simple

tardy hatch
#

Guys

#

It's possible to add for example:

#

help nsfw or cmds nsfw

#

?

shy verge
#

you need a system to fetch command metadata and search by alias

#

like with reflection

tardy hatch
#

xd

shy verge
#

depending on your lib this may be done for you

tardy hatch
#

i want to make this on python

#

async

shy verge
#

oof python

tardy hatch
#

:))

earnest phoenix
#

!ping

shy verge
#

lul

orchid horizon
tardy hatch
#

Yes

orchid horizon
#

How can I implement it?

earnest phoenix
#

my bot continues to crash. I don'tknow how to get the error

trim saddle
#

@earnest phoenix discords fucking up rn

earnest phoenix
#

Ok

#

so its not just my bot?

junior lily
prime cliff
#

No its not your bot everyone else is having issues

junior lily
#

is that even allowed?

prime cliff
#

Crypto miner on bot page 👀

junior lily
#

yea

#

allowed or nah?

#

not sure

prime cliff
#

No popup comes up for me?

trim plinth
#

who uses a bot page for a crypto-miner GWqlabsThonkery

junior lily
#

its an extension that says it

prime cliff
#

@languid dragon ^

junior lily
#

ban?

languid dragon
#

what

junior lily
#

crypto miner on bot page

prime cliff
languid dragon
#

@bitter sundial ^

bitter sundial
#

yes

#

I got DMed already

languid dragon
#

mk

tardy hatch
#

Guys

#

Why don t work

#

When anyone join in server

#

Bot don t send message

trim plinth
#

ok

#

oh boi

#

nice meme

knotty steeple
#

he pinged ken

tardy hatch
#
@bot.event
async def on_member_join(member):
    await member.say("Welcome!")```
#

Is okay this?

#

Or

trim plinth
#

why are you making the member talk Thonk

#

you would make the bot talk

#

and say welcome

tardy hatch
#

Oh

#

Ffs

#

Me noob

#
@bot.event
async def on_member_join(member):
    await bot.say("Welcome!")```
#

In this code

#

How can i make bot to tag member?

gilded blaze
#

So??

#

You are not getting spoon-fed

wanton walrus
#

Spoonfeeding just isn't happening

#

@earnest phoenix What language(s) do you use

ruby dust
#

lol

knotty steeple
tardy hatch
#

:)))))

wanton walrus
#

oml thats not what I meant

#

I give up

#

already

topaz fjord
#

what coding language

gilded blaze
#

Lol

knotty steeple
#

programming language 🤦

tardy hatch
#

@earnest phoenix what coding language

#

@earnest phoenix u can google it, ffs

wanton walrus
#

turkish

topaz fjord
#

why do you guys ping so many times

#

i think 1 is enough

gilded blaze
#

Wat

ruby dust
#

understandable, have a good day

gilded blaze
#

Learn a coding lang first

#

And there are many economy bots out there to use

#

JS

#

GG

knotty steeple
#

chalk Thonk

gilded blaze
#

Store economic data in SQLite db

wanton walrus
#

I love chalk

knotty steeple
#

you have config defined twice

topaz fjord
#

^

ruby dust
#

you aren't just gonna get a free code for your program, for that you only need the basic knowledge of your chosen programming language

gilded blaze
#

Wat

trim plinth
#

I like ansicolors over chalk

ruby dust
#

I think he is google translating everything

gilded blaze
#

Oh

trim plinth
#

¯_(ツ)_/¯

ruby dust
#

how old are you?

gilded blaze
#

How old are u

trim plinth
#

anybody know german around here GWbowsuBlobThinkOwO

gilded blaze
#

Lol

ruby dust
#

olol

#

lololo

knotty steeple
#

how old are you @earnest phoenix

wanton walrus
#

If you are under 13 you can get access to a special channel

knotty steeple
#

@earnest phoenix tell me

wanton walrus
#

oh

knotty steeple
#

lies

gilded blaze
#

LOL

junior lily
#

@trim plinth nah but I need to, it’s a requirement in my grade GWchadThonkery

knotty steeple
#

i dont believe

wanton walrus
#

^

trim plinth
#

Oof

wanton walrus
#

What is the capital of the US

ruby dust
#

unless he isn't english native speaker, I don't believe that 9 year old a single bit

wanton walrus
#

^

knotty steeple
#

^^

junior lily
#

@wanton walrus MeXiCo

wanton walrus
#

oOf

knotty steeple
#

ok this is getting out of hand

manic salmon
#

the capital is CanadA

knotty steeple
#

more of general talk

junior lily
#

Don’t give him the answer omg

trim plinth
#

wat

tardy hatch
#

Guys

knotty steeple
junior lily
#

nor english

tardy hatch
#

I have a question at python

gilded blaze
#

This guy is an expert

trim plinth
#

avoiding that question

tardy hatch
#

What s wrong in this code:

knotty steeple
#

software expert

manic salmon
#

exccough

knotty steeple
#

cant code basic discord bot in js

manic salmon
#

he is an ex-expert

ruby dust
#

software expert asking dumb questions about js like a kid Thonk

gilded blaze
#

Legit

junior lily
tardy hatch
#
@bot.event
async def on_member_join(member):
    await bot.say("Welcome")```
What is wrong in this code
knotty steeple
#

i dont know python so :/

tardy hatch
#

ik

#

im a little noob

junior lily
#

python ew

tardy hatch
#

😦

ruby dust
#

you didn't define where to post that message

knotty steeple
#

js best

junior lily
#

true

wanton walrus
#

*C# is the best

knotty steeple
#

pls

tardy hatch
#

@wanton walrus +1

gilded blaze
#

C++ ftw

trim plinth
#

If you were an "ex-expert", I doubt you'd forget so much to the point where'd you wouldn't remember any of your previous skill GWjustinHyperThink

junior lily
#

Why are you saying “error codes”? It’s triggering me

tardy hatch
#

@ruby dust how can i define it

knotty steeple
#

ads?

tardy hatch
#

Pls no ads.

junior lily
#

ads

wanton walrus
#

Social media means n o th i n g

manic salmon
#

dab for jesus

trim plinth
#

@junior lily hey mate I have some error codes to handle help me

#

:^)

ruby dust
#

define a channel where you want to post that message

junior lily
#

!ban @trim plinth

tardy hatch
#

Or what i need to edit in code

trim plinth
manic salmon
#

what company

tardy hatch
#

I want to send in general channel of servers lmao )))

manic salmon
#

what sectionc

#

because we can always see

#

😃

#

if its real

junior lily
#

@trim plinth I mean “error codes”... isn’t it error messages if it is anything? Or just fucking errors.

knotty steeple
#

@earnest phoenix what did you "code" as a "software expert"

topaz fjord
trim plinth
#

mmLol

#

I guess

#

I just refer to them as errors

junior lily
#

Tru

knotty steeple
#

@earnest phoenix answer my question >:(

ruby dust
#

I know that's not my bot and not my business, but this is against discord bot best practices, since it will do something that a server didn't intend to, especially if it's not togglable

wanton walrus
#

what

topaz fjord
#

tf

wanton walrus
#

what does that mean

gilded blaze
#

This guy is great

wanton walrus
#

^

#

is this a prank

knotty steeple
#

so python? @earnest phoenix

junior lily
#

@ruby dust oh yea true, he needs to give the user an option to enable/disable it or his app will get banned

ruby dust
#

not banned... that's a hard way to say it

gilded blaze
#

LOL

junior lily
#

Did You just seperate JavaScript?

trim plinth
#

where is this convo going

gilded blaze
#

He writes with his eyes closed

#

What a pro

wanton walrus
#

oml

#

LICENSE?

#

i have 100 points in javascript

#

am I a pro

junior lily
#

Lel

knotty steeple
#

@earnest phoenix ok then code a basic piece of code that returns something in console

wanton walrus
#

^

knotty steeple
#

should be ez pz

junior lily
#

del sys32

wanton walrus
#

And have it on a timeout for 30 seconds GWqlabsMmLol

trim plinth
#

Haha yes, I am a master Java Script master! I know all the details and I know that good shit! Like console.log!

wanton walrus
#

lmao

junior lily
#

@trim plinth same!

knotty steeple
#

@trim plinth no he has to figure it out himself

wanton walrus
#

what

trim plinth
#

uwotmate

wanton walrus
#

what does that mean

knotty steeple
#

i didnt ask for that

ruby dust
#

@south finch yes hello hi, this channel is getting out of control, and this @earnest phoenix guy is either just hard shitposting or is underaged

wanton walrus
#

or both

junior lily
#

Yea

knotty steeple
#

@earnest phoenix you really dont seem like your native language is english

#

and you are using google translate

topaz fjord
#

wtf

knotty steeple
#

???

topaz fjord
#

oops

south finch
#

👀

topaz fjord
#

this is dev

junior lily
#

Uh what?

knotty steeple
#

wat the fuck does that mean PLS

junior lily
#

that made no sence

#

sense

knotty steeple
#

yes lets get out of here

trim plinth
#

i'm just leaving this conversation

#

getting too shitposty

wanton walrus
#

belly on the name of what

#

oh forget it

ruby dust
#

lol

knotty steeple
#

@earnest phoenix wat i ask is for a basic piece of code that returns something in console

topaz fjord
#

do you use bing?

knotty steeple
#

yahoo?

south finch
#

Okay.

knotty steeple
#

yandex?

junior lily
#

Oh my..

wanton walrus
#

no, yandex translate GWqlabsMmLol

ruby dust
#

that was a good talk, gentlemen, you may now go to #general if you want to discuss something else

junior lily
#

Mmmm.

tardy hatch
#

Guys

#

AutoRole is possible on python?

gilded blaze
#

yes

earnest phoenix
#

so when anyone can could they help me

main isle
#

-bots

uncut slate
main isle
#

ty

night imp
#

Could also be caused by trying to run it on closed ports, loosing internet connection, running on multiple ports

earnest phoenix
#

but it doesn't always give me an error

#

sometimes it just crashes

night imp
#

Are you using a dedicated VPS?

earnest phoenix
#

no

#

I am using my pc

#

npm & node.js

night imp
#

Yeah that is probably why, you may want to ask your ISP about it but I recommended investing in a vps

earnest phoenix
#

whats an ISP?

#

and what's a VPS?

inner jewel
#

ISP - internet service provider - who selss your your internet
VPS - virtual private server - server someone hosts and rents to you, physical machine hosts several vps'es