#development
1 messages Β· Page 609 of 1
If you cant find it just reboot, it will ensure all the processes are closed.
By it I mean the other process running your bot logic
I need some help.
My non-accepted bot is offline and its no longer online after restarting the bot and changing token and replaced it. Still offline, what to do.
does it log that it got online or not the code
It says that the ping recived to make it online 24/7 is recived.
no no no the bot itself
My Bot has loaded string to logs doesn't appear no more.
k.
where do u host?
imagine being luca
check dms
i gtg
just dm me the FILE: and what to change and ill do it tonight
Does someone know how to get the background on your bot card?
Feel free to ping me with a response 
@south sonnet its only for certified bots
Darn, any more info about that somewhere?
Can you suggest me a cheap VPS
Check pins π
Need vps which is all over the world
Like I am from india most of the vps do not suport here.

pretty sure OVH is all over the world
Confusion = max
Confusion lvl 101
@bright spear i was probably asleep by the time i was pinged, i don't know, probably just for extra measures, if you're on glitch, you do have a link to let other people see, if someone accesses that link and you don't have in an .env, they could probably see it right there
why my bot is outputing twice?
Hello, I am making a bot with JS where some letter are replaced but sentences between * or __ are exclude, but I can't find how to exclude the words
most likely because its running twice
no, thats not, i run it only per glitch, not per my pc or so
2 message listeners?
just run one program
because you're running two programs
you forced another instance to run, overlapping the first instance
but where?
how the hell are we supposed to know that
i've done it before
how i can know it?
ah, i chrashed it with my chrash cmd
i knew, it is a good idea to have a crash cmd
I'm also trying to exclude uppercase letter first and then translate them excludin lowercase letters
I need some help. my extensions won't load does anyone see something wrong here?
My avatar is not working
Python is ugly
if (message.content === `${prefix}avatar`) { message.reply(message.author.displayAvatarURL()); } });
Not work
Python is better than JS
in javascript how do i get a Map object to store an object and not return '[object Object]'
@pallid zinc displayAvatarURL is not a function
i found a workaround with JSON.stringify and JSON.parse so it sends and gets the object as a json string and parses it, but is there any other way?
@earnest phoenix print(e) on Exception
Please
Why do you assign it to a variable and never use it
Where?
I can see your load command delete ctx.message but you are not returning from that point and still trying to delete ctx.message again
Anywhere you load or unload an extension
So just remove the code ctx.message.delete()
Do you want the command invocation message to be deleted all the time?
I just need it to load my extensions, i was on the Python community hub and that is what they told me to put
I advice put return before that ctx.message.delete under your if chain
Like that?
Still doesn't load the Extensions..
@pallid zinc delete the ()
On displayAvatarURL
str(error)
I suggest reading more about python formatting, especially on 3.6+ versions
Your life will be easier if you use f-strings, honestly
How to make cooldown on commands :c
What lib
js
@pallid zinc if(message.content.startsWith(prefix + 'avatar' ) { message.reply(message.author.displayAvatarURL) } Use handler is better
Is patient
Welp, I'm of no help in js
I can see you're better with Python
Yep
I'm just waiting ahah
@earnest phoenix global cooldown or per command?
per
If its per command you need to export cooldown on every command (with handler)
https://discordjs.guide/command-handling/adding-features.html i use that for my bot and its nice @earnest phoenix
A guide made by the community of discord.js for its users.
wht
?
ok
I'm losing my marbles, all i need is for my extensions to load but i can't work out why they won't
What errors are you currently getting?
does anyone know the code for making the bot listen when you @ it
I think i found it
@wheat orbit depends on your library
Honestly, a bot mention is literally just <@bot_id> or <@!bot_id> if it has a nickname
@!
Well fuck, my bad
It's ok I had to check
Okay so I managed for uppercases and lower cases now I'm trying to find out how to exclude sentences between * and __
Constantly getting this and i can't figure out why they won't load
I can't help without any traceback, and you are not outputting any
@bot.command(pass_context = True)
async def load(ctx):
user_roles = [r.name.lower() for r in ctx.message.author.roles]
if "bot developer" not in user_roles:
await ctx.send("You do not have permission to do that!")
return ctx.message.delete()
await ctx.message.delete()
for extension in extensions:
try:
bot.load_extension("\cogs"+extensions)
except Exception as error:
await ctx.send(extension + "could not be loaded...\n" +error)
print(extension + " could not be loaded...")
print(error)
@bot.command(pass_context = True)
async def unload(ctx):
user_roles = [r.name.lower() for r in ctx.message.author.roles]
if "bot developer" not in user_roles:
await ctx.send("You do not have permission to do that!")
return ctx.message.delete()
await ctx.message.delete()
for extension in extensions:
try:
bot.unload_extension("\cogs"+extensions)
except Exception as error:
print(extension + " could not be unloaded...")
print(error)
for extension in extensions:
try:
bot.load_extension("\cogs"+extensions)
except Exception as error:
print(extension + " could not be loaded...")```
The one on the very bottom
don't use role names for permission checks
the issue isn't whether or not it works, the issue is anyone being able to run the commands
It just doesn't load the external files Extensions
The command can run it just doesn't load at start in which it should
And if the bot won't run it at start it throws a error when using the command
Ignoring exception in command load:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\extensions\main.py", line 56, in load
bot.load_extension("\cogs"+extensions)
TypeError: can only concatenate str (not "list") to str
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 63, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Administrator\Desktop\extensions\main.py", line 58, in load
await ctx.send(extension + "could not be loaded...\n" +error)
TypeError: can only concatenate str (not "TypeError") to str
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 860, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 698, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 72, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: can only concatenate str (not "TypeError") to str```
for extension in extensions:
bot.load_extension("\cogs"+extensions)
How can I get the innerHTML of the h1 using jQuery/cheerio?html <div id="info"> <h1>Hello</h1> </div>
Is there a list of Discord bot best practices you would recommend?
@vague coral https://github.com/meew0/discord-bot-best-practices
@opaque eagle Just what I was after. Cheers!
Np
@slender thistle Could you map out the Data for me, as I am struggling with this.
Sorry for ping
Literally +str(error) instead of error and there, you will get an actual error
Gives me the same error as before
Send your code
@bot.command(pass_context = True)
async def load(ctx):
user_roles = [r.name.lower() for r in ctx.message.author.roles]
if "bot developer" not in user_roles:
await ctx.send("You do not have permission to do that!")
return ctx.message.delete()
await ctx.message.delete()
for extension in extensions:
try:
bot.load_extension("cogs"+extensions)
except Exception as error:
await ctx.send(extension + "could not be loaded...\n" +error)
print(extension + " could not be loaded...")
print +str(error)
@bot.command(pass_context = True)
async def unload(ctx):
user_roles = [r.name.lower() for r in ctx.message.author.roles]
if "bot developer" not in user_roles:
await ctx.send("You do not have permission to do that!")
return ctx.message.delete()
await ctx.message.delete()
for extension in extensions:
try:
bot.unload_extension("cogs"+extensions)
except Exception as error:
print(extension + " could not be unloaded...")
print +str(error)
for extension in extensions:
try:
bot.load_extension("\cogs"+extensions)
except Exception as error:
print(extension + " could not be loaded...")```
I know a fair bit, but extensions is all new to me
This is basic Python
What you did isn't related to extensions
When I mentioned str(error), I meant to put it in your await ctx.send etc but not prints
I'll leave it for another day
i've seen some successfully change the website background on discordbots bot page, how is this done?
can anyone tell me what do i need to use to Enable/Disable a command (Discordjs)
since i want to add chat filter, but i need a way for the owners/admins of the guilds to enable/disable it
/* */ 
alternatively make a .json filke
file
and call it smth smth disabledcommands
with like
{ "DiscordServerID" :
{ "bannedcommand1", "bannedcommand2", "bannedcommandN" },
"DiscordServerID2" : { "bannedcommand1", "bannedcommand2", "bannedcommandN" } }
then u can read the json files
and check if there's a matching discordserver in that list
and if it contains the bannedcommand
its as simple as that
thanks i will try it
no probs ^^
oh also encapsule the bannedcommands in []
cause {} will give errors (it need key values to use that)
yes
and it will change the appearance
np
why am i getting cs.set() is not a function when it obviously is
class cs {
constructor(host, auth) {
this.auth = auth
this.host = host
}
async set(key, value) {
const a = await w(`${this.host}/${key}`, { method: 'POST' })
.header({ 'content': value })
.header({ 'Authorization': this.auth })
.send();
return a.parse()
}
}
module.exports.cs = cs```
i create the object and use
cs.set('asd', JSON.stringify({a: 1, b:1}))```
and thats when it throws the issue
did u just copy it
yes
no not like that
this.thing = function() {
// e
}```
then idk
You are referencing that function as though it is static, but it is not static
I am not a javascript guy by any stretch of the imagination, but thats what it looks like at first glance.
@mossy vine
You need to make an instance of that class.
named the same as the class?
if the variable is named the same as the class, it could think that you are trying to call the method directly from the class statically
Is there a ratelimit for editing a voice channel's name?
I can't find one on discord's official page, but perhaps there's one hidden, idk
there's a ratelimit for every endpoint
^
ratelimits arent really published since
they could be changed at any time, really
yeah, the docs tell you that you should refer to ratelimits returned in the request headers
theoretically they could temporarily increase the ratelimits if discord was under high stress
I see
let me check the ratelimit as it is rn though
I'm using a VC to count how many messages are sent by my bot
so should I make it count internally, then push an edit once a minute, to stay safe?
yup
yeah, that would be a+
You can just use like, a queue or something
might look dumb but I'm trying to give a role when you mention someone but I have an error.
client.on('message', msg => {
if (msg.content === config.prefix + 'give') {
let member = msg.mentions.members.first();
member.addRole(msg.guild.roles.find(test)).catch(console.error);
msg.reply('gave the role.')
}
});```
I get this error
```Cannot read property 'addRole' of undefined```
you shouldnt even be getting to that point wtf
To that point?
your code shouldnt enter that part
you are checking exactly for "prefixgive"
so if you type
prefixgive @short folio
it shouldnt be doing anything
as you are checking for exact message content
not if it begins with
therefore there is no "first mention" in the message
therefore member is undefined
Ooh okay
even with startWith it doesn't seems to work 
I get the same error, I'm maybe wrong somewhere oof
I tried using what the js guide give but when I do my command I get no error but no response from the bot either?
client.on('message', msg => {
if (msg.content.startsWith === config.prefix + 'give') {
const role = msg.guild.roles.find(test);
const member = msg.mentions.members.first();
member.addRole(role);
msg.reply('gave the role.')
}
});```
oof
I'm sorry
I read it wrong I guess lmao
It worked
Thank you for helping me >~<

not user joining but my bot
guildadd event?
oof yeah my bad
@slim heart Dude can you edit for me on web plz, sorry π
wut
ur asking me to do it for u?
yes, can you this?
i dont do that for free, sorry. You need to learn it yourself, if you're noob then become not noob lol
or you can start here https://discord.js.org/#/ or #502193464054644737
oh, ty dude β€
We need a website to activate OAuth ? I never use it ? How to install it ? Someone have a tutorial ? Thanks for answer and please ping me
you... dont install-
there's so many things wrong with that i-
oauth is a login system
Where can I type css button scripts?
What error
Are you using multiple files?
mean ?
sample: click the button = go to youtube.com/channel/example
That's not css
I would recommend instead of a button use <a href="Link"></a>
Yes you can't
why not put an anchor in a button
Well I'm off to bed good luck
not really
why
busy
np
@earnest phoenix go to sololearn.com or w3schools.
okay
Its also hard to understand your problem if you dont post code.
what is the CSS access for the container in discordbots user page
its not .content apparently
is 100seconds long enough delay between an autochanging status?
Yes
function changing_status() {
setInterval(async () => {
const statuslist = [
``
];
const random = Math.floor(Math.random() * statuslist.length);
try {
await bot.user.setPresence({
game: {
name: `${statuslist[random]}`,
type: "PLAYING"
},
status: "online"
});
} catch (error) {
console.error(error);
}
}, 100000);
}
bot.on("ready", async ready => {
console.log(`${bot.user.username} is online!`)
setInterval(changing_status, 100000);
})```
This is setup correct? Just double checking
I don't know d.js, but I guess try it and see?
someone help me, I can not find the invite link from my bot
hi
Hey so can someone help me, I have a command that pulls an image from a sub reddit but the image dosent load at all, but the command runs fine.
(themonia) it depends on what permissions it needs
Here's said code for the command.
https://pastebin.com/a26vyhhj
Wait don't worry, it works now ;-;
use this to generate a link https://discordapi.com/permissions.html
finally got the storage issues i was having with my bot fixed
i was using keyv before but that was buggy and kept erasing all user data so i had to rewrite all of the commands involving storage using sequelize
so i'm trying to use vps but every time i try to run my files this is what i get
can anyone help me solve this problem (i'm using ubuntu 16.04)
thanks
can the bot see a member's active voice client if it doesn't have permission to see the channel that member is connected to?
condition1 or condition2
oh i thought it was ||
sorry
but i need help with something else..
gbyters@Gbyters:~/programming/python/dictionary_attack/md5$ python3 main.py
Ready or custom? (r/c): r
MD5 hash: 5f4dcc3b5aa765d61d8327deb882cf99
Traceback (most recent call last):
File "main.py", line 10, in crackhash
md5_f = open(md5_f, 'r')
UnboundLocalError: local variable 'md5_f' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 36, in <module>
crackhash()
File "main.py", line 13, in crackhash
print("%s: No such file" % md5_f)
UnboundLocalError: local variable 'md5_f' referenced before assignment
gbyters@Gbyters:~/programming/python/dictionary_attack/md5$
Send code
oh
https://hasteb.in/xafadume.py
error:
File "main.py", line 12
except:
^
TabError: inconsistent use of tabs and spaces in indentation
@spring ember
Using tabs and spaces at the same time
?
Go through your indents and see where you put a tab/space instead of the other one
is vim better?
Can't you get an IDE
IDE is not a text editor
- nah i want a text editor on my terminal its way faster to edit a file there
Gl coding in Python using nano/vim
how do you ban by ID in discord.js?
cant i just use a text editor for pything..
so when i'm using my vps to host my bot the terminal closes every few hours which stops my bot. How can i make it to work without stopping?
@dull bobcat Finding where you fuck up your indentation with a text editor takes more time
sorry.. damn
Either go through your indents, delete them and see where you went inconsistent or get an IDE and use it instead
i dont understand why im getting so many issues here, wtf is the problem?
"option" is a second condition
So is "ready" in your first if
(option == "r") or ("ready") is what you are doing
main.py :: https://hasteb.in/azeracet.py
rcrack.py :: https://hasteb.in/uquviqir.py
ccrack.py :: https://hasteb.in/keparomo.py
issue :: No error, but the code does not work as it's supposed to at all, it doesn't respond to the else statement in the main file and keeps executing the crack function no matter what the input is which is not supposed to happen, and when i type c it still runs the rcrack function instead for some reason.......... help?
@dull bobcat Iβm pretty sure he just answered you
@slim heart Nah the answer was wrong
Not really but ok
Two ways of doing that
Yeah and im thankful π
Yea i did, to the solution ^
He didnβt give u a solution u kinda just ignored the problem he pointed out which couldβve lead to your solution 20 minutes later lol
r == 1 or r == 2 or r in [1, 2] (can use a tuple, whatever)
I need some help with my purge command
i want my purge message to work but it doesnt
because when i delete messages with the command it just sends deleted 15 messages when i do ?purge 15 but i want it to send the number of messages it did delete not what i entered
@commands.command()
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount: int=None):
if not amount:
await ctx.send('Please enter a valid number')
else:
await ctx.channel.purge(limit=amount + 1)
await ctx.send('Deleted {} message(s)'.format())
await ctx.send('Deleted {} message(s)'.format()) Why are the params empty in format
Returns
The list of messages that were deleted.
Put that purge in a variable and use len() on it
is there a way to set up rewards for voting in python?
and if so how would you do it?
that's a rather broad question
you should specify more on what kinda rewards and how they vote
so when someone votes for the bot using https://discordbots.org/bot/569891302729318401, i want the bot to add x ammount to a list. how do i get the bot to know when and who upvotes the bot?
preferably using discord.py
Why dosent discord use c#
because c# is too cool to be used
@spring surge A separate script or preferably a cog for your bot?
wdym by a cog?
Separate extension with a class to sort your commands
Cogs are classes within extensions which are separate files from your main one
Either way, check this out https://github.com/shivaco/DBL-python-webhook
Flask script mainly to handle POST requests from discordbots.org - shivaco/DBL-python-webhook
I need some help with my purge command
i want my purge message to work but it doesnt
because when i delete messages with the command it just sends deleted 15 messages when i do ?purge 15 but i want it to send the number of messages it did delete not what i entered
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount: int=None):
if not amount:
await ctx.send('Please enter a valid number')
else:
await ctx.channel.purge(limit=amount + 1)
await ctx.send('Deleted {} message(s)'.format())```
format is empty because i dont know what to put in
i want it so say how many messages the bot deleted not the amount i said
Did you even understand what I said to you
I never mentioned using amount to show how many messages you deleted
Make your purge a variable and in .format, use len() on your purge
so purge = WHAT
deleted_messages = purge etc
send("blah blah {}".format(len(deleted_messages)))
Basic Python and reading docs btw
got it
Can someone can help me with OAuth2 ?
i want to use Guilds.join but i dont know how
i make a Node.js web server
oauth2 is an invite link
redirect them to the authorization menu, when they're done authorizing they'll be redirected back to your website with a code, use that code to exchange for an access token, you'll use that token in the Authorization headers for your requests now, e.g Bearer accesstoken
But how to get the code with that kind of link ? and how to use it after ?
@earnest phoenix Please ping me if you answer
i told you
your user will be redirected back to your website
except the url will now have a ?code= parameter
Yeah but how with a node.js server get the token and use it for example guilds.join
const https = require('https');
const express = require('express');
const app = express();
const port = 3000;
const clientId = '545651085239386143';
const redirectUri = '';
const clientSecret = 'censored';
const grantType = '';
app.get('/', (req, res) => {
let authorizationCode = req.query.code;
// Faut faire une requete a cet url
let requestUrl = `https://discordapp.com/api/oauth2/token?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&client_secret=${clientSecret}&code=${authorizationCode }&grant_type=${grantType}`;
https.post(requestUrl, (resp) => {
let data = '';
// A chunk of data has been recieved.
resp.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
let auth = JSON.parse(data);
// Et la, t'as auth.token_type et auth.access_token de dispo pour faire tes requetes en tant que l'utilisateur
});
});
});
app.listen(3000);
This work @earnest phoenix
?
i dont know i dont do node
π’
How do I make the user get redirected to the bot's website after inviting the bot
https://discordapp.com/api/oauth2/authorize?client_id=495496088510529556&permissions=8&scope=bot&redirect_uri=https%3A%2F%2Fantiowo.xyz
I've come up with this, but it does not work
what really
Beacause Discord host Bot adding but not redirect
if you use redirect you are using OAuth2 and OAuth2 is LIKE A BOSS YOU CANT BEAT BUT THERE YOU CAN'T UNDERSTAND
Sorry
Uuuhhh, you alright there bud?
i spend my day to watch tutorials and desesperate to understand OAuth2
do you guys know how to set all values in a Map. for example, let's say i have a list of checkmarks mapped with a string, boolean
and i want to set all values to false using Map.set prototype
you can use a forEach on Map?
yes
very interesting let me try that...
i'm making an app in React + Redux
vc Γ© brasileiro? π
sim
tΓ‘ muito bem ^^
e eu achei q vc tava falando de java kkk
n sei js n
mas acho que da pra vc fazer
tipo
Objects.keySet(map)
e dai iterar todas as chaves
Objects.keySet(map).forEach(key => map.set(key, false))
dnd
tΓ΄ aprendendo portuguΓ©s do Brasil π
Γ© de portugal?
nao eu gosto do brasil :3
ah blz
brasil is the bessst
ss
kkk

