#development
1 messages ยท Page 542 of 1
uh no?

Wait
kind of on the same topic but also not, is there any way to use statements with the ternary/conditional operator in javascript? like, an equivalent to ```js
if (conditionWhichHappensToBeTrue) return "I'm dumb"; else {
var a = coolJavaScript();
}
not 100% sure tbh
alright well if anybody comes up with anything ping me, i need to go to sleep
and also IIFEs dont work since they aren't in the right scope/return doesn't return from the function that the conditional operator is in/etc
anyone with eris knowledge know why this isn't working? this.on(event.name, event.bind(null, this));
events don't work
Is anyone aware of a way for a bot to delete the oldest message posted by a user in a channel so that, in theory, they only ever have 1 message posted at a time (unless it exceeds the 14-day limit)?
In practice, I'm using a channel as a means to update players status' and many forget to delete their previous update, so I've been doing it manually for a long time. It would be awesome if a bot could do the majority of that work: @ User_X updates status #1, then @ User_X soon afterwards, updates status #2, ideally #1 could then be deleted automatically.
whats a good lib for requesting websites in py?
Requests? It is blocking for bots so if you want it async use aiohttp
blocking?
scraping or general api requests
requests lib is fine for most things
@fast fjord You could just store the message id of your player status and the author.
you can delete messages by id then and you can check on new messages by the same user
Ahh @lunar knot they aren't editing the same message, but creating a new one - so it would have a different id to my understanding, correct?
@fast fjord new message is new id, yes
I'm just surprised there isn't (or I haven't found) a bot that does, essentially, reverse-purging ๐ค
you could do it yourself easily so yea why having a function for it
Seems like something that would be possible and have a lot of uses
hm idk
more than nice servers i mean
I would bet that a lot of servers have a channel where they wan't to store just the most recent update/message by their users
it could even be used as like a status update
Of yknow, you could just take an entirely different approach to this problem which doesnt require working around api limits
yes?
Yes
I'm not a dev, or a veery good one at least, so it's beyond my capabilities
Anything is possible with some creativity and a little bit of coding
Yeah, I've been working on a bot for months now and can't even set up the hosting
I get clusterfucked by the command-line terminal jargin
the coding i understand mostly
Learning how to properly use a terminal is very useful
i see that
@fast fjord if you don't mind posting sample code, can try to help.
like what you hv done so far
you said you were working on a bot for this so if you need help with some bug, maybe can post code on pastebin or something and post a link here so we can help
oh ok
a database-type bot that stores what users input and outputs it in various helpful ways
for a game
Okay, just putting this out here
Im having troubles with setting up a subdomain. I use namecheap, host with github pages. The main website is working perfectly. I have configured a subdomain with freedns, but github says the dns isnt set up correctly, when its literally configured the same way as the main website
If anyone can help, please dm me
specifically tailored to a certain game
do you mean in a way where it integrates with the game itself?
nope. manually input. users update various aspects and the bot, in theory, tracks and keeps it to spit out at a later time in different ways when needed
It's a mobile game: CATS. They don't make any APIs or anything public. Even their art assets are locked behind hard-to-reach containers.
which is more my area. I'm a Graphic Designer
But I'm the leader of a prominent gang with a large discord (for the game - 200+ ppl), and I'm always looking for ways to improve the user experience for my members.
Hey anyone know how to loop a song 1 time in discord.js
just modify this a bit
and there you go

(please be aware that the code was NEVER tested lmaooo)
LOL
tbh xig its not spoonfeeding its literally just template
Shh don't ruin my moment 
Just wanted to make sure theres no way to make a RichPresence like a game could have for a bot right?
okey thx
my code:
import {prompt, ui} from 'inquirer';
prompt({
name: 'name',
type: 'input',
message: 'Whats ur name'
}).then(ans => {
console.log(`Hello ${ans.nev}`)
})```
error:
```(function (exports, require, module, __filename, __dirname) { import {prompt,
ui} from 'inquirer';
SyntaxError: Unexpected token {```
the error is on the { after import
can anyone help?
it worked perfectly in the example i copied, and works perfectly if i import only prompt or ui, but not if i import both
or babel
@mossy vine fucc i finally got toLowerCase() to work
lmao
You only just got that to work oof
please be more specific
I have to tag the rol @OWNER but in all servers id is diferent, some one knows how to tag the rol with bot?
@earnest phoenix what lib?
discord.js, ok
message.channel.send('<@' + message.guild.ownerID + '>')
@earnest phoenix
no
Like message.channel.send ('<@' + OWNER + '>')
the code i sent will tag the owner of the server
but how a rol?
most servers dont even have an owner role
this will tag the owner of the server
if you run the code here it will mention oliy
since he owns the guild
(btw dont tag oliy he will be mad)
((and youll probably get muted))
@earnest phoenix
var ownerRole = message.guild.roles.find(role => role.name === ("Owner"));```
("name", "Owner") would work aswell, wouldnt it?
I use it
it does
Ahh, alright
ahh
Find isn't deprecated, not using a function in find is
I mean it's been working just fine for me for the entire time I've been making bots.
Deprecated doesn't mean doesn't work
what do I put?
The non-deprecated way
It will continue to be supported
so ...role => role.name...
idk about deprecated, it's more like dropped completely
@amber fractal Are you looking at the stable or master doc
Which d.js is he even using
Stable, why would I look at a version I dont use 
@amber fractal
This ``message.guild.roles.find(role => role.name === ("OWNER"));
?
It should work
You have to put it in exact, also you dont need the extra ()'s around the "OWNER"
It doesnt
Whats the error
What is it you're trying to do?
I need to @ the owner rol
Is that possible?
This isn't directed towards anyone. However it is a good read if you are asking for help / providing help. http://slash7.com/2006/12/22/vampires/
Just another WordPress weblog
Yes its possible
Sorry, c = cutie told you a way to do it right, did you try that?
@earnest phoenix
var owner = message.guild.roles.find(role => role.name === "Owner");
message.channel.send(`<@${owner}>`);```
Try that bad boy
@amber fractal my name is Cyber

how do i make my bot look like its playing a game

@earnest phoenix read ๐ the ๐ docs ๐
you need to spend a minute in the docs to find the answer
you can send a playing status through discord
spooder i'm sorry for the spoon feed
its a method
๐ docs ๐ the ๐ read ๐
its fine :p @buoyant void
docs = the bibbl
yes
pretty much
setGame deprecated
it should be setPlayingGame
@buoyant void no
setPlayingGame? where did you get that from lmao
space
oh juicy, full screenshots
something wrong?

yes
did you read the error
you need to learn javascript
^^^^^^^^^^
I need to learn a bit more, my first bot
this kid doesnt even know what javascript is, he is just copypasting code
It's outside message's scope
everyone starts somewhere :<
^
learn the language first, then make a bot
^ yes natan
start with the basics
I learned the basics of JS, then used bots to learn more
It's what I always go to for to learn new language capabilities, is build a bot usually
I'm just in a computer science class. Then I read the docs or ask questions on here or stackoverflow 
The computer science class taught me nothing
Its a waste of time
I'm self taught (by stack overflow)
i got it (thank you)
Someone how to catch player guilds from o2auth with a $response (i can have name, id, discrim, etc but not guild).

Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
why do people act worse than a 9 year old, you have internet, do research for yourself
I demand to be spoonfed
Is there any method to tell how many cases are in a switch statement?
uhm, i dont think so
s a d
does discord support base 64 in embed thumbnail?
@earnest phoenix what do you mean by that?
I don't believe so
just a question
What do you mean by base64 in embex thimbndiland
base64 data image in thumbnail
no
but you can upload the image as an attachment
and use attachment://FILENAME.EXT
as the url
hello does anybody know how to fix this error http://prntscr.com/lzxesj please ๐ฆ
that doesnt really have any info
need the whole error mate
still doesn't give any info @slate kayak
css mate
@keen drift are you aussie now mate 
For anyone wanting to do a css background
Normal version
body {
background-repeat: no-repeat;
background-size: cover !important;
background-attachment: fixed !important;
background-image: url("https://linkhere.png") !important;
}```
Dark overlay over background (Better for bright wallpapers)
```css
body {
background-repeat: no-repeat;
background-size: cover !important;
background-attachment: fixed !important;
background-image: url("https://linkhere.png"),linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)) !important;
background-blend-mode: overlay !important;
}```
can this be improved
@sick cloud What do you mean improved?
Nicer?
i added spacing
ok
like easier on the eyes? idk
meh, thats the terminal for you.
Could make it a multiline thing like
client.on('ready', async () => {
console.log(`Connected To Discord as ${client.user.tag},\nID: ${client.user.id},\nGuilds: ${client.guilds.size}`); // And so on
});
but changing how it looks really depends on what terminal you use.
i don't really need to know the guild count, but alright
Hey guys, I'm using JDA and I'm unable to find a method to send a dm to a user and would like some help or advice
this is my logger rn
const { grey, white, red } = require('chalk');
module.exports = async (message, error) => {
if (!error) {
return console.log(`${grey(`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`)} \n${white(message)}\n`);
} else {
return console.log(`${red(`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`)} \n${white(message)}\n`);
}
}
And this works?
sure does
@solar belfry i am not the best with JDA but isnt it something like event.getAuthor().sendMessage("Message").queue();
thats if you want to do it on a command
I'm looking into it^^ thanks for now
Itellij?
Jetbrains IntelliJ
Yeah
A okay... Why not Eclipse?
ew 
Because that shit aids, personal pref
i dont even do java and eclipse is ew
Well I found c# is not so good for development thus I changed to java
@sick cloud can i ask: javascript return console.log(`${grey(`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`)} \n${white(message)}\n`); Why need date?
Yeah c# is meh
date is useful
also specifically for looking at times between things
like here
i can see it took 6 seconds to connect
ah thats why then...
Windows is meh only really good for gaming
linux alot better for code
and mac bin that shit
my parents wont let me install it on any good PCs
clean output ๐๐พ
the best i have is an old xubuntu copy on my old dead laptop
also i have windows 10 pro, which is okay
meh
i'd try install ubuntu to an EXT drive
but i cant
partitioning is annoying as hell
and it might modify my boot thing
Its annoying as hell if doing on the same drive
Yeah it'll modify boot, but doesn't mean can't get into windows
wew
lmao, its not like you are breaking it
some parents
Yeah...
they dont care
this is an interesting chat
is your dad bill gates, not wanting anything other than windows?
Hi
my dad knows shit about PCs and my mum thinks linux is a virus and mac is the future
mac of all things
may I ask why mot bot doesn't have perms here
@next scaffold bots only work in testing channels
Mac is the opposite of the future
just install mac then
lol
ik
mac is not that bad
muted
mac is kinda terrible
i'd love to switch to macos if I don't have to go thru this hacktosh thing
macos has a nice UI
Thats all it has
I remembered when i used linux
I love to hop on macos, it'll make my development so much easier
i had too much power and fucked it up
than this windows crap
Yeah windows is shit
https://elementary.io/ i LOVe elementary
love
its awesome
looks like macos
Looks like mac a lil
Ye
looks like malware
ok
its like buying a Chinese phone that says ios when its clearly just android with a skin
hue
?
Elementary is Ubuntu
its based off the latest ubuntu
and its real nice
Juno has dark theme
^
which is nice
i rather use debian with kde instead of a bunch of unneeded shit installed on ubuntu
meh
I need a little help actually, i lack the creativity and was wonder if you had any ideas of what commands i could code for my bot.
Lmao
I need help
So my bot was muted for responding to all three-letter prefixes
but now I fixed it, so can my bot be unmuted please?
@normal bramble
A hex one
#36393F
Quick stupid question. How do you put a small image in an embed's title? 
which language
use an emoji
lol
Makes sense
add the emoji to a private server, add the bot to said private server, make bot use the emojis id
I've seen people put people's pfps in titles / footers
no need
oh, that
Discord handle avatar in embed author
thats the embed author
Makes sense. Thanks
idk what language youre using but in d.js its .setAuthor()
Assuming people use embed builders
smfh
that's why I asked which language he use x)
idk i personally use this really handy script i stole from someone else but modified it
exports.createEmbed = (title, description = '', fields = [], options = {}) => {
let url = options.url || '';
let color = options.color || '3498db';
if (options.inline) {
if (fields.length % 3 === 2) {
fields.push({ name: '\u200b', value: '\u200b' });
}
fields.forEach(obj => {
obj.inline = true;
});
}
return new RichEmbed({ fields, video: options.video || url })
.setTitle(title)
.setColor(color)
.setDescription(description)
.setURL(url)
.setImage(options.image)
.setFooter(options.footer ? options.footer : randomFooter())
.setAuthor(options.author === undefined ? '' : options.author)
.setThumbnail(options.thumbnail);
};```
epic thing. Bookmarked
basically, yeah
Thank
ur welcome
you can't set video btw
that's a gross embed builder
.
import discord
from discord.ext import commands
TOKEN = 'Your bots token' #You can find it here https://discordapp.com/developer/applications/
client = commands.Bot(command_prefix = 'Your prefix')
@client.event
async def on_ready(): #This function turns on the bot
print('Bot is online')
client.run(TOKEN)
@knotty steeple I do know how
Lemmie give u my code with cog
My code is lost
Never mid
When I say I can do stuff no one believe
So I don't give a fuck about what u wanna say

