#development
1 messages ยท Page 427 of 1
indeed
what line is it happening on
is it happening inside of the for loop or on the for loop
aha
@austere meadow simplehttpserver isn't asynchronous :/
im sure there is one that is async
that was just the first one i found on google
simplehttp is quite outaded and i still recommend this instead https://docs.python.org/3/library/http.server.html
since simplehttpserver got merged into that
Really installing more libraries isn't what I intended to do
๐
its pre installed with python
lmao
http server is pre installed with python 3.x
I think I will use a server side PHP script which forwards a discord webhook message
Yeah problem is it isn't always as easy as in node with python cos it needs to be async
does anyone know how to load an .eslintrc.json file into vscode-eslint
should load automatically
Didn't know about https://docs.python.org/3/library/http.server.html , thanks. 
is postgres better than MongoDB?
I used MongoDB in upgrading the database of my bot to tend to the sharding needs since sqlite is crap anyways
RethinkDB is best with sharding
i can't find any javascript econemy videos i tried doing discord-eco it brought up errors about installing it so and discord.js eco tutorials you know please tell me
@sinful lotus Postgres is the Strongest SQL DB from performance and outperforms a lot of NoSQL DBs like Rethink, Mongo aswell. It also has good Utility like NOSQL types (Array/JSON) as SQL DB.
It uses less Ram and storage than mongo, dunno about other tho
I dont know about much stuff on dbs. I honestly used mongoDB because its the one that worked. but frankly saying its much more better than an sqlite storage
databases that don't require a server instance > *
oh boi
you're not making an android app
an embedded database works for a bot, sure, but it's not very scalable
once you need to get into multiprocessing you're fucked with an embedded db
Who doesn't love naming their variables $ 
๐คข
xD
what world do you live in where $ isn't reserved for the language
J a v a
Dammt, lemme get my belt
The fun thing is that they use it for inner classes ๐ค
GET THE FUCK OVER HERE SUN
just no
$ isn't reserved in js either
Any inner classes compiled will get the name ClassName$InnerClassName and any anonymous classes will get the name ClassName$1 (1 changing depending on how many anonymous classes you have) so I don't understand why they haven't reserved it ๐
xD
guys
how can I run the bot
using multiple files
I took the command
and put it into another python file
and then imported it
but it keeps saying invalid syntax at the bot on the line
await bot.say("")
@buoyant oak You are probably using rewrite version of Discord.py, where bot.say is ctx.send. 
how do I prove that
oh
but the program functions
when it's apart of the main code
it's just too long
so I'm trying to split it
the whole thing
bot.command(pass_context=True)
async def deploy(ctx, target:str=None , Type:str=None, Quantity:int=None):
global userid
ID = ctx.message.author.id
userid = ID
ID23 = ctx.message.author.id
if Type != None:
Type = Type.lower()
if Type == "cruisemissile":
AUTHOR_NAME = ctx.message.author.name
AUTHOR_ID = ctx.message.author.id
Mention_Target = ctx.message.mentions[0]
ID_Target = ctx.message.raw_mentions[0]
Target_Username = Mention_Target.name
rand1 = random.randrange(0,2,1)
rand3 = random.randrange(0,3,1)
rand2 = random.randrange(1,10,1)
CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
if rand1 == 0:
CM_LAUNCH = CM_LAUNCH0
elif rand1 == 1:
CM_LAUNCH = CM_LAUNCH1
if rand3 == 0:
CM_STRIKE = CM_STRIKE0
elif rand3 == 1:
CM_STRIKE = CM_STRIKE1
elif rand3 == 2:
CM_STRIKE = CM_STRIKE2
LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
embed.set_image(url = CM_LAUNCH)
await bot.say(embed=embed)
on the
py -c print(__import__('discord').__version__) or pip show discord.py
codeblock please
that took a while
sec
Ill get u pip
Version: 0.16.12
@low rivet
@slender thistle
async
Aight, that's not rewrite. 
But why does that give you Invalid Syntax error, tho
still highlighted
Try copying this: await bot.say(embed=embed)
That's the magic of Python.
Invalid syntax
when I just copied it
^^^
it used to not read the command
so I changed it to just def no async, to test it.... and completely forgot about that
but ye
I reverted it to this
@bot.command(pass_context = True)
async def deploy(ctx, target, Type):
global userid
ID = ctx.message.author.id
userid = ID
ID23 = ctx.message.author.id
if Type != None:
Type = Type.lower()
if Type == "cruisemissile":
AUTHOR_NAME = ctx.message.author.name
AUTHOR_ID = ctx.message.author.id
Mention_Target = ctx.message.mentions[0]
ID_Target = ctx.message.raw_mentions[0]
Target_Username = Mention_Target.name
rand1 = random.randrange(0,2,1)
rand3 = random.randrange(0,3,1)
rand2 = random.randrange(1,10,1)
CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
if rand1 == 0:
CM_LAUNCH = CM_LAUNCH0
elif rand1 == 1:
CM_LAUNCH = CM_LAUNCH1
if rand3 == 0:
CM_STRIKE = CM_STRIKE0
elif rand3 == 1:
CM_STRIKE = CM_STRIKE1
elif rand3 == 2:
CM_STRIKE = CM_STRIKE2
LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
embed.set_image(url = CM_LAUNCH)
await bot.say(embed=embed)
but I get this
discord.ext.commands.errors.CommandNotFound: Command "deploy" is not found
Do you have something like:
def setup(bot):
bot.add_cog(x) # x is your class name
``` in the end?
Does that explain it?
i can't find any javascript econemy videos i tried doing discord-eco it brought up errors about installing it so and discord.js eco tutorials you know please tell me pelase help
how far have you already gotten with your bot? if it is your first time building a bot it may be better to start off with something smaller and work your way up.
And sorry, I dont know of any economy tutorials about javascript bots.
ok
so do you have a reliable database connected to your bot?
@slender thistle okay so I did what you told me
nope
def setup(bot):
bot.add_cog(War(bot))
like that right?
nice new profile picture btw :p
- Yeah, if your class name is
War. - Thanks.

- And what error did you get?
Command "deploy" not found?
yep it is war
class War():
class War():
@commands.command(pass_context = True)
async def deploy(ctx, target, Type):
global userid
ID23 = ctx.message.author.id
if Type != None:
Type = Type.lower()
if Type == "cruisemissile":
AUTHOR_NAME = ctx.message.author.name
AUTHOR_ID = ctx.message.author.id
Mention_Target = ctx.message.mentions[0]
ID_Target = ctx.message.raw_mentions[0]
Target_Username = Mention_Target.name
rand1 = random.randrange(0,2,1)
rand3 = random.randrange(0,3,1)
rand2 = random.randrange(1,10,1)
CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
if rand1 == 0:
CM_LAUNCH = CM_LAUNCH0
elif rand1 == 1:
CM_LAUNCH = CM_LAUNCH1
if rand3 == 0:
CM_STRIKE = CM_STRIKE0
elif rand3 == 1:
CM_STRIKE = CM_STRIKE1
elif rand3 == 2:
CM_STRIKE = CM_STRIKE2
LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
embed.set_image(url = CM_LAUNCH)
await bot.say(embed=embed)
it still saying
-deploy is not a command
Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "deploy" is not found
I have no ideas left, tbh.
I think that won't do. 
okay
aye thank you
@slender thistle
uhh
shouldn't the definitions
oh nvm
does it have to be def init(self,bot)}:
``__init __(self,bot):
__init__(self,bot):
Ignore that since you don't use self.bot.
but should the definition be inside of the class
cuz you have some functions outside the class
?
@sharp escarp if so, i would first suggest taking a look into working with databases
<@&304313580025544704>
You did not have to ping all of them ๐
oh sry
thought this would be easier
nope
Is it possible to have separate channels for each user? Like for example:
User: @Thebot#0000 Can you make an announcement?
Bot: Sure, what would you like the announcement to be?
User: @TheBot#0000 blah blah blah
And it can't overlap so when more than one user says this they would have separate results
Hi, I'm having an issue with an announcement command I'm making
@spring ember that's it?
can someone help me please
what...
just tell me what you need help with
i tried to create my bot but it says unable to fetch application
what language are you coding in?
coding...
yes, coding
Java ^^
are you sure?
javascript
html
I'm coding in json
Are you by any chance in the process of cloning another bot? ๐
discord.json
no
then what language are you coding in?
is there a library for basic
no...
would be brilliant to have bot run on basic
okay thank you
there is a library on Visual basic....
is there something for scratch?
no i will do basic thank you for answering my questions
im so lost
same
I think you are mistaken, no one answered your question(s)
can anyone tell me how to make how many servers my bot is in show up?
now it just says N/A
you must use the dbl api
Did you check #312614469819826177
so i have to include some stuff in my code?
@shrewd hedge I dont know if it helps or not, but get the id of the message by saying message.channel.id
discord.Object(id='453597268986298380')
and then where you see the numbers
put the channel id there
so it looks like
Are you sure they use Discord.py?
bot.send_message(discord.Object(id="45723894723894"), "announcement")
AHAHAHA
me
oh wait
what
Are you sure [TG] Tina the Cyclops#5861 uses Discord,py?
uh
I don't know, but I'm guessing its similar
you have to put it as an object
discord object
just saying thats what you need to look for
you can't say (ID, "announcement")
The argument is a channel name, so unless they use Discord.py, let someone else answer.
Let's not assume things unless we are sure what language they code in.
@slender thistle
so I found out
that you have to unload the extensions
right
but ehhhhhhh
await bot
NameError
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined
Where do you use it? In which part of code, I mean.
the await bot.say
in the imported module
the one that gets imported
it's raising that error
Are you importing from discord import bot?
Can you send me your code?
what would the reason be for my bot to post the wrong # of guilds as its watching status on its profile but it posts the right # of guilds when you run >stats
number as in number of guilds
oh ok
it posts 760 guilds but it should be 1510 (atm)
aye nice
Using two different methods of getting the guilds number?
iirc, js has guilds.size or something like that. 
Bot not being defined, hold on. 
okay
Removed parentheses from class War, you had written await bot.say (embed=embed) somewhere and removed your client variable since you don't use it.
bot.add_cog(War(bot))
TypeError: object() takes no parameters
Oh, and, of course, edited the latest line, which was bot.add_cog(War) before and which is bot.add_cog(War(bot)) now. :^)
my code
client.on('ready', () => {
console.log('Turned on the Discord client.');
console.log('Running on guilds now...')
client.shard.broadcastEval('this.guilds.size').then(results => {
client.user.setActivity(`>info | ${results.reduce((prev, val) => prev + val, 0)} guilds`, { type: 'WATCHING' })
})
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 800000);
});
stats command
if (message.content.startsWith(prefix + "stats")){
client.shard.broadcastEval('this.guilds.size').then(results => {
const clientStats = new Discord.RichEmbed()
.setColor(0xdf4b4b)
.addField("Supporting Guilds", `${results.reduce((prev, val) => prev + val, 0)}`, true)
return message.channel.send({embed: clientStats}).then(message => message.delete(120000))
})
.catch(console.error);
}
@buoyant oak What error? Still getting one?
yea
bot.add_cog(War(bot))
TypeError: object() takes no parameters
and if I remove (bot)
await bot.say(embed=embed)
NameError: name 'bot' is not defined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\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: NameError: name 'bot' is not defined
@slender thistle
@buoyant oak I use JavaScript
Guh...
oh
@buoyant oak Try defining bot under import's.
what do you want me to say
bot = commands.Bot(command_prefix='-')
??#
YO
ALEX JONES
IS JAMMING
anyways
bot = commands.Bot(command_prefix='-')
@slender thistle
??
Yeah, put that under the import things instead.
Ignoring exception in command deploy
Traceback (most recent call last):
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "C:\Users\YOUSEF\Desktop\CTE LEAGUE OF NATIONS\War.py", line 47, in deploy
await bot.say(embed=embed)
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 309, in _augmented_msg
msg = yield from coro
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\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 "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\http.py", line 200, in request
raise HTTPException(r, data)
discord.errors.HTTPException: UNAUTHORIZED (status code: 401): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\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: UNAUTHORIZED (status code: 401): 401: Unauthorized
O_O
but im the one who created you
unauthorized
rip
ooo
maybe
what
Well
The bot signs up under wrong token.
No idea how you managed to get 401 error code.
๐ฆ
huh
so in on_message
I did global bot
you don't have the permission to do something
what are you doing that triggers unauthorized
oh embed
text
What
Try removing the bot = commands.Bot line and retry.
It literally takes up to 1-2 minutes to memorize them. 
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined
raise CommandInvokeError(e) from e discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined
await bot.say(embed=embed) NameError: name 'bot' is not defined
discord gods, may you bless my soul for this very journey
Okay, I have no idea. If you define it in the same file, you have different instances. If you don't define, you can't use your bot. 
Heck's sake, I am useless at this.
T_T
quick tip
you don't need to init a new bot for everything
you can use something like
class Example:
def __init__(self, bot):
self.bot = bot
# Now we can reference `bot` as `self.bot`
Um my pokecord bot went offline in my server and idk how to bring it back :/
do you own the bot or is it someone else's
i dont think so maybe shard is offline 
Well I don't own it it's just in ma server
ok then you could ask in the support server
O ok thx
Anyone know anything about discord api redirects e.e
@worn sparrow when you authorize it goes to the first redirect url iirc
i remember a little from when i made my web dashboard
oh ok
and other stuff depending on the scopes you chose
async def on_message(message):
if message.channel.id == elite_general:
c = bot.get_channel(elite_trading_floor)
await c.send(message.clean_content)
are those the channel ID's?
just the title of the channel right?
elite_trading_flood
and elite_general
Then right click on a channel and press Copy ID
doing it
Don't do it like that
whats with d.js cache stuff
import discord
client = discord.Client()
@client.event
async def on_message(msg):
if msg.channel.id == ID:
c = client.get_channel(id2)
await c.send(message.clean_content)
Wow thank you IDK what i'd do without you @quasi marsh
Inconsistent use of capital letters please help me
Make sure that in that the first ID is the news channel
And the second is your main
Otherwise it'll copy everyone's message into your news channel
you.are.awesome!
And you don't want that
@quasi marsh hmm I have it but its not posting
do the channel id's need to have quotes around them?
that's what I have now
^
I can just close the command prompt and restart it correct?
yes
after I save the bot?
And yeah you'll need to have your PC running 24/7 if you want it to stay on
I would get a VPS if you want it to stay on 24/7
Recommend that ofc, but those are paid
Is the bot in your server?
Works now?
Hmm, try doing py -m pip install -U aiohttp
And try py -m pip uninstall discord.py
Maybe it's in conflict with the old one
discord 0.0.2 requires discord.py, which is not installed.
discord-rewrite 1.0.0 has requirement aiohttp<2.3.0,>=2.0.0, but you'll have aiohttp 3.3.1 which is incompatible.
Okay here
do py -m pip uninstall discord
thank you so much for your help
and py -m pip uninstall discord-rewrite
done
0.0.2
lol
py -m pip install -U git+https://github.com/Rapptz/discord.py@rewrite
This'll make sure you have rewrite
If that error happens again, follow Luke's advice, I personally have never seen it
OMG
it works
BOT WORKS
every7thing works
@delicate zephyr @quasi marsh
THANK YOU
X1000000
the last yarl thing got it
๐
amazing guys I can't thank you enough
now you said that I can run this bot on a server instead
google the error next time ๐
when using ytdl and d.js, is it possible to get the total queue time?
sry :p
How is a bot able to tell if a user is under the age of 13? I know Luca does this, and I was wondering where it grabs the information from.
๐

Luca is all knowing
not development related kthx
Via voice, and/or maturity speculation.
accurate?
#memes-and-media at this point
I wasn't shitposting, I was still on with the question
Yea but thats still not develope related
as someone mentioned already but you succesfully ignored
does a executed webhook trigger the message reception event ?
I mean, is a message sent using a webhook considered as a normal message and will my bot receive it as a created message?
what is the client secret for?
its for oauth2 stuff
i believe its there to prove that this application is yours and its not just an imposter
client secret is part of the oauth2 protocol yea
you need it to get the access and refresh tokens of an authorization code
import discord
import aiohttp
import asyncio
import json
class dbots:
def __init__(self, bot):
self.token = 'DESPACITO'
bot.loop.create_task(self.update_servers())
async def update_servers(self):
while True:
header = {
'Authorization': self.token,
'Content-Type': 'application/json'
}
async with aiohttp.ClientSession() as session:
async with session.post("https://discordbots.org/api/bots/{}/stats".format(bot.user.id), data='{{"server_count": {}}}'.format(len(bot.guilds)), headers=header) as r:
await asyncio.sleep(1800)
Well, that's just a part of code in my cog.
@slender thistle fucking legend
DESPACITO
๐
It worked?
yea
Tbf I did have to set it to 500 in postman to make sure it worked
never hurts to double check
๐
๐
Does anyone know why this happens:
events.js:188 [8/1951]
throw err;
^
Error: Unhandled "error" event. ([object Object])
at Client.emit (events.js:186:19)
at WebSocketConnection.onError (/home/theusaf/bot/node_modules/discord.js/s$
c/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/home/theusaf/bot/node_modules/discord.js/node_module$/ws/lib/event-target.js:128:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at _receiver.cleanup (/home/theusaf/bot/node_modules/discord.js/node_module$/ws/lib/websocket.js:211:14)
at Receiver.cleanup (/home/theusaf/bot/node_modules/discord.js/node_modules$ws/lib/receiver.js:557:13)
at WebSocket.finalize (/home/theusaf/bot/node_modules/discord.js/node_modul$s/ws/lib/websocket.js:206:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)```
and if there is any way to reconnect the bot when this error occurs?
Why not ask DAPI or DJS?
<@&304313580025544704> ((sorry for the ping )) if anyone is reviewing my bot it wont be online til tonight, the host is down
.
Okay so first of dont ping all mods, instead ping only 1 online
second we decline your bot only if its offline for 1 day (we invite it and if its offline we check back in a day) so you dont get a special treatment here in any way. @verbal zodiac
oh ok i was just letting u know
sorry for the ping
Yea but please dont ping all mods, that is quite pointless
i want to better my knowledge on classes in javascript, so say i have something that looks like this
module.exports = Class {
constructor(client) {
this.client = client;
}
async run(oldMember, newMember) {
this.client.setTimeout(this.destroy, 60000, oldMember.guild)
}
async destroy(guild) {
const player = await this.client.lavalink.get(guild.id);
}
}
this is basically what my VoiceStateUpdate event looks like (massively simplified), but on const player = await this.client.lavalink.get(guild.id);, this becomes undefined (Cannot read property 'client' of undefined). why is this, and how can i access this.client? do i just need to pass it through as an argument in the destroy function?
@austere meadow when you run this.client.setTimeout, this.client will call this.destroy
so, this will turn into this.client because this.client is calling it
three things you can do to fix that
- replace
thiswiththis.client
async destroy(guild) {
const player = await this.lavalink.get(guild.id);
}
- use an arrow function to prevent
thisfrom changing
async run(oldMember, newMember) {
this.client.setTimeout(() => this.destroy(), 60000, oldMember.guild);
}
- use .bind to prevent
thisfrom changing
async run(oldMember, newMember) {
this.client.setTimeout(this.destroy.bind(this), 60000, oldMember.guild);
}
oh true
60000 isn't too bad but at some point the zeroes get hard to keep track of
yeah i always forget you can use scientific notation

