#development
1 messages ยท Page 408 of 1
these things are called lists in python, right?
yeah
woohoo i didnt forget python at all
lists are ['thing', 'thing']
but you can do the same thing with them
a = ['thing', 'thing']
print(a[0])
``` would return `thing`
if i'm correct
so basically javascript arrays are called lists in python
yes
I added these styles:
b { color: black !important; }
h2 { color: black !important; }
h3 { color: black !important; }
but every text in <h2> is still white.
but it works for <b>
but why?
oh no, the use of !important ๐
nvm could fix it
pro-tip it's better to use more specific selectors than !important ๐
okay thanks
people will argue this though
is ur account streaming
I did node bot.js and this came up. wat i did?
What is your main file name?
main file name?
yes
er
check package.json
bot.js


paste the contents of your package.json
{
"name": "greeter-bot",
"version": "1.0.0",
"description": "My own Discord bot",
"main": "bot.js",
"author": "YOUR-NAME-HERE",
"dependencies": {}
}
huh
Do you have the main file named bot.js
I have a file named bot.js
Is that the main file?
Don't know what you mean by main file
are you in the right folder ?
is it in the same directory as your package.json
What is the file called when you do <Client>.login(SuperSecretToken)?
He just typed his command in the wrong folder
make sure the mainfile is in the same dir as the package.json or you need to specify folder in the path iirc
This is the typical error when I write node 'some file who dont exist' on my side though
if i were to make cleverbot, what would i use?
there's no custom file in call stack
Lil
Like, the files are in the same folder
that should work
your package.json could be rekt for some reason
hey wait
why are there no dependancies in your package.json
Dependencies are good to have
discord.js@11.3.2
in discord.js can u do msg.send()?
same error thing
using cmd
bc don't understand how node would exit directly before reading anything if file really exists
k
and then do cd C:\Users\Alex\Desktop\Communications\Bot
and then do node .
show me whats in the Bot folder
anyone know why this isnt working? it works with setgame, but that is deprecated. http://prntscr.com/je6qlj
it is
lmfao
welp
lol
bot.js.txt
gg
how to fix
:youtried:
what text editor are you using
actually tho
k
what's your editor?
@split ether
xD
yeah that was that
notepad++
File don't exists
i have like the studio code thing also
and sometimes atom
i have that but it eats my cpu
vim > all
well rip you @earnest phoenix
no
VSC runs fine on my laptop
use echo "code" >> bot.js
also
check out their api
what api
official cleverbot api..
but isnt it paid?
you need to pay out the nose for it tho
Yeah it's not free
no theres a free i think 1k requests
i need a free version
see if you can get your hands on @cold harness's Jade
It got removed
its an actual ai
and that lasts awhile, its lasted me 2 years
lol
anyway, someone have a solution? http://prntscr.com/je6qlj
jade?
his ai
make it like this?
yeah
cause setgame locks you to "PLAYING"
for every thing?
no it doesnt
because some has .json
well yeah it kinda does lol
i use .setPresence
oh and rich presence
yes
new error, help meh
k
yes @earnest phoenix
its not working rip
wait
wat
alex
?
ye
game: {
name: "",
type: 0
}```
how is it formatted (replace your token with "TOKEN")
// JavaScript source code
{
"token": "TOKEN"
}
k
remove // JavaScript source code
did
k
also @earnest phoenix u have to do bot.user.setPresence({options})
@split ether comments aren't allowed in json
oof welp
wdym samurai
it kind of worked
right
@earnest phoenix {} = notate json
hm?
i know that the user is an object
i guess i can change properties there
i like the methods
it makes it easier
alex
is it the proper token?
i have a handler as well
Yeah you do alex
oof did the client id
well command handler
i use event and command handler, aswell as a config handler (for custom guild configs)
idk why the setPresence isnt working
here
{
'token':'(PASTYOURTOKENHERE)'
}```
put that in auth.json
make sure the quotes are still around your token
PAST
lmao
gg
gets 1000 alts
yea
okay what token did you use
secret token
ok
its this one http://prntscr.com/je70gz
and of course
also, my game still isnt working
ANOTHER error
what error?
is it with auth.json again?
if so, you didn't format the json right to work with require
lemme see console
take a pic
did you client.login()? idk what lib ur using
pretty sure djs right?
djs?
discord.js
idek
youtube e.e
unreliable
console?
here, can you just call, so i can share screens?
Yeah
How would I change the shadow on the bot image? I can't find anything looking through inspect element
@night imp try this maybe
```css
.bot-img {
box-shadow: none !important;
}
So I made a trivia command:
https://hastebin.com/ulohedimaq.js
But when I write my answer, it does not give any messages and gives me this error:
https://hastebin.com/vawudawine.m
Anyone, please help!
Okay and how do I add that perm?
just make a role with embed perms and give it to your bot
or reinvite with a new url that gives all perms
Okay
hm
@night imp try this
```css
#bot-details-page .bot-img {
box-shadow: none !important;
}
np 
does anyone know if its possible to extend the functionality of the send function in discord.js? i can extend TextChannel, but i wanted to know if theres a way to override/extend the send function to make it so i can pass translation through it
Umm can't you use an object format to translate and then pass it to send?
It is possible, but on Message case you have to change the object itself you can't simply extend, I can send you an example if you want
@spring ember i haven't optimized my code for translation, and it would easier if i could sort of extend send to deal with translation inside of that
@young cradle sure, an example would help 
Oh I just read TextChannel @.@, but well, doing this way for that case should be better anyways
Look at the extensions folder if needed, and yes it is TypeScript, but you shouldn't have a problem reading it
That's what I suggested
thanks!
@gilded blaze i would do that, but then i'd have to go into every single file i've ever used text with and add some kind of function between the text to translate it
@austere meadow tbh you could replace the function at the onmessage event
rip
like message.channel.send = function(msg) {...}
But extending I guess you'll need to mess around with the library itself?
Like you could do stuff with the message first, then send it
Yeah basically like
i tried this ^ and it almost works, but i get errors everytime i try to send a message https://please.zbot.me/TaSH01VK.png
how would i go about doing that
how do I make it so that every - in an args will be changed to a space? like hello-hi will become hello hi
let args = ["hello", "hi"];
args = args.join('-');
console.log(args);
// prints "hello-hi"
well the problem is that here is my code:
if(message.content.startsWith(prefix + "cembed")){
if (!args[0]) {
message.channel.send("Test");
} else {
let title = args[0];
let desc = args[1]
if (!args[1]) {
let cembed = new Discord.RichEmbed()
.setTitle(`${title}`);
message.channel.send(cembed);
} else if(args[1]) {
console.log("a");
let cembed = new Discord.RichEmbed()
.setTitle(`${title}`)
.setDescription(`${desc}`);
message.channel.send(cembed);
}
so yeah it is hard to do that
Well @austere meadow you could do something like this in your onMessage event:
message.channel._send = message.channel.send;
message.channel.send = (msg, lang) => {
msg = translate(msg, lang);
message.channel._send(msg);
}
So every message will get translated if you provide a lang etc
Thats only for plain messages... embeds will be much harder
oh rip
@ashen quail I don't really get what you are trying to do in that code
well I want people to be able to create their own embeds
and ugh your code is really messy haha
Well in your case you could use quotes I guess
Or if you insist with - then..
ik
I guess a simple replace will do
my code is REALLY messy
let title = args[0].replace(/-/g, " ");
let desc = args[1].replace(/-/g, " ");
@ashen quail
Oh thanks!
Haha np
No problem, I helped a lot.
yeah thanks allte could not have done it without you x)
@fluid basin oof
(node:9180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'replace' of undefined
Oof\
ugh you sure you added args?
ok
Like in the else if (args[1]) {...}
Okay it works, Thanks!
np ๐
Instead of making a background action or whatever, can I just do something like this to have the playing status update?
while True:
await bot.change_presence(game=discord.Game(name="arc!help | {} servers and {} users!".format(len(bot.servers), len(set(bot.get_all_members()))), type=3))
asyncio.sleep(120)
First start by asking your question, it will be faster
@gilded thunder no
๐
use loop.create_task(func())
๐ณ
okay have fun
But it's a time for me to relax before I have another week of school.
I might be available in an hour or so.
What do you need help with anyway?
There's your problem.
Your own.
my own?
u are coping someones work
yeah
learn how to code python and check discord.py docs
@earnest phoenix can i ask how you update the db and your configuration map/collection? is it through an extender or a structure?
okay
@gilded thundercan u come pm?
Alright.
cheers jacz
Anyone who knows c# very good and can help me?
Ok soo i have my own source for my bot but i wanted to test and edit the nadeko bot source , i edited the dmhelp to look like this
but it still sends this message
any ideea?
And what do you want it to look like? You mean like this https://i.imgur.com/5b53OLj.png
It's not about that
The problem is the text doesn't change
It keeps runing the old .help message
How do I fix this? https://joshek.wears-supre.me/12e1675c.png
Yeah.
or you can do author.name etc
Yea you need to turn it into a string not using the object
@prime cliff you use dbm? 
Check my status 
soo @prime cliff Can you help me?
my respect for you is restored
Check to see if one of the functions is not overwritting it
it is not
Ok where do you have the help command defined in a
[command("help")]
Can you acc my friend request so we can talk there?
Or we could just talk here....
ok
Like i said i just want to test and edit the nadeko bot source from github
i don't know where is defined help
command
Yea in the command structure you have
[command("help")]
public async Task Help()
{
}```
i don't find it
Then where are you trying to define commands?
But where are you defining the commands to run?
what npm module would i use for image manipluation
u trying to set me up? 
what is
you just pinged a random dude
Using discord.js, can someone help me figure out if the bot has permissions to send messages in a channel? I've tried permissionsFor() but it always returns null and/or the member information, and not the permissions itself.
use the docs
I am ๐
well
its pretty easy
get the bot member
and check for send messages permissions
Or you could just send the output message and catch it if it fails to send(returns API error: Missing Permissions)
like this:
try {
await message.channel.send('test command')
}
catch (e) {
console.log('Message fail to send!')
}
you'd have to await it if you want to try{}catch
channel.permissionsFor(client.user).has('SEND_MESSAGE');
if not
Must be guildMemberResolvable?
So user obj or member obj
yeah client.user xD
CODE: https://hastebin.com/opoxiporuy.js
ERROR: https://hastebin.com/onexewinad.pas
Please help!
@ashen quail You are not returning it.
meaning what do I do?
if (!args[0]) return....
okay so I do that for every one of them?
or test args.length
so I would do like this?
if(message.content.startsWith(prefix + "cembed")){
if (!args[0]) return {
message.channel.send("Test");
} else {
let title = args[0].replace(/-/g, " ");
let desc = args[1].replace(/-/g, " ");
@grizzled isle
yes
after { xD
except
not before
yea lol
okay
also u dont need return
Well then it will give me an error saying this:
https://hastebin.com/onexewinad.pas
is someone here who is yousing discord4j?
If I understand correctly, it's impossible that two differentes objects have the same snowflake ? (for example a channel and a user)
anyone free and can help me?
ask your question
i need help with creating a bot
ik how to create but idk how to make it online and work
to make a bot you need to code it
ohh how?
no
what should i use?
what do you get from this quiz
FUCK
lemme try agaim
then use jda
^
use that, and pick up jda when you feel comfortable
you have to learn the lang before you code
it shows java coz i use android

Or you can just learn c# and not shove an ar15 down your throat every time you try to use async functions
ohh
if you really want to develop for Android, learn kotlin instead
where did you get create own lang
what is kotlin?
Kotlin is officially supported in Android studio, so you can natively build Android apps with it
ohh ok
@shy verge golang whenโข
is there a app for that
yeah
intellij is a text editor for java
ohh
specially for jvm
is there someone who use android?
@topaz fjord replace java with jvm and you got it
cause intellij can compile any jvm lang it damn well pleases
turtlelang
as long as you have the extension lul
yes
Is there anyone who is good at ubuntu/debian or web backends?
^^^^^
really???
please get some sort of computer
@gleaming summit what do you need help with?
bur i will work hard untill i achive

I am installing mariadb-server on my ubuntu server
boi
Tried vim on phone ๐ฆ
Oh shit I can't do that lul
never did it again
cya guys gonna work hard
Sorry I thought you were having vps trouble like this one kid who I had to ssh into to help cause he was dumb

Mariadb returns timeout when it's demon starts
@dusty shuttle you're most likely not going to achieve as from what I know, theres no command prompt/terminal for mobiles
same
I removed all apt caches
coding on a phone
lel
That's gonna be a nightmare
He's gonna quit before he has anything that would get on dbl
I have a markdown editor and an ssh client on my phone
That's as far as I'll ever go without throwing my phone out my window
Learnt a bit of python
I know how to make a simple command
async def play(ctx, url):
author = ctx.message.author
voice_channel = author.voice_channel
vc = await client.join_voice_channel(voice_channel)
player = await vc.create_ytdl_player(url)
player.start()```
I have an error
It says No module namedyoutubedl
Okay I have my line of code to enable my discord bot to come online, I would like to know where I run the code.
what's the line you use to start the boat
From what I pick up the code I'll be using is node bot.js
But I want to know where I run it
;-;
@earnest phoenix run that line in the same directory as bojs then
It says Unable to import PyNaCl
or if you're lazy type node . in the same directory as your package.json and it'll handle where to run for you
Anyone?, I tried saying import PyNaCl and it gives an error Unable to import PyNaCl even though I installed it pip install PyNaCl
Wait for someone to answer
pip install --upgrade youtube_dl
Ty
How can I animate the profile image of discord bot list of my bot?
say random what? and what language/library ?
@raw wharf css
@trim plinth ty
yes
@trim plinth Where do I insert CSS inside the page?
WHen the song finishes why wont my bot leave the voice channel>
@raw wharf long description through <style> tags
async def play(ctx, url):
author = ctx.message.author
voice_channel = author.voice_channel
vc = await client.join_voice_channel(voice_channel)
player = await vc.create_ytdl_player(url)
player.start()```
How Do I make it leave the voice channel when its done
snarkyllama#4331 ty ;D [no more ping
]
you need to pay @gilded plank 3000$ upfront
async def play(ctx, url):
author = ctx.message.author
voice_channel = author.voice_channel
vc = await client.join_voice_channel(voice_channel)
player = await vc.create_ytdl_player(url)
player.start()```
How Do I make it leave the voice channel when its done
its the one on your discord app panel
Hq do you know how to make the boot leave the voice channel
VoiceChannel.leave()
// can put custom stuff that doesn't work properly in run scripts here!
client.on("messageDelete", (message) => {
const content = message.content;
const author = message.author.tag;
const channel = message.channel.name;
const botlog = client.channels.find("id", "ID HERE");
const id = message.id;
const embed = {
"title": "Message from " + author + " removed!",
"description": content,
"color": 9902553,
"footer": {
"text": "In: #" + channel + " ID: " + id + " Guild: " + message.guild.name
}
};
botlog.send({ embed });
});
}```
How do I make this say the channel name instead of ID and have it send it to a channel in all servers called bot log instead of just my server?
why do you want to broadcast globally message deletions
its an option for server admins II dont want it global is the thing
local servers
this was sending them all to my server from all servers
ty
can I use name instead of id?
message.guild.channels.find("name", "name HERE");
so this should work more as intended
client.on("messageDelete", (message) => {
const content = message.content;
const author = message.author.tag;
const channel = message.channel.name;
const botlog = message.guild.channels.find("name", "bot-log");
const id = message.id;
const embed = {
"title": "Message from " + author + " removed!",
"description": content,
"color": 9902553,
"footer": {
"text": "In: #" + channel + " Channel: " + message.channel.name + " Guild: " + message.guild.name
}
};
botlog.send({ embed });
});
}```
or should I edit the client.on to guild.on
channel does not have a name property i believe
so leave it as id
Okay try
should work
Because GuildChannel has a name property
Oh you already have it
how does eris libary bot create a game in chat
no one game to play
?
a code to bot make a minigame in chat
equal to bird game of tatsumaki
You have to create the logic
some libraries have built in ways of listening to messages like the d.js message collector
Ye
and you probably won't find one for something specific like this
So you wanna wait for a message then do something with it?
the easiest way is reading the docs and implementing it yourself
Or raspberry pi
ew no
Well paying monthly is hard
a pi is good enough for most bots
At least for me
if you don't have music and have a stable power supply and internet
Yeah
ok
natan ur smart help
Vps cheaper tho comparing to electrical costs
Paid a year vps about 85 dollars
Electrical bill is waaay higher
Running it a year it used more energy in costs then a vps costs me definitely
https://hastebin.com/neyatokaja.swift
Api.js
https://hastebin.com/ayumaselix.js
It says cl is not defined
oops
ok fixed it
lmao
something something exports and imports
So I'm making a custom prefix command and it says there is something wrong with this line: let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf8")); and the error is ``` (node:2858) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)```
check the json file
no
then what?
then what's inside your json file
nothing.
that's it
maybe thats why 
{}
do u have a db
didnt even log it.
What I heard is its glitch being glitch
so I just removed it
I think ** is a good prefix anyways
https://hastebin.com/epovadumeb.js Invalid Form Body error btw
.setImage("./memes/tf2/" + memes[Math.floor(Math.random() * memes.length)]);
you can't set local files as image
you need to upload them
How would I fix that then? not exactly sure how I'd upload them
how would a bot upload images without a link
attachments
hmm
i don't use discord.js ยฏ_(ใ)_/ยฏ
rip
look in docs
Its MessageAttachments
a
some1 remove the 2 roles
pls
wait how do i have bot developer, my bot isnt accepted yet
-bots <@211649732890722304
@rigid gorge
Whats this even
message.channel.reply
Thats creative
you can
do
msg.channel.send({ file: mphoto })
That should work
ok
@earnest phoenix Did it work?
Yes
its just one issue
it goes back a bunch of tragectories
doesn't see the discordbot.js file
discordbot (attempt) as it is in my pc
but wouldn't
"./commands/memes/tf2/bad.png",
work if its in the commands folder?
Should be fine
Ok
Glad i could help ๐
It didn't work, I had to do this:
"../Discord bot (attempt)/commands/memes/tf2/bad.png",
But, I am glad you tried! Thx
don't ask me why it didn't want to work
what language?
what the hecc
okay
well isnt that for an array?
cus i have objects
how do I make a folder in my project on glitch.com
i guess ill need to load them somehow
.?
Alright so,
I'm programming on sublime
How do I get my bot online?
Prince i am too
(a,b) => do some logic then return 1 if a comes before b , -1 if b comes before a , 0 if equal
You run your bot program
I know you have to use client.login then token (right?)
Which file though
the main file
it'll teach you
I have package.json, auth.json, and bot.js
which file do i put it in
I am making a small library that makes it easier to code but I really don't want people to copy my code, what do i do?
and I do what the API to be public ๐ข
What do i do?
so to make my bot online I need to put client.login ('token') but which file do I put it in
Package.json, auth.json, bot.js
CODE
https://hastebin.com/ogihuzezac
ERROR
https://hastebin.com/fubategepu
ISSUE
I cant find out where its wrong.
and if i did whats wrong?
run your bot with your normal args, but append --trace-deprecation
and copypaste the stacktrace you get when running the command
?
client.on("warn", err => { console.log(err.stack) }) would work also
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
try {
let commandFile = require(`./lib/commands/nsfwCommands/${command}.js`);
commandFile.run(client, message, args);
} catch (err) {
console.error(".");
}
});```
there we go
didnt i already catch the error?
ye console log the error not just "."
i added the .