how could i assign role to user when user reacts to message with specific emoji
@earnest phoenix what language and library
reaction collector
discordjs
ok
that isn't it
oh ok
no discord.js i think
im trying to figure it out
I have this error ```#
Fatal error in, line 0
API fatal error
#```
Wtf is this?
that's not a discord.js error
Why on status.discordapp all status are operational
because they are?
your internet is dead or some shit
anyone here used lavalink with amazon aws?
so im hosting lavalink on amazon aws ubuntu 18.04 LTS,
i initialise it
it does without error
but when i try to connect to it i cant
@earnest phoenix
(node:4020) UnhandledPromiseRejectionWarning: TypeError: Supplied parameter was neither a Role nor a Snowflake.
What commands you want to make?
simple
add role
That roleatoAdd is a string
Its not a role or snowflake, like the error said
auf wiedersehen
No he is want to give a role with a command @knotty steeple
the flipping lagggg
Just one command for one role
it doesnt ffs
im off 
i know that
i tried so many things


you can find the role by name and get the id

how
@earnest phoenix you want to make a command exemple !addrole @member <name of role>?
message.guild.roles.find().id
in find you have to use a function
arrow function
so like
message author gets role
role => role.name === "69"

:)
UnhandledPromiseRejectionWarning: TypeError: message.author.addRole is not a function
reeeeeeeeee
Lol
what am i doing wrong
message author is a user
not guild member
the person you are adding the role to must be a guild member
so, user.addRole?
can you give me example
.member works
user.member
message.member
DeprecationWarning: Collection#find: pass a function instead
refer to my last post
Use an arrow function
i linked this did you even read it?
Or djs docs collections > find
Youll get more out of mozilla dev page tho
im reading
i get this error
DeprecationWarning: Collection#find: pass a function instead
but its working ;d
Deprecation warnings are just warnings, the support for finding without a function is no longer supported
It's removed in future versions
this should make the bot avatar round right?
yes
overrides any other code
np
now i need to make it jump
want my float anim?
ya
.bot-img {
width: 150px;
height: 150px;
box-sizing: border-box;
border-radius: 50% !important;
border:2px solid rgba(0,0,0,0.6);
overflow: hidden;
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
animation: float 6s ease-in-out infinite;
img { width: 100%; height: auto; }
}
@keyframes float {
0% {
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
transform: translatey(-20px);
}
100% {
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
transform: translatey(0px);
}
}
spoonfeed
lol
i asked and you said yes 
oh i didn't see 'my'
xd
removing it now tho
looks very nice
Thank you
tbh... every bot now...
the bg of the bot page is an anime
tbh u should hide the donate button
ยฏ_(ใ)_/ยฏ
learn css specificity insead of abusing !important lmao
lmao
h
Can we add our bot log and other shi5?
read ๐ the ๐ docs ๐
what
wrong channel
i wonder what the context of the roblox picture was

