#development
1 messages · Page 641 of 1
#memes-and-media please, this is only for bot development!

how can you purge more than 100 messages like dyno/mee6
you don't
you need to send the request in batches for bulk deleting more than a 100 messages
you can't, 100 is max, hence 
can someone tell me how sharding with different servers work?
like
- s1 has 4 shards
- s2 has 4 shards
Total 2x4
@devout flicker <
https://discordjs.guide/sharding/>
does not answer my question
i know how sharding works if you just use a single server
but im talking about multiple
ohh my bad i misread
youd have to communicate between the two somehow. i dont know much about server architechture maybe someone else can provide an actual solution
obviously you already knew that ^ lmao
personally id look into creating an api or communicating between the two with web sockets. those would be my first naive solutions
tho i thought it would not be a problem due to discord automatically assigning shards to guilds
but, it resulted into duplicate messages ofc
wth where is there a error
we can't read that
^
yeah i know but like if he wants us to read it here he could at least crop it lol
Wrap your code/text and re-send screenshot please. It's a syntax error p sure, you probably missed or added an extra bracket somewhere
^
also we need to see the error
prob missing the closing paren to your callback
Hover over the red dot and you'll see what the error is
You didn't close the brackets during your resolve(s)
module.exports.run = async (bot, message, args) => {
message.delete();
if(message.author.id === "523885075776143360") return message.reply('No Permissons to Run This Command!').then(msg => msg.delete(15000));
let bicon = bot.user.displayAvatarURL;
let string = '';
bot.guilds.forEach(guild => {
string += guild.name + '\n';})
let bt = bot.user.username;
let botembed = new Discord.RichEmbed()
.setColor("#000FF")
.addField("Servers In", string)
.setTimestamp()
.setFooter("Command Ran By: " + message.author.username, message.author.avatarURL);
message.channel.send(botembed);
}
module.exports.help = {
name: "serverlist"
}```
three ` at the beginning and end please
@warm flame :)
oh shit
close the bot.guilds.forEach
this is why you dont code on mobile without a proper code editor
and the .then(msg
or await
?
since its in a async func
What?
@earnest phoenix wdym with close
@stray garnet ur brackets are not closing foreach
wait
its a breakpoint
lmao
it's in index.js, not serverlist.js ??
props.help.aliases is undefined
no its in serverlist.js its just the handler
👀 o
you need to create an aliases property in that help section
^
your handler is erroring because it doesnt skip commands without aliases
k
so either add that feature or create an empty aliases array
@idle basalt okay thx works

(bot.guilds || []).forEach
WTF
Or map guilds in a const
Ok
ye
I had that problem before with eval
but I figured it out
¯_(ツ)_/¯
does d.js have something to log out with? so i could log in again?
https://oliy.is-just-a.dev/r9owbv_411.png doesnt look like it
could always process.exit()
theres .destroy
im not aware of a dbl lib for C#
oh nevermind
@brittle wasp
Ok
..
Oh
Wrong ss
throw err;4:11 PM
^4:11 PM
4:11 PM
Error: Cannot find module 'snekfetch'4:11 PM
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)4:11 PM
at Function.Module._load (internal/modules/cjs/loader.js:508:25)4:11 PM
at Module.require (internal/modules/cjs/loader.js:637:17)4:11 PM
at require (internal/modules/cjs/helpers.js:22:18)4:11 PM
at Object.<anonymous> (/rbd/pnpm-volume/ced3d9fd-e946-4e96-92ae-da8d08672ba8/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/util/Util.js👍81)4:11 PM
at Module._compile (internal/modules/cjs/loader.js:701:30)4:11 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)4:11 PM
at Module.load (internal/modules/cjs/loader.js:600:32)4:11 PM
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)4:11 PM
at Function.Module._load (internal/modules/cjs/loader.js:531:3)4:11 PM
2 minutes ago
internal/modules/cjs/loader.js:5844:11 PM
throw err```
Lazy.
@static matrix Can you try running npm install snekfetch
^
Ok wait
You're using glitch right?
It looks like the os is denying access
And i doubt glitch gives you root access
Best to contact glitch themselves
@west spoke thanks
Ok
lol glitch
decent place for small bot & if you don't have money
glitch would be able to barely put my bot on 'online'
before dying out
lmao
no glitch === less shitty bots
Yes
afaik you have to install using their "add package" button, else it doesnt work
uhm a bit dumb question i guess but can you like "clean" your bot's cache or whatever
restarting
that doesn't work
my bot said its in a big server and i googled it and found it and joined it and noticed it wasn't there anymore but my bot said it's there, ehhh idk
yea it does, everything in the cache will be removed obv, and then when it starts the vital create events will go off
they can also by all means hide bots in other channels
so you might just not be able to see them
A restart command is like hella easy to make righti?
doesnt mean its not there @smoky mica
@ember atlas yea
@smoky mica try doing an eval and see if its in there
i'm gonna be honest, i never made the eval command
It’s just process.exit(1); right?
mhm
And then do you have to say bot.login(“token”) or does r auto do that
process.exit will stop the whole program, if u have a restart system set up itll just run again
And if I don’t have restart system setup?
like pm2
use something like pm2
set one up :p
I could
use pm2
Usually I just do pm2 restart 0 in the terminal :p
npm i pm2 --global
guys you dont have to repeat yourself cmon
what really is the advantage of eval? i've never understood it 😅
you can run code on the go
you get to manually make your bot do things without editing a file
running code outside a bot
OH
test new things, do quick changes etc.
cat out your token
Eval is hella useful
i mean what
Hide your token in eval tho
mmm just dont make it open
yeah haha ofc
Ya. No dev does that.
i'll just limit it to my id
Ye that’s good
eh ive seen open eval and even open exec before
eval is useful af then :o
i use exec to restart everything from anywhere
i used eval to check my guild count for my bot
thnaks y'all 🤠
what do yall use to host your bot atm
#memes-and-media please
Currently mine is in development so my pc
cheap and meh service
this isnt dev related
Gonna do a vps soon
not development, this is conversation
"(bot) development" too :p
its alright i'm done anyway haha
Does anyone have a guide to do a restart system?
just use pm2
it works with literally any project, not just js
it gives you useful data
and is a breeze to set up and manage
Also what are these exec commands ppl have?
child_process#exec
What does it do.
executes in cmd
So it’s like using the cmd but like good for on the go ?
trackpad, check out oxidehosting
oh also @mossy vine u said u were doing the .exec to do pm2, theres a pm2 package btw
pm2.restart("all")
cool but exec is better 
rather than having to open up a whole child proc
Can you use that in code for a good restart system?
yea
Thanks everyone.
so i put message.guild.leave() and tried the command and the bot left my server and scared me thinking it left from every server lmao
how can i make it so that it leaves according to the ID
<client>.guilds.get('ID').leave();
I just got a question on axios, how do I get axios to get the data of the latest object, like response.data.attacks.[latest].etc
thank you speedy
I have been trying to make leveling system (javascript) from like 1-2 weeks ago and still not working 

@earnest phoenix Okay?
Do you need help
Uh yeah I think so
Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem.
Well It explains my problem, I need help making leveling system..
What language ?
js
We won't
you the code, we can only give parts & help you with errors/bit of code. You can google & use tutorials from websites as seen above ^
How do I get the latest result from Axios?
There is nothing on google I can find for the past few days bout getting the latest result
axios.get('')?
"74752697": {
"timestamp_started": 1561281350,
"timestamp_ended": 1561281356,
"attacker_id": 2309697,
"attacker_name": "CodeD_AUS",
"attacker_faction": 22295,
"attacker_factionname": "-",
"defender_id": 2302988,
"defender_name": "DerekkG98",
"defender_faction": 0,
"defender_factionname": null,
"result": "Mugged",
"stealthed": 1,
"respect_gain": "0.6669",
"chain": 1,
"modifiers": {
"fairFight": "1.71",
"war": 1,
"retaliation": 1,
"groupAttack": 1,
"overseas": 1,
"chainBonus": 1
}
},
"74752779": {
"timestamp_started": 1561281477,
"timestamp_ended": 1561281492,
"attacker_id": 2309697,
"attacker_name": "CodeD_AUS",
"attacker_faction": 22295,
"attacker_factionname": "-",
"defender_id": 1684520,
"defender_name": "bwarbwar",
"defender_faction": 0,
"defender_factionname": null,
"result": "Mugged",
"stealthed": 1,
"respect_gain": "1.79138",
"chain": 2,
"modifiers": {
"fairFight": "2.81",
"war": 1,
"retaliation": 1,
"groupAttack": 1,
"overseas": 1,
"chainBonus": 1
I am trying to get the latest number
It isnt an issue
i assume the higher the number is the newer it is?
I need it to get the latest number which is 74752697
Yes
So response.data.attacks[74752697].etc
parse the json (aka convert it to an object), get the keys from it, sort the keys, get the value of the highest key from your sorting, deal with the data
Aight I'll try that and figure it out thanks
How can i do that?.
CSS
but i don't know what is the thing i need type. that is my problem,
look
CSS for customizing bot pages on discordbots.org. Contribute to advaith1/dbl-css development by creating an account on GitHub.
That
@earnest phoenix thanks for that. but i already find one
okay
If you don't know what CSS is, you should try learning it a bit before attempting to create "Pure CSS Rainbow Text with Animation Effects"
weird
i don't have a private key
no wonder
some dumbass got access to my account
i'm infuriated
i've had it
i'm not moving back to skysilk
I don’t understand what to do to get vote only commands. Please help
store user data
Ok
when a user vote store of the data of the user, with like 'voted'

Why does the path look like its trying to add a role above itself to a guildMember
@amber fractal d.js bad
@earnest phoenix Keep it on topic please. 👍
hey someone knows an API to get lastest football/soccer matches? sorry for my english
@bright bone try googling questions before asking them here. I’m sure it’s readily avail.
I searched in Google but that APIs have only 10 requests per minute.. (the free version)
Why do I keep getting this error when I have discord.js in my package and I use require("discord.js"); in my code?
- Error: Cannot find module 'discord.js'
Ping with response, please.
what hosting do u use?
@floral bloom Hi! You're missing the module in package.json
So just do like npm install discord.js
Hold on.
In console
I'm using glitch.com. Shouldn't this work right?
Oh didn't see that previous. Just try install again I guess
Yeah it should
In console of glitch you have to do pnpm so
just reinstall by doing
it happens sometimes. Glitch is glitchy
. Once reinstalled all npm packages you'll be good
Lol, ok thanks
Have a good day, feel free to drop a message if you have any more issues. 
Ok, you too!
@spare goblet Well, I sent pnpm instal discord.js to the console.... it didn't work
It said: Usage: pnpm [command] [flags]
Also, now it won't let me type in the console... hold on
Hm, it worked
@floral bloom great congrats
you missed out an l the first time
Any way to generate captcha on js?
I'd use a package to do it If I had to 
What package?
probably canvas and generate it yourself
How can I stick my header in html
javascript weird
i got an array ```json
[ 'memes\r', 'memes2\r', '512\r', 'oofergang\r', 'triangles\r', '' ]
and the `array.size` is undefined
why ;-;
]]ev [1,2,3].length
3
cause google
i think the only thing that is size, is a map
]]ev const m = new Map([[1, 2], [3, 4]]); m.size
2
anotha issue
?
the for statement makes my console.log(aArray.length) undefined
lmao
it was printing it out fine
but since length startsfrom 1 and not 0
last one was ubdefined
so i thought it was the length console log
i'm dumb
@earnest phoenix if you simply want to loop over the elements of an array, <Array>.forEach() is a cleaner solution
for of superior
hello guys
need help 😃
TypeError: Cannot read property 'roles' of null
what it mean ?
message.member is null
Uncaught Promise Error: { DiscordAPIError: Missing Permissions
at item.request.gen.end (/rbd/pnpm-volume/b5993b4d-5469-4f53-a0d7-988a88170f12/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
at then (/rbd/pnpm-volume/b5993b4d-5469-4f53-a0d7-988a88170f12/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:182:7)
name: 'DiscordAPIError',
message: 'Missing Permissions',
path: '/api/v7/guilds/264445053596991498/members/390811484092891147',
code: 50013,
method: 'PATCH' }
yardım edecek varmı 😄
@earnest phoenix the bot is missing permissions to do whatever it's trying to do
what do you need to do for her?
You need to add permissions to them in whichever server that used the function that it doesn't have permissions in 🤠
Like if you're trying to get bot to ban someone it needs banning perms
hm thanks ^^
No prob have a good day. 
2019-06-24T08:50:25.862531+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-06-24T08:50:25.915858+00:00 heroku[web.1]: Process exited with status 137
:l
i searched it on google but didnt solve it
its on all my projects
please help guys
Heroku dynamically assigns your app a port, so you can't set the port to a fixed number. Heroku adds the port to the env, so you can pull it from there.
People Give Me Some Css Scripts Of Btn-Orange
its kinda easy
you have some box-shadow
some border-radius
and some white color
and some #?????? background-color
lets find those colours
all this what we need for the button?
looks like it
.btn-blue {
background: #6666ff !important;
let me check with inspect
took from
here
lol why
lol please help me,
ok,
or at least use it for something other than the invite button
so the css factors i can see
i mean fairly i guess
.buttton {
background: #ffad00;
box-shadow: 0 5px 40px 0 rgba(255, 173, 0, 0.3);
width: 100px;
border-radius: 100em;
padding: 10px;
}```
i guess so
wait.
How can you even change the buttons on the site 
css
But like, how do you know which button you are changing
Preview
you don't. it's a matter of fun
or u can use inspect element if you're really gay
Where can you change it?
Long description
oki
Lol
my bot starts, is online for like 5 minutes and then goes offline. Why?
because you're using free hosting
if(messageReaction.emoji.name === "👍")
{
console.log(user.username);
}
}); ```
@bleak vortex what lib?
It's not sending any message in console
Are you sure the emoji.name is the unicode character for the emoji though?
sorry but what is lib? @pale marsh
Library
Hmm
Does it dump any errors to the console?
nope
Test it first by logging messageReaction.emoji.name to the console before the if statement
most emojis return the name of
because they're unicode and your console font most likely doesn't support rendering unicode chars
yay im back. Looks like my BOT's don't wanna come online still though 😦
give it a bit
how make level up messages on/off?
store it
@earnest phoenix are you talking about in code or in a bot that's on dbl? if it's a bot on dbl you have to go to their support server
if (!on) return
otherwise, save it in db and basically 
im about code
yeah then save an option to on/off in db, and based off that setting, if it's off, then don't output things :)
use something like mongodb, store guild settings and just if statement the rest
in a nutshell
yo yo
ok
.
Hello
@earnest phoenix Do you need help?
Move to #memes-and-media
To post pics
This place is for asking questions about development, move to #memes-and-media thanks
There are Motor (async) and pymongo (sync)
I have a error in my bot
throw err;
^
Error: Could not locate the bindings file. Tried:
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/default/better_sqlite3.node
there's even more
it'll be appreciated if someone could help
ping/dm if u can help me
Can bot reply message with multiple images ?
no
uh yes, but not in one message @umbral glacier
it's one attachment per message, android used to allow multiple attachments in one message however they've fixed that since 3 months ago
Hey, I just wanted to ask if if/how you could accomplish a guild specific status (for example the bot is on 2 different servers and each one has a different command prefix -> on each guild it should show a different status with the guild specific prefix)
@frigid sun no you can't
theoretically you can, but not really reliably
status is global
if you shard and the guilds happen to be on different shards you can have different activities
by statuses they mean game/activity
Bleh can't some1 help meh?
throw err;
^
Error: Could not locate the bindings file. Tried:
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /rbd/pnpm-volume/0fa62af4-d92b-449c-b3bc-8456d355e1c1/node_modules/.registry.npmjs.org/better-sqlite3/4.2.0/node_modules/better-sqlite3/build/default/better_sqlite3.node
Fugly error
stop copypasting the error
but i think i saw that before, for example the tony bamanaboni bot allows to change prefix and also displays it in status @earnest phoenix
it's clogging the chat and you posted it a few messages above
Chill lmao I just need help
@earnest phoenix you can still do multiple attachments in one message in android
Yes
im pretty sure they've made it so the messages are split
uploading is concurrent now
jeah i tried that but then i would need to start a new shard according to guild count?
you can't define which shard will a guild go into
On android you can add multiple attachments but its not in one message
idk wtf i said
@earnest phoenix just read the error, bot can't found the directory
hm...
@frigid sun and yes
you have any other idea of displaying the current prefix?
and zero utility to do that just for a status
just,, dont show it in the status...?
yup thats the problem
any idea how I could display it, cause its pretty bad to not know a bots prefix xD
have a prefix command and allow commands to be executable by bot's mention
and the mention take a args, dont forgot
sry what do you mean exactly?
if you have a say command or something else, if your prefix is @mention say hello you will not be able to use it anymore
because the say take already a args
no i dont have a say command
const Discord = require('discord.js');
const cooldown = new Set();
let cdseconds = 3600000;
module.exports.run = (bot, message, args) => {
if(cooldown.has(message.author.id)) {
message.delete();
return message.channel.send("**❌ Cette commande possède un cooldown de 1 heure.**")
}
const low = require('lowdb')
cooldown.add(message.author.id);
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('./db.json')
const db = low(adapter)
var author = message.author.id;
if (!db.get("credits").find({ auteur: author }).value()) {
db.get("credits").push({ auteur: author, credits: 500 }).write()
} else {
var usercreditsdb = db.get("credits").filter({ auteur: author }).find('credits').value()
var credits = Object.values(usercreditsdb)
db.get("credits").find({ auteur: author }).assign({ auteur: author, credits: credits[1] += 500 }).write()
}
message.channel.send("✅ **Vous venez de récupérer 500 crédits. Merci de patienter 1h avant de pouvoir effectuer encore cette action.**");
setTimeout(() => {
cooldown.delete(message.author.id)
}, cdseconds * 1000)
}
module.exports.help = {
name: "work"
}```
why my cooldown isn't work ? but is the same cooldown for my suggest command and it's fonctionnaly ^^
I need help with how do I check shards in a commando bot
my bot.js is broken T^T)
first, indentation needs fixing because i can't read anything from that picture
second does your bot come up with an error in console?
bot is working but i cant edit my bot
nice token leak
show code, take out token for a sec
in pic not have token lmao---
Hey
@frail ocean bro in my server mee6 is offline what can i do
nothing
Go to the mee6 server, not here
Do you want a joke?
@last mesa is the best discord developer ever in this world, and he has a most super bot @stuck harbor !!
ok
@karmic hatch As others said, we can't do anything as we are not a Mee6 developer or support server. Please wait for the bot to restart and come online. 😃
https://discordapp.com/developers/docs/resources/webhook#execute-webhook if you're using raw requests
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
If you're using a lib it should be documented
Anyone know how to set a per shard status?
No utility?
what library are you using? @cursive dagger

You have to use raw http


with d.js does shard 0 handle all dms?
yeah i'm worse with discord.py than discord.js
Shard 0 is DMs iirc
so a bot that only works in dms could get ratelimited if many people are using it at once?
ah
well fuck
Ok
@mossy vine ratelimits are per channel
are dm channels seperate channels?
yes they are
but that "ratelimit / channel" thing doesnt apply to user accounts, does it?
pretty sure they have the same rules as regular text channels
Cyber gonna selfbot 
How do i code
yeah they have the same ratelimits
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat It should be ../
lmao will fucking ryan is here
huh?
@cursive dagger no, i will just spam my alts with dms and maybe test on my bot with careful timeouts so i dont completely fuck up the ratelimits
Yea
Im gonna try to add mention as a prefix option to my bot tomorrow 😄
Gl
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i dont know redis at all but trying to connect to node_modules sounds wrong to me
One message removed from a suspended account.
Redis is hosted as a socket
looks very familiar https://npmjs.com/package/@keyv/redis
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
redis is a server based database
arnt all non file databases server based 🤔
I think so
How would I access the nick name of a user and change it? I have been looking around but I can not find anything
Wich library ?
Yes but I doubt he maid something custom
Ah oof
And a few other modules
Then get the member object (i think it's guilds/id/members)
Ye
And lemme lookup for updating it
For update I think it's patch dunno
I am useing C# if you were talking to me
But you need to update the whole member
which library @unborn shadow
@west spoke I found this https://discordapp.com/developers/docs/resources/guild#modify-guild-member
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
a SocketGuildUser contains a Nickname property, it will be null if the user doesn't have a nickname, you can modify the user's nickname by calling ModifyAsync on the user and passing it a lamba
you can get a SocketGuildUser by calling GetUser on a guild
or you can cast your context user if you know the command has been executed in a guild
or if it's an argument in a command you can directly define public Task MyCommand(SocketGuildUser u) => ReplyAsync(u.ToString())
You assume we use that language hm
what
So I have a IUser how would I get the guilduser then?
where did you get the IUser from
Context.User
you can cast it
to a SocketGuildUser
though i would suggest pattern matching to ensure the user is indeed a socketguilduser
One message removed from a suspended account.
please don't
One message removed from a suspended account.
nadeko is a fuckcluster, don't try to learn from it's code
SocketGuildUser.Nickname is read only
that would be .ModifyAsync? right
yup
keep in mind when modifying the user, the bot can't modify the server owner or anyone above it in the role hierarchy
ok
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
in which library
One message removed from a suspended account.
Er now I have this error:
what's your code
await ((SocketGuildUser)Context.User).ModifyAsync(Nickname("hi"));
ModifyAsync takes a lambda expression
How would I do that I have never touched lambdas
so like this .ModifyAsync(() => Nickname("hi"));
no that cannot be right there is a error
One message removed from a suspended account.
there we go .ModifyAsync((SocketGuildUser) => Nickname("hi"));
no, you shouldn't skim read the doc
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
weird
One message removed from a suspended account.
One message removed from a suspended account.
what is value supposed to be
^
One message removed from a suspended account.
value isn't predefined, show us some code
=
no needed
One message removed from a suspended account.
and what is value??
One message removed from a suspended account.
you dont have a command parser
One message removed from a suspended account.
oh right its a handler
that doesnt look like a very good handler
theres no need to add an if statement if you already have a handler directing to the command file
One message removed from a suspended account.
One message removed from a suspended account.
This look pretty decent https://discordjs.guide/command-handling/#individual-command-files
b
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Where would I go about finding things for an info command such as server count, etc via djs docs?
They are mostly properties of the Client object in most libraries
Or methods in the same object
You should start there
So after reading up on lambdas and then fixing the stack overflow it caused I am back to square one. I still cannot edit a nickname....
does the code compile now?
The lambda was a rabit hole with out a use it just called it's self
so it compiled in to a stackoverflow
Does anyone know how to edit a nickname in C#? Or direct me towards info that could do it?
I disabled these ws events in Eris and one of those is apparently necessary to receive avatar updates
Logic would say those would go through USER_UPDATE
But guess not
I've also checked through some of eris source code
And still have no idea which of those would cause the avatars not to update
ok
I found out
Just after posting
That's pretty epic
PRESENCE_UPDATE
yes
Guess I'm retarded
@tight zealot So you changed discord.client() to discord.Client()?
Let me see
See what
Snap a pic of it again.
Silly goose, you identified the constant as discord, and called Discord. Change it back.
- you didnt save your file
- you are defining it as
discordand usingDiscord
If you wish to advance further, I recommend checking out the javascript course on Codecademy and reading the discord.js documentation.
Okay
and also formatting your code properly
you have a powerful code editor, use it to its fullest
Anybody know how you can detect input after a command is run?
e.g
message.channel.send("Please enter something");
//Then the user enters "Hi"
if(input !== hi) return;
//Input would be what they just sent
Read the docs
...
You can create a message collector
maybe creating a message event inside a command
Don't do that
NO
Use a message Collector
Creating an event inside an event is going to mess things up
ok ty
Would this work for the collector:
let collector = new Discord.MessageCollector(channel, filter, options)
.filter('test')
.stop();
Define channel, define the filter before you start the collector, .filter() is nothing. If you call .stop() directly it will do nothing, and you don't use the events so whenever a user sends a message it won't do anyting.
So quick question for those of you using Discord.js. I'm struggling with something I don't think I should be. For my exec command, the bot sends an embed saying its running, and then posts another embed when the command has run with the output. I'm using message.delete() to delete the embed, but all it's doing is deleting the command message, not the first embed. A small bit of my code ```js
const RunningEmbed = new Discord.RichEmbed()
.setDescription(Running command \${code.replace('', '\')}``)
.setAuthor(message.author.tag, message.author.avatarURL)
.setColor("#34363B");
message.channel.sendEmbed(RunningEmbed).then(message.delete(5000)); // eslint-disable-line no-useless-escape
exec(`${code}`, { timeout: 15000 }, (error, stdout) => {
var response = (error || stdout); // eslint-disable-line no-extra-parens
if (error) {
if (error.message.length > 150) {
message.channel.send(`${error.message}\n\n${Date.now() - time}ms`, { code: 'xl', split: true }).catch(console.error);
} else {
var evalEmbed = new Discord.RichEmbed()
.setColor('#e84118')
.setAuthor(message.author.tag, message.author.avatarURL)
.addField("Input", `\`\`\`xl\n${code}\`\`\``)
.addField("Output",`\`\`\`xl\n${error.message}\`\`\``)
.setFooter(`Error in supplied exec.`);
console.error(error);
return message.channel.send({ embed: evalEmbed }).catch(console.error);
}
}
TY for any help 😃
message is defined as the message from the user who ran the command
There for message.delete() will delete the user's message
You can change this .then(message.delete(5000)); to .then(m => m.delete(5000));
So it will delete the message it send
ah
client.message.delete() is nothing
No problem! 
Could you please help me with installing npm on Ubuntu?
Yes but then it greets me with this error when I try to install anything
groowy@asus ~/g/Incursio-Bot> npm install npm -g
npm ERR! Linux 4.15.0-52-generic
npm ERR! argv "/home/groowy/.nvm/versions/node/v12.4.0/bin/node" "/usr/bin/npm" "install" "npm" "-g"
npm ERR! node v12.4.0
npm ERR! npm v3.5.2
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'ansi'
npm ERR! Require stack:
npm ERR! - /usr/share/npm/lib/ls.js
npm ERR! - /usr/share/npm/lib/install.js
npm ERR! - /usr/share/npm/lib/npm.js
npm ERR! - /usr/share/npm/bin/npm-cli.js
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
it's already on the latest version so you don't need to update it
can you install any other packages?
no
well npm is installed
wait why are you trying to install npm with npm
i think im missing something
It has been already reported but the response was very unsatisfying 😐
https://github.com/npm/npm/issues/18153
that's how you update npm yeah
@mossy vine I'm just trying to solve the "unsolveable bug" 😄
I can give you example for this bug on any package you want 🤷
What does that mean
@tight zealot the issue is obvious, you have unclosed statements. please learn javascript properly before making a bot
Oh okay
tbh a message collector is creating an event inside an event
except they clean it properly
and with a neat function to filter messages
Cyber 😃
yes?
i liked ur comment
Ok am I doing something wrong with the .setImage method for rich embeds? Because I am trying to send this image and I get this huge error
.setImage() takes a parameter url which is a type of string.
So, whatever you're passing as url must be invalid.
@nocturne hazel ^
isn't it supposed to be const attachment = new MessageAttachment
i don't think so :/
Oh i fixed it
but Duane_, would I have to change it to attachment.png or something?
Oh.. I see what you're doing. You're following that one particular guide.
I think it's because there's no actual direct path to 'welcome-image.png'
See, it'll work if you do channel.send('message', attachment). However, since you're using embed. You're gonna need a direct path to that image.
ah ok
It's honestly easier just to send the message with an attachment rather than trying to save and load it into setImage().
Alright
Good luck 👍
ty
yt
People How to Delete this in (css)
you should know
your bot page?
you need the link?
did you set a donation link?
No.
looks like a bug
so how i going to delete that now..
dont know if you can
@modern sable can you check it out and see if it is a bug or not?
not a bug
that button is always there iirc
it's just disabled if the owner didnt set it up
no way to remove it?
I know But i don't know what should i type i trying and testing but is only deleting all the button i new at (Css)
cursor: not-allowed !important;
background-color: #A9A9A9 !important;
color: #D3D3D3 !important;
}```
@trail dagger Wow I Forgot About that. Damn.
😃
async def on_message_edit(self, before, after):
data = getjson()
for x in data:
if int(x) == before.guild.id:
if data[x]['ChannelId']:
channel = self.bot.get_channel(data[x]['ChannelId'])
embed = discord.Embed(color=0xff8080)
embed.add_field(name='Message Edited', value=f'Member: {before.author}\nBefore: {before.content}\nAfter: {after.content}\nMessage Channel: {before.content.channel.mention}\n\n[Click here to jump to message](https://discordapp.com/channels/{guild.id}/{before.content.id}/{before.content.id})')
await channel.send(embed=embed)``` str has no attritube 'channel'
like i hate events
cant add ctx without screwing up
and forgot how to define guild and ctx lol
i need to write stuff down
well yes, use common sense
what
you're getting the content of the message (which is a string) and then attempting to get a channel out of a string @trail dagger
Does anyone know how to add custom fonts with node-canvas?
So, if I have a JSON:
{
"key": ["value1", "value2"]
}```
How do I get `value1` and `value2` in Node.js?
key is an array in this case, so you treat it like an array
Yeah, how do I exactly get those two values?
like you would with any other array
People I Need Help with deleting this (css) I need a script Please Help!
Object.keys(json)[0] gets me key.
yeah.
now, if I put that in a variable
and then do json.variable
would that work?
probably not
it would think it's an object, when it's not
however, since it's an array, json[0] probably would
@earnest phoenix what do you suggest i change?
because i know what i did but doesnt remember how to fix
{
"iron_axe": [ '1' ]
}```
obj is that json
so, obj[0] should work
but doesent
@earnest phoenix
obj[0][0]
oh yeah, so the first value of the first key
TypeError: Cannot read property '0' of undefined� @earnest phoenix
code?
var invitemcount = obj[0][0]
console.log(invitemcount);```
can you also provide the code for obj
🤦 cmonbruh
you have an object with a variable called iron_axe, so to access it you need to use obj["iron_axe"]
the color on those tags
imagine using discord's graphics and not crediting them
@earnest phoenix Me!
var item = Object.keys(inv)
var amnt = Object.keys(inv)
var amount = inv[amnt[0]]``` @earnest phoenix
that worked
Apply to have my bot there?
So where?
Mk, applyinh.
Applying*
Done, Just waiting for approval 😉
😃 *
@earnest phoenix you realize you are advertising another bot list on here, presuming that site is yours, you're using discord's graphics without their permission (which you can get sued for), and the site is a shallow copy of DBL
you also mispelled view
wat
you're literally using discord's nitro boost graphics
which again, you don't have permission for and you can get sued and fined for it
copyright infringement fines can go from $200 to $150,000
how are iframes relevant to using discord's graphics
and that is relevant to using discord's graphics how...?
you can get sued, or if you're underage, your parents/guardian can
wat
what you're doing is literal copyright infringement, it's not a joke and it shouldn't be joked around with, it's serious business and fines are very expensive
discord's tos itself says you aren't allowed to use their service materials (graphics) and download them
you have it downloaded and literally referenced locally
it doesn't matter if the website is made for business or not, you're not allowed to use their materials
If you don't have permission from the company itself it is stealing
no, you have a billion results on google about how copyright works
please teach me to create a playing status script for my bot guy
uh, you can definitely link to external images hosted on discord
that is not copyright infringement
so that my bot can have playing status guys
you just can't download them locally and put them on your server and use those
which they did
@cedar nova nobody here is going to spoon feed you. Please understand how your desired language works before asking people to write code for you.
@earnest phoenix @earnest phoenix sorry for tag — please speak about this in another channel.
the conversation stopped like 5 minutes ago lol
@cunning oxide ok sorry

Where I can host a website for free
glitch maybe
tip: dont
get a vps where you'll be able to control routing, ports and your ssl certs
4