hey @queen violet me diz que Objects is not defined quando uso Objects.keySet(map).forEach(key => map.set(key, false))
ohh! funciona. tenho que usar Objects.keys no Javascipt
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));```
worth adding?
i have no idea Eto π
maybe it's good to put it because of debugging
hey guys quick question. i'm wondering why none of these value become false when I perform this code:
const myMap = new Map()
myMap.set("banana", true)
myMap.set("apple", true)
Object.keys(myMap).forEach(key => {myMap.set(key, false)})
console.log(myMap.get("banana")) // returns true but should return false
Hey, how do i get someones discrim, I forgot, I can get there username, but want to get the discrim.
code: https://pastebin.com/m965cDKV
Object.keys apparently doesnt work on maps
but you can do <map>.forEach((value,key) => { ... })
i got the solution:
const myMap = new Map();
myMap.set("banana", true);
myMap.set("apple", true);
[...myMap.keys()].forEach(key => {
myMap.set(key, false);
})
console.log(myMap.get("banana")) // returns false
console.log(myMap.get("apple")) // returns false
that looks kinda stupid, i have no idea if thats efficient or not tho
using forEach directly on the map should be better i think
> m
Map {}
> m.set("a", 123)
Map { 'a' => 123 }
> m.forEach((_, k) => m.set(k, false))
undefined
> m
Map { 'a' => false }```
if only I knew how to map in python
can someone help me, I got my bot to log the roleCreate event, but I'm stuck on how I grab the role name
bot.on('roleCreate', async (message) => {
const logs = message.guild.channels.find(ch => ch.name === 'logs');
if (!logs) return console.log("Can't find logs channel.");
const entry = await message.guild.fetchAuditLogs({
type: 'ROLE_CREATE'
}).then(audit => audit.entries.first())
let user;
user = entry.executor.username
logs.send(`Role: role.name was just created!`);
})```
roleCreate doesnt pass a message
roleCreate doesnt return a message
it's a role
you have a role named message right now
bot.on('roleCreate', role => console.log(role.name)) would give you the roles name
How would I go about getting the role name sent to a channel?
get a channel somehow and then .send()
role.guild is the guild that the role is in so you can pick a channel from there however you like
ayyy
YouTube have that
thx
im making mine for rp and levels ;p
Ohhj
but ill hold it off for now
You need to code it
db is needed
{ message.channel.send({ embed:
{ title: `${message.author.avatarURL}'s Profile Picture.`,
image: { url: message.author.avatarURL },
color: "RANDOM" } }) }; ```
Not working with RANDOM color
${bot.users.size}
Tell wrong
It's show 374 member but I have 900+ member
@pallid zinc it doesn't count duplicates
so if i add the bot to 100 guilds but all the users are the same it will have very little users
No duplicates
it's also cached users
o yea that too
@pallid zinc if you want true member size, iterate through all the guilds and add their membercount
^ But that could contain duplicates 
It's ok
Is it ok or looks ugly?
looks bad english
Lol
Activate windows 
π π
I am JavaScript
@latent oasis the animation looks smooth good job
now do that again without using a library
imo using a library isnt bad if the end product looks good as a result
yeah but if you do it without a library you're showing that your skill set is good
specially if its a website about your own work
yeah thats true
Tim ik, but I'm just getting into webdeveloping
await ctx.send(text)
time.sleep(2)
await ctx.text.purge(text)```
i just ask what am i doing wrong
oof
ctx.text?
Also, don't use time.sleep
Are you doing purge twice
Send your full command
dm
pleas how to add my bot
π€¦
Can I apply Rich Presence to bots?
Guys if i use ${client.emojis.get("572030198124511243")} code, it says "undefined"
JavaScript
Make sure that's the actual ID of the emoji
what if you use the emoji name also 
It's better if you do this, so we can make sure that the emoji exists. js const emoji = client.emojis.get("572030198124511243"); console.log(emoji);
okay
dumb me
why are you getting the emoji
@velvet chasm No
owner list?
const online = client.emojis.get("572030353146118174");
c.send(`${online}`)
Discord Server Admin list
Like:
- SedatTR | State: Idle emoji
So, what will i use?
well it was overriden
toString is automattic