i like how they drew a red circle around the only thing in the image
ikr
anyone able to help me fix this? https://hastebin.com/gujeyayehe.coffeescript
im trying to set it so if there is no report channel set it will put that string into the embed
it works if the channel is defined
if not then it doesn't
i just would like to display that string, im not asking you to tell me to change my storage usage
if(!(rcs[message.guild.id].rc)) {
let reportsetting = "No report channel defined."
}```
it cant find rc because there is no rcs[guildid]
there is an easy hack to fix that
(rcs[message.guild.id] || {}).rc
basically its a shortcut to checking if rcs[guildid] exists, if not, return an empty object, then check for rc on the result
@zinc pawn
thanks
hm no still claims its undefined. have I done it right @quartz kindle? https://hastebin.com/xupukayolo.js
move the reportsetting inside the if
the line 7 bit?
you can set reportsetting as an empty variable, then assign it later depending on the result of the if
yeah
let reportsetting = message.guild.channels.find(c => c.name === rcs[message.guild.id].rc);
let reportsetting = "No report channel defined."
}``` that won't work though? reportsetting is defined twice?
dont define it twice
let reportsetting;
if(rcexists) {
reportsetting = rcexists
} else {
reportsetting = rcdoesntexist
}```
or you can simplify it even further
let reportsetting = (rcs[message.guild.id] || {}).rc ? valueifrcexists : valueifrcdoesntexist```
@zinc pawn
i've tried following the guilds/[guildID]/members/[memberID] path but that's returning a 404 for put and get
oh
nevermind
i'm an idiot
FUCK
@knotty steeple I've never heard that one before(!) I'm working on getting it working first then making it neater later
@high anchor 
Is https://discordbots.org/api/docs#golib broken?
@kind nexus whenever you ask a question always say what lib you're using
@earnest phoenix i dont think so but for api help go to #topgg-api (say specifically what the issue is)
@knotty steeple google cloud realtime DB is a giant json tree
@earnest phoenix outdated link
@keen drift what do you mean?
oh sorry i must have posted the wrong link, i meant the page where you can create tokens, it says i donโt have a bot but i do
well is it approved
try it
ctrl + f debug
ok thank
Anyone who uses discord.js online?
I'm testing out voice but I'm getting this error:
Error: FFMPEG not found
I installed ffmpeg and listed it as a peer dependency but it's still not working
npm i ffmpeg-binaries
np