as a way of ignoring them for ahilw
ok?
i'm guessing it has something to do with whatever you're doing with fs cause normal network io doesn't do that
which file do I put it in
?????????
im not using io or am i confused?
network io = just doing network based things
like that reddit scraper you seem to be using
well the fs is making a file named 4k writing an image to it and sending said image
is there any way to just get the image link and stick it in an embed?
hmm
cause that seems unnecessarily complex
ive been trying that for ages
i cant find one
and the the reddit scrapper seems to only work this way
hmmmmmmm
second please
im perplexed
im gonna log r.body
and see if its a link
i hope it is
because if it is
then ill get what i need
do you really want to use fs for this?
how do you install the discord.py re-write
nvm
Visual Studio Code keeps saying
npm ERR! Callback called more than once.
And it won't work
Any suggestions?
(I am using Javascript)
code
so to make my bot online I need to put client.login ('token') but which file do I put it in
Package.json, auth.json, bot.js
learn js pls
@maiden mantle client.login goes at the bottom of bot.js and bot.js is stored in you're bot file
I am learning js
maybe u just didn't know how to use it
how do u get the png type of a gif avatar of a user?(discord.js)
stable or master?
Can't you replace the gif to ping of the string itself with js
idk about stable since I havent used it forever but on master it is user.displayAvatarURL({format:'png'}) @lament meteor
otherwise do what True Meow said. For example this is my png avatar, by just replacing .gif with .png in the URL https://cdn.discordapp.com/avatars/112001393140723712/a_ca61e2a197ec8c1be5cc18dabe12b762.png?size=1024

it worked!