you can also use scientific notation
?
for discord.py what do you use for user input
wdym?
for bot commands
import a commands extention and start defining commands
np
could i post a conf file for a discord dialer bot and get input on what may be wrong?
Can I add commands for my bot?
Yes you can
thanks
i got this for github website
+-------------------------+
| |
| Discord API: https://discordapp.com/api/guilds/451573510700138508/widget.json
| |
+-+---------------------+-+
| |
| Discord messages: Welcome to DarkenedSpirits
| |
+-v---------------------v-+
| |
| node index.js (server): https://discordapp.com/widget?id=451573510700138508&theme=dark
| |
+-+---------------------+-+
| |
| WebSockets |
| | +------------------------+
+-v---------------------v-+ | |
| +---------> WebRTC-compatible |
| Browser (index.html) | | SIP server: bluedemon@sip.firertc.com
| https://discordapp.com/widget?id=451573510700138508&theme=dark |
+-+---------------------^-+ | |
| | +------------------------+
| Audio routing |
| |
+-v---------------------+-+
| |
| Discord client: 454058503716208641
| |
+-------------------------+
My bot's Commands are called ^^help^^reviews {user} and ^^news {user} for Popuko News-Bot
bad confuration?
I got my github too
just need approval for https://discordbots.org/bot/454058503716208641
thats a lot of whitespace man
i agree
twice every hour iirc
I don't know how to code but would like to have a discord dialer bot that's a bot
where can i find how to make my prefix configurable for server owners?
a database
store the prefixes in like a db or smth
every bot needs a database even simple ones 