same

How should I go about in making anti spam? With spam being something like
a
a
aa
a
on message look for a users last message, ig if its close enough and x+ messages
How do i make discord bot work?
You're kidding?
ahh... no?
yes
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
});
client.login('token');```
This is the basic example of discord bot
?
Just look videos on youtube or read docs @ember shard
how do i open JS
Do you have a text editor? Like atome, visual studio or sublime text?
will Microsoft word work?
Hum i dont know i dont try it
ok
Just look videos on youtube for creates your first bot and learn a little bit how to make that
ok
lmfao
@ember shard https://discordjs.guide
A guide made by the community of discord.js for its users.
read it
it'll teach you how to make a bot
Has anyone made a contest bot? @dapper cargog or message me.
a contest bot? what do you mean by that @rocky dagger
@ember shard dont start making a bot yet
you have to learn the basics of js
because you dont even know a text editor to use
^ to be clear afaik you cannot code in word, try visual studio code or atom
https://www.sololearn.com/Course/JavaScript/
https://www.codecademy.com/learn/introduction-to-javascript
@knotty steeple I learned from sololearn but I had experience with programming languages before
It's kinda hilarious that the first language I used was php
The first I've learned was ASM 16bit
I sound old
how do i get the number of servers my bot is in to show up? 
right now it just says N/A
@carmine crane What lib did you write it in?
discord.py with version 1.0
Rip I guess I can't help with that one 
how does it work on discord.js? maybe i can work from there
const DBL = require('dblapi.js');
const dbl = new DBL(DBLTOKEN);
dbl.postStats(client.guilds.size)
.then(() => console.log("Posted Stats"))
.catch(error => console.log(error))```
hmm i guess this here would be the python alternative?
https://github.com/DiscordBotList/DBL-Python-Library
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
Indeed
thanks for the help! 
Didn't do anything No problem 
@carmine crane post to the api yourself
with aiohttp
pls
i think the py library is broken rn
oh okay
you've got an example for that maybe?
#312614469819826177 @carmine crane
Yes but he/she wanted an example
irrelevant
thanks i think i'll be able to manage from there 
Should I add dbl api to my bot ๐ค
Do you want server count on the site?
Ill just do it now so I dont have to do it later
The only problem is: attempting to install npm modules on a chromebook...