when concatenated
})
thx
Hello all, can i rewrite !help command for something more personnal in python ?
ok thank @slender thistle
A good tip for your help command, make it easy to read
it's something that i don't notice before and when i use the help command, that was not helpfull and unreadable (like my english π )
I use a paginator for mine
using a paginator and what is written is different things
hi, it's possible to set some information to an user with a specific command ?
Yeah
.txt files, .json files, databases, etc.
I use json for posts (=post create <text>) and has data on the message.
Hey so how do I make it, so when my bot is pinged it sends a message to that channel.
what language (dont say english)
@west spoke ok thank
...
pretty sure a message example is on the front page of the docs of every lib
Yeh
Or
or use dbm for no hassle bot making 
if message.content == client.user.mention
second is with nick first is without
if (message.content.includes(`<@${client.user.id}>`) || message.content.includes(`<@!${client.user.id}>`)) {
//send message
}```
im having some issues with mongodb, anyone able to help out?
running mongo says "connection refused"
running mongod throws this error https://pastebin.com/wNdDFyvF
this is somewhat the issue im having but ive tried all answers in the thread and nothing works https://stackoverflow.com/questions/13312358/mongo-couldnt-connect-to-server-127-0-0-127017
hum ... I am following the guide on "how do i code a bot" in #502193464054644737 ... and i have a little problem, the "npm init -y" command doesn't work (and why is it putting me in system32, i'm scared)
π
Peak dbl
i just want to code and i'm stuck with weird things
@mossy vine maybe mongo has a connection limit like Postgres and redis
"peak dbl" ... what ?
Meme
arf
@spring ember what do you mean connection limit? i havent used it in days and its not been running
Oh
@mossy vine are you using mongo Atlas ?
Are you sure mongo is running?
set the connection limit to -1 <o/
my issue is that its not running lmao
@wraith cipher nope
im having problem with starting it
look at my message above
sudo mongod?
Oh yeah that might be it
different error but still not working, lemme paste it here
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] MongoDB starting : pid=2205 port=27017 dbpath=/data/db 64-bit host=cyber28-linux
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] db version v4.0.9
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] git version: fc525e2d9b0e4bceff5c2201457e564362909765
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] allocator: tcmalloc
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] modules: none
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] build environment:
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] distmod: ubuntu1804
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] distarch: x86_64
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] target_arch: x86_64
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] options: {}
2019-04-28T21:41:58.557+0200 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2019-04-28T21:41:58.557+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-04-28T21:41:58.557+0200 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] now exiting
2019-04-28T21:41:58.557+0200 I CONTROL [initandlisten] shutting down with code:100```
2019-04-28T21:41:58.557+0200 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db
where do i create that directory tho
Also give mongo ownership
π
sudo chown -R mongod:mongod /data/db
invalid user mongo
I edited