well not a very very simple one
@earnest phoenix if i do that would I have to put all possible prefixes in the database? im using discord.js by the way
I still kinda new to the whole discord.js thing
no
and that prefix is changeable by admins+ or what you want
wait
would it be a table
@earnest phoenix you'd make a document, not a table
so for each guild your bot has, you'd insert a document into a table
oh.. I havent done that yet I will have to read up on that.. any docs I can go over?
depends what db you're using
sqlite3
INSERT INTO [table name] (columns) VALUES ([stuff]);
so they would all be TEXT NOT NULL correct?
lol
๐ค
not good with SQL
just refing off of mini docs I made for myself
for postgres
maybe if anything learn SQL before you use

^
example: INSERT INTO guilds (id, prefix) VALUES ('guild id', 'default prefix');
@earnest phoenix but I think it'd be VARCHAR
@earnest phoenix if you're trying to do commands, go to a testing channel
okey thanks
is there a guild.delete function?
Is there any method to get the total number of users (joining all guilds) in html?
@fleet epoch prob
discord.js?
okay, if you're using discord.js, yes it exists - https://owo.sh/a5210a.png
you have to be the owner
pretty much
Dangit
how is it useless
i dont think you would want someone who is not owner to delete ur server
its like that for a reason
selfbots used to be popular some time ago, yano
they had to get that juicy ass 100% api coverage badge
bots can still own guilds
yes that too but I would call that useless tbh
thats not useless
Its nice if you dont want to be in the guild cause you're taking a break testing stuff
in discord.py, is there a way to have the bot send the commands.errors as a message?
like if I get the command not found error, can I have the bot say the command doesn't exist
yes.. but why do that when you should silently fail, it gets annoying when im not trying to trigger a bot response and it says command not found
I'm just making a bot as a project to learn python. I'm not planning on joining any servers other than my own with it
alright, thanks
Tbh making a bot isnโt a smart idea for learning a coding lang
it's not my first
So I've been trying to use openshift but I'm unable to build the project from GitHub https://hastebin.com/usofazagev.vbs
If anyone could help
(BTW this is a failed build)
K?
In here
lets talk in a vc
?
I cant speak english :(
How old are ya?
Not i am not from english
Could you ask your question, if it is related to programming/coding?
Hmm 
Or else, move to #general or #memes-and-media.
pretty sure that is not correct
i wouldn't know, i dont have the code that sends the amount of bots, you should send the amount of bots via the dbl api
quick html question
how do I put text in there --> https://mrsheldon.me/images/005742.png
<body bgcolor="#7289DA">
<img src="https://mrsheldon.me/images/785375.gif" alt="" width="800" height="600" style="float: right;" />
</body>
Ermm, i wanna tell that my bot (Spidey, now it's in Queue) info on Discordbot list is future update. For now you can check old commands by using /help . I'll update it to -/help after all new commands done. The bot will have big update
@earnest phoenix did your dbl token get leaked 
Should i make that an environment variable?
require("imlib2")
local corner_a, corner_b, side = ...
assert(corner_a and corner_b and side, "Please provide 3 integer parameters")
local side_length = 500
im = imlib2.image.new(side_length, side_length)
local colors = {imlib2.color.YELLOW, imlib2.color.BLACK, imlib2.color.RED}
for x=0, side_length-1 do
for y=0, side_length-1 do
local a = corner_a + x*(side/side_length)
local b = corner_b + y*(side/side_length)
local c = math.floor(a^2 + b^2)
local color_index = 1 + c % #colors
im:draw_pixel(x, y, colors[color_index])
end
end
im:save("wallpaper.png")```
how do I put text in there --> https://mrsheldon.me/images/816342.png ?
css?
Does css cascade?
css=cascading style sheets
i know what it stands for, that's why I'm asking does it cascade?

learn html+css owo
sure, it cascades down the page 
hello .. i want to ask something problem.
i used : bot.user.setPresence({ game: { name: ${bot.users.size}, type: 0 } });
i want make the Presence changing every second.. I've tried with the function interval and timeout, but it does not work. Can anyone help me?
example :
Playing PUBG, after 2 second change to Playing Fortnite..
?
short answer, you cant
you will hit a rate-limit
you can only change your presence every 15 seconds iirc, and if you do that the whole time then this could be seen as API Abuse since you spam the api with request
Umm do you know what is rate limit?
your bot will get "rate limited"
thats not a command
@earnest phoenix https://en.wikipedia.org/wiki/Rate_limiting
if you wanna read it up
In computer networks, rate limiting is used to control the rate of traffic sent or received by a network interface controller and is used to prevent DoS attacks.
DoS attacks
yes
Hmm
spamming a server with tons of request to get it down is also called DoS
ohhh.. i dont know what is.. hehe
you may often see bots changing activity playing in status, I need to know his js command.
you can change your status but not every second
ok every minutes no prob
To put in simpler terms, when you create a bot, you make requests to discord api
Discord api doesn't want people to spam their servers
So they implemented a thing called "rate limit" where you can only make requests in moderation
For example, 5 requests every second
So like Yukine said for the presences endpoint, 1 request every 15 seconds
ohhhh ok i see, I understand... thank you for your all answer ๐
Sure thing
If I'm not wrong presence updates are once per 15sec
Yea thats what yukine said
Is it possible to shard some commands in discord.py?
I have a command who eats my ping like mad, preventing commands from being run quick.
wut
Either you shard the entire bot but if the command is resource intensive, you'll need to try and make it more efficient or abandon it
What is the problem? The bot works for about 1 minute, and then turns off and writes such an error.
(Node.js)
@earnest phoenix there's work arounds
Pls help.
??
Do npm update and see if it has the same error @cobalt ivy
Does DBL have a thread on stack overflow?
@tall falcon It's already been 2 minutes without problems.
@cobalt ivy Good
Problem with the API
node-v6.11.3-win-x64\node_modules\dblapi.js\src\index.js:79
async postStats(serverCount, shardId, shardCount) {
^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
It's weird looking at that without code blocks
Code :
bot.on('ready', () => {
setInterval(() => {
dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total);
}, 1800000);
});
weird
Code redirected :
async postStats(serverCount, shardId, shardCount) {
hm, weird
How do you add reactions to message sent by the bot? I want to add a reaction so when pressed the user can delete the message
Const's like this :
const Discord = require('discord.js')
const bot = new Discord.Client()
const DBL = require("dblapi.js");
const dbl = new DBL('You have really think I give you my token ๐', bot);
I store my tokens on github 
hmm how to specify a guild in JS?
so now if I forget them, I can ask microsoft to remind me
@halcyon torrent ask me
I store everyone's token on github
Store my token
@tall falcon Thank you! (+rep)
got it though, thank you.. client.guilds.get("guildid");
@oak smelt when you have it in a db you can access it in a programmatic way
Simply put you could have get all scores and filter by top
I think I might be asking my question too broadly. Here are two questions: 1) How does a bot grab that data and post it into discord? 2) is it possible for the data to look like the picture I posted with conditional formatting and all that jazz?
Hmm
or will a bot simply spew out the numbers as text and that is it?
@oak smelt are you trying to send an image?
or, are you trying to use canvas, for userinfo, ranks, etc
Right now I upkeep a google doc (sheet) which works well. My original hope was that I would like to embed the sheet into a channel that acts like a real time view of that page. Otherwise, it could also be a live link to an image that I overwrite.
Are there any guides to how canvas works more.. say, in depth? I've got some basics down (made a fancy welcome message one), but I'd like to see if theres things I could do like, saaaay... positioning, I dunno 
that made 0 sense to me
just google javascript canvas
positioning just takes two more args though does it not? or am i thinking of using canvas with html? @sick cloud

shh
I sense ken
u saw nothing
sniff* *sniff
Well if its image manipulation then you'll need to learn canvas and other image libraries
I am looking at that webpage right now....sorry....had a support phonecall come in
@oak smelt Basicly, you get data with script
With my DB it's like r.get('guild:ID:key').decode()
you could do like
x = []
try:
x.append(r.get('guild:264445053596991498:score').decode())
except AttributeError:
pass
if youโre tryna to make an image like other popular bots, then youโd need canvas, a database, and some knowledge
Say for example, your database is in json format, then you could define it, and do dataBase.id.whatever your trying to get
<@&304313580025544704> Sorry for the ping, but, Ermm, i wanna tell that my bot (Spidey, now it's in Queue) info on Discordbot list is future update. For now you can check old commands by using /help . I'll update it to -/help after all new commands done. The bot will have big update

"Sorry for the ping,"
okay
Sorry for the ping again
no
๐๐ฝ
@upper zodiac
- you don't have to ping the whole staff for anything unless it's urgent
- you don't have to ping anyone at all because we don't need to know if your bot is online or not
that's like going "@Mods I'm taking a shit! Sorry for the ping~"

๐

Nitro UwU
yep
@upper zodiac you dont need to ping us when your bot wents down btw
Nope my bot not went down
You guys want to verify bot before apprive it to list right
O.o
You can preview it btw
wow
Mayb you guys can check it after i updated the bot

I'll start developing the bot start from next week Tuesday
The bot now only have old commands
what has that to do with us now
we test your bot and approve it when it works we dont mind it having new features at all, rather tha just update your bots page and done
I remember my old experience approving bots on another list. bot devs get angery at times ._.
but trueeee
okay since this gets quite offtopic #general or #memes-and-media now
I updated the bot page info that's why i say to you guys that the commands on bot page info is still not available at this time
The bot page info is future update
oh thats fine aslong as your help commands shows the current commands

so just a quick question, with what character do i separate guild ids in the bot edit form, i cant figure it out
nevermind apperantly i needed a space after the comma
๐
In discord.js, how do you run code when the bot is pinged?
check on the message event if the Message#mentions collection contains the Client User
if (<message>.content.contains(`<@${<client>.user.id}>`) { /* ... */ }
.. or that
ยฏ_(ใ)_/ยฏ
thats what I use
oh :p
so js if(msg.isMentioned(bot.user)){} would work?
i asked before and ill probably get the same answer but how do you make a c!disable <command> command?
im using discord bot maker from steam.
what is this "disable" command supposed to do
so just say i went c!idiot @pearl schooner (a command)
and it worked
so you would do
c!disable idiot
then when you run the c!idiot command.. it says this command is disabled in this server
use some kind of database
doesnt it auto-add
You got to wait for a moderator to review and approve/deny it.
hm.
cant find it so it must not be here
ill try..
doubt it'll work.
yep, didnt work.
no the command..
new topic : im building a bot from the ground up..
what code is good for just a shell bot thing
nvm
shell bot?
is confused
Oh.. youre paying for discord bot maker.. rip
Free and easy to make your own bot do the same thing
@mental solstice im trying to use discord.js but i dont rlly know how
ok
these both guides will help you
but you should still have basic knowledge of Javascript
Yeah, i just started aswell. Got quite a bit done the last day or so.. there is an example of a connection.. also check out youtube tutorials.. nodejs discord bot or something
discord bot maker costs 7 pounds..
people complain that its too much.
but i mean its good for learners
for the tool, its worth it i think
Can anyone help we with discord oauth2 apps? Whenever I put in this url it gives me an unkown_error:
https://discordapp.com/oauth2/authorize?client_id=454689258016604160&scope=identify%20guilds&response_type=code&redirect_uri=https://gruppe6bot.com
Isnt scope supposed to be numerical?
they're not doing a bot
Oh. Was thinking permissions
i think the redirect uri...
Im helping him
how would you make ms in to dd/mm/ss format in d.js
moment maybe?
you could use moment or a lot of js maths
ok
moment-duration-format iirc
or literally 6 lines of code
that too
I keep getting errors for a new bot im making. The token is correct, but it doesn't seem to work:
UnhandledPromiseRejectionWarning: Error: Incorrect login details
were provided.```
So @earnest phoenix what do you need?
๐ค could we not solve it here?
I am looking a bot, which
- has levelling system
- uses Python
- is Open Sourced
any one know of any such bot that ifits the criteria?
you could look at the old mee6 source
(which is old and not updated, but it may give a example)
I went to their account, I didn't see any bot repo ๐ค I should check again
๐๐ฝ thanks a lot tilda
https://github.com/cookkkie/mee6/blob/master/chat-bot/plugins/levels.py is what you're looking for, np
m e e 6
anybody have code for an paged help command
like one with โ and โถ
@sand roost You have to use the event listener, and lets say the help message was an embed. You'd get the message through the reaction, get the embed title, and if it starts with "Commands" (for example) then you can use message.edit({RIchEmbed}) for the next set of commands
@grizzled isle Yeah ik but was looking if somebody could have given me the code so that I wouldnt have to recode that.
Anyone have a way in dart to generate an int excluding a number? like I am using new Random().nextInt(21) is there no other way than doing new Random().nextInt(20) + 1?
is it a specific number ?