Don't run ur bot on ur computer smh
Why would installing npm modules work tho
All my code is on github... I need to install it then upload the file to my node modules
thats how I get all my modules
Also it should probably work anyways since chrome os can run linux apps
don't code on a school Chromebook smh
I have nothing else at the momeny
moment*
Im in the process of buying parts for my new computer
I just have to wait for school because they have computers there and I already installed node and git on it
you can easily post your server stats without any module
make the post request your self
maybe if I knew anything about it ๐ค
.
Ik, idk how to do it tho, never have
you can use node's http or any http library such as snekfetch/request/etc
I still need to download those though, dont i?
snekfetch is outdated
Ill look into it thanks
check this example
scroll down to Giulio Roggero's answer
its clean and well commented, while most other answers are basically "use a better library"
It gives me error unauthorized, i generated a token just no idea where it goes
Ive never done posts or requests before
a header is a separate part of the request
then read docs rather than diving blind
"Im in the docs.."
but you arent reading them
Guys don't be dicks.
and no, skimming isnt reading
Help him instead of saying the same thing over and over.
show us what you tried @amber fractal
show the code you tried
Trying one last thing
server_count: bot.guilds.size
});
var options = {
hostname: 'https://discordbots.org/api',
port: 80,
path: '/bots/524286767373877253/stats',
method: 'POST',
headers: {
Authorization: dbltoken
}
};
var reqPost = http.request(options, (res) =>{
console.log("statusCode: ", res.statusCode);
res.on('data', function(d) {
console.info('POST result:\n');
process.stdout.write(d);
console.info('\n\nPOST completed');
});
});
reqPost.write(postData);
reqPost.end();
reqPost.on('error', (e) => {
console.error(`Error: ${e.message}`);
});```
new error now tho too `Error: getaddrinfo ENOTFOUND https://discordbots.org/api https://discordbots.org/api:80`
port 80 is http only, https uses port 443
also, to use https, you need to use node's https library instead: require("https")
i dont remember if dbl accepts http or only https, but in any case its better to use https
so ```js
const https = require("https");
req = https.request(options, etc...)```
I tried that at first
Ill do it again
{"error":"Required parameter server_count or shards missing"}
Post data: {"server_count":8}
hmm
it should be number
Or array of numbers it says, but I dont see the issue
maybe it needs the post body to be in querystring format?
content type must be json
yes
status code 200
it worked then
I think
POST result: {} POST completed is what my console says
check the website
awesome :)
And now i know something about posts
Thonk why does Content-Type have to be wrapped in ' but Authorization isnt xD
because of the -
that makes it an invalid identifier
so it must be wrapped in quotes
Good to note lol
in case of doubt, just wrap everything in quotes
'"THINg"': '"YAY things"'
Is there a equivalent to broadcastEval for eris
same tbh
Hey guys, could someone help me to create a function that send every messages to a log channel ?
i don't know if have any command in the discord.py
ty โค
No need for a broadcastEval in Eris. It's only one process which is why you can use the Shard collection stored in the client
Oh, so client.shards or somthin
raw data for music commands please