same
ls -l "total 0"
What the actual fuck
-a ?
still complains about how its read-only
is it possible to code a bot in an other language than javascript ?
of course
@spring ember okay, ill try completely reinstalling it tomorrow. thanks for helping, cya
literally anything
Sad @mossy vine
python, java, lua, dart, anything that can send http requests really
@winged mango Python, Javascript, Ruby
niice ... and how do i do it, then ... i tried with js but it doesn't want to work
Yea your bot is just communicating with the API
niice
It's the wrappers you should look for
It's not js that's the problem
I recommend learning a language and sticking with it
Try python
and a little bit of js
Both Java and Python have amazing wrappers
Choose one
My favorited are Discord.py for Python
And JDA for Java
it is my first bot, and i don't really know what i will make him do, what is the best language, i mean that can do the most things ?
If you want to use the vertx framework for Java then catnip is a great alternative too
java to start i think
i mean, java
now ... how do i put code on my bot ?
heyyyy π¦
not funny π¦
you make a file
Gradle and JDA should do the job
Learn how to use Gradle, I find it really fun to work with and then learn the concepts of JDA they have it all in their wiki
well, i have done the tutoriel on "how do i make a bot" and i am stuck here
Java wrapper for the popular chat & VOIP service: Discord https://discordapp.com - DV8FromTheWorld/JDA
so i don't know at all what i will do
that is js?
thx
command prompt
it was for js, yes
@winged mango you wanted Java right?
u wanna keep going js?
Check out the link I just sent
yes thx
then u do next step which is npm install discord.js --save
no, i want to do it in java actually
np thx
x)
actually, what really are gradle and dv8 (or JDA i don't know) ?
dv8 is the creator
Gradle is a build tool that helps you manage dependencies
For example JDA
JDA is the library that helps you interact with the Discord API
No
arf
i don't know what npm is x)
It's the node.js package manager
how do i add attributes like this with no value to a node in js? https://img.jt3ch.net/c13d3b04.png
Gradle helps you build your Java application
@slim heart it's basically attr = true
hum ... ok
i guess
so, i have my bot in the developer portal
i mean the application with the bot
what do i do now ?
You start a new Gradle project by installing gradle and running gradle init in cmd
Then add the required dependencies to your build.gradle file and start coding!
Enjoy
Pure Java
Java wrapper for the popular chat & VOIP service: Discord https://discordapp.com - DV8FromTheWorld/JDA
Here are some links to help you start
well, i started with that: https://guides.gradle.org/creating-build-scans/
and i'm already lost 
i'm so pissed
ok, i found a french tutoriel (cause i'm french), it will helps me a bit more for the start
This webinar introduces the audience to the power of Gradle through many real-world examples, coded live during the session. By the end of an hour, youβll un...
Yep
I like webinars
They show real life examples
I haven't seen this one but it's by Gradle
Online seminar
okay
just like a podcast where people can learn
Let's say that in a project, I have foo.txt and bar.txt. And in that project, I have two branches: master and stable. The only difference between those two branches is in bar.txt. But now, I want to make changes to foo.txt in both branches. Is there a way besides having to make the changes in both branches separately?
git commands
Ah
git stash backs up current changes that haven't been staged and commited yet
git pull pulls new information
Hmm
git pop pops out the last stash
I made a new branch to make all the changes on and then just merged them
git pull has some flags for handling congestions
i thought that was detectivehuman for a second
same
So let's say... while messing around with Git, I accidentally leaked my token and api keys... "hypothetically"... and I deleted the repo from GitHub a split second after it got pushed... how would I go about reverting back to the time when I hadn't fucked up?
I don't wanna get rid of all the edit history
first refresh the token
I just wanna go back to the time when it wasn't ruined
Yep, I refreshed my token and api keys @spring ember
ok
Refreshed everything
git revert is the git command for you
ok
git revert <commit hash>
but, couldn't people go into the commit history and see all the info?
also merging conflicting branches is usually done with git rebase
@opaque eagle they can
that's why you refresh the tokens
ohhhh right
Which databases work best with Heroku.
none
@dusky bear https://www.heroku.com/postgres
can anyone help me with a ReactJS question
i can't get my app deployed on GitHub Pages π
anyone know a good souce to have a mute cmd that makes u type the reasson after u do a.mute [user]
hmm i'm not sure if i have a good source for that
are you looking for a bot that does that already?
no a way to code it
what language?
discord.js
const who = first arg
const reason = remaining args```
take a loot at Array#slice and Array#join
so that would do is a.mute user then it when i hit eb=neter allow mw o enter a rasson like luca does?
no, it'd be a.mute USER heres the mute reason
not trying to copy luca just think its cool
if you want something interactive, it's slightly harder
you'd need to ask for a reason and wait for a response
do u know of a site or a yt vid that would help me do it
discord.js.org can help you
is what im talking abou called message await
Redis persistence is usually automatically enabled, right?
I wrote this down word-for-word: https://github.com/serenity-rs/serenity/blob/current/examples/01_basic_ping_bot/src/main.rs
let mut client = ...
const Discord = require('discord.js');
const client = new Discord.Client();
const token = ''
client.login(token);
client.on("ready", async ready => {
console.log(`${client.user.username} is ready!`)
})
var prefix = " "
client.on("message", async message => {
if (message.author.bot) return;
if (message.channel.type === "dm") {
var args = message.content.split(" ").slice(0)
var args = args.slice(0).join(" ")
if (message.content.startsWith(prefix)) return message.channel.send(":x: Please use commands in real server! :x:")
else if (args.length > 256) return message.reply("Your message content too many characters :/")
var embed = new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle("New request in DM!")
.addField(args, "Sent by: " + message.author.username + " with the ID: " + message.author.id)
client.guilds.get("guild id").channels.get("channel id").send(embed)
}})
client.on("message", async message => {
if (message.content.startsWith(prefix + "reply")) {
if (message.author.bot) return;
if (message.author.id !== "owner id") return message.reply('You cannot use that!')
var args = message.content.split(" ").slice(0)
var Rargs = message.content.split(" ").slice(2).join(" ")
var userID = args[1]
if (isNaN(args[1])) return message.reply("This is not an ID!")
client.users.get(userID).send(Rargs)
message.channel.send("Sent!").catch(console.error)
}})```
oh pls... don't have each cmd in its own msg event
No no. I dont. Thats not in my bot.
For discord.js, what was the obj for pulling the bot's avatarURL? Anyone know off the top of their head?
For the life of me, I'm not finding it
client.user.avatarURL iirc
Thank you!
Hello Developers
i am created a bot
at the same time as been hosted, i publish it into the Discord Server List
And i have a question
i send a screenshot
You can just post your screenshot, question, any errors you get and whatever that is related to your issue without all those greetings 
Check out setPresence in djs docs
Ah thanks
Does anyone know how to get a discordpy Bot in a webserver or something else that the Bot is always online?
Rent a VPS, connect to it through SSH and FTP (preferably SFTP), upload your bot, download needed discord.py version, run the bot
...okay thank you
that's what I do until my bot is verificated .__.
Mine is verified. For the very few times it crashes ( #memes-and-media ) it normally does it just fine
du you get a message when the bot is verified or is it jusrt verified?
You do
Also why I no longer use the =neko command
Would crash my bot when spammed
ah, thank youu
Are you that guy who used requests module, LazyNeko?
is requests bad shiv?
well i heard aiohttp is better but i personally don't rlly use py so yea
@lament meteor Use aiohttp if your code is async
my discordpy bot is without request module... if I remember correctly
I'm not saying "Delete your fucking requests module". My point is, you should use aiohttp if you don't want your bot to be blocked for a long time (it will crash at some point if your requests take too much time)
yea ik
Your websocket disconnects if you do stuff that takes a long time with sync module
Also, while we are still at it, don't use time.sleep in your Discord bot, asyncio.sleep exists
I'll not calling anyone dumb for doing that, just sharing advices
Ik but time.sleep can cause errors.
And it does at some point
what's the error and which library are you using?
.help
How can make a bot that send notification when I upload a video on youtube
Someone know how to put a canvas in a embed ?
image
bc .setImage(canvas) return 255, 255, 255, 255, 255...
If you want to insert a image
Wtf is that username