im trying to get all channel ids and names in an array using the code below, but it only pushes the last chanobj a ton of times
client.on('ready', () => {
client.channels.forEach(chan => {
chanobj.name = client.channels.get(chan.id).name
chanobj.id = client.channels.get(chan.id).id
console.log(chanobj)
chans.push(chanobj)
})
console.log(chans)
})ห```
oh nice syntax highlighting discord
chans is the array and chanobj is supposed to be temporary
where is chanobj declared?
maybe declare it inside of the loop
No problem :)
alright, ran into yet another problem
appearently client.channels.get('channelid').send('message') doesnt work, when i console.log `client.channels.get('channel.id') it works, but doesnt send anything
library
d.js
but i dont want the guild
try it
it wont be u s e r f r i e n d l y
p l s
i need to do it like this
client.guilds.get("currentguild").channels.get("channelid").send("hello")``` 
everything works but .send
no i used to be able to do it like this
okay im doing that right now and still doesnt work @knotty steeple
client.guilds.get(client.channels.get(CHAN).guild.id).channels.get(CHAN).send(ans.message)
CHAN is the id if the channel
it logs the guild perfectly, logs the channel.get perfectly, but still doesnt .send
๐ฉ

@mossy vine Wouldn't just client.channels.get(CHAN).send("Message") work?
Wait what you trying to do?
do people not read the past messages
im trying to get the bot to send a message to a specified channel
well I think trying very complicated things isn't gonna help
Is ans.message null?
where do you get the channel from? Is it a channel ID or a complete channel object?
nope, ans.message is a perfectly fine string
its a channel id
as i said above
again, everything is perfectly fine except .send
"do people not read the past messages" no, we dont. And i cant help if i dont know what it is that they is trying to do, or atleast have an error message
and you're sure the channel id is from a valid text channel where the bot has the right read/write permissions?
yes, i am sure
it works with a message.channel.send but i am running this in the ready event
how do i do that?
Trying to get all channels by ids and names?
Learn how promises work. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
again Steven, client.guilds.get(CHAN.guild.id), client.channels.get(CHAN), client.guilds.get(CHAN.guild.id).get(CHAN) all work perfectly
yet .send() doesnt
Error?
It must error if it is not successful
You have an error
Maybe you are catching the promise rejections and not logging it
Must not be logging it













