#development
1 messages · Page 452 of 1
can you help me plz ?
idk, is there @unreal plover
Some errors
Y have a probleme with my canvas
at Client.bot.on (/home/nanobotpro/index.js:49:27)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at Guild._addMember (/home/nanobotpro/node_modules/discord.js/src/structures/Guild.js:1142:19)
at GuildMemberAddHandler.handle (/home/nanobotpro/node_modules/discord.js/src/client/websocket/packets/handlers/GuildMemberAdd.js:12:13)
at WebSocketPacketManager.handle (/home/nanobotpro/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/home/nanobotpro/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/nanobotpro/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/nanobotpro/node_modules/ws/lib/event-target.js:120:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at Receiver._receiver.onmessage (/home/nanobotpro/node_modules/ws/lib/websocket.js:137:47)
at Receiver.dataMessage (/home/nanobotpro/node_modules/ws/lib/receiver.js:409:14)
at Receiver.getData (/home/nanobotpro/node_modules/ws/lib/receiver.js:347:12)
at Receiver.startLoop (/home/nanobotpro/node_modules/ws/lib/receiver.js:143:16)
at Receiver.add (/home/nanobotpro/node_modules/ws/lib/receiver.js:117:10)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:607:20)```
@tardy viper install canvas@next, that function only exist in next version afaik
how to installe the next version
npm i canvas@next
or
yarn add canvas@next
ok
- Missing “();” at
new Discord.Client - Missing ; at line 6.
- At line 12, youre missing ; at “})”.
@unreal plover
I dont understand
@steel heath no
error
(node:19364) UnhandledPromiseRejectionWarning: ReferenceError: applyText is not defined
at Client.bot.on (/home/nanobotpro/index.js:64:5)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:19364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
They just told you what you're missing.
what do you not understand?
Deal with it urself, i aint spoonfeedin 
I don't think applyText is a thing
?
You might need to learn up about how to write in js before trying to write a bot in js.
i wrote ?
When will I get an answer on my bot?
I'm talking to RantHomeZ
😦
Not Lewan.
@young mortar did you resubmit with a readable description?
Using spaces and proper formatting?
Is this what you meant?
const Discord = require(“discord.js”)
const bot = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`)
});
client.on('message', msg => {
if (msg.content === 'hi') {
msg.reply('Hello!')
}
});
client.login('sercret')```
If not, when it gets back to the top of the list it could get declined again.
yes
@steel heath Can you help me I do not know what to put in place of applyText
You should stop mentioning me lol
@unreal plover Correkt
Check the docs it was something like fillText()
ok i test it
@young mortar no you haven't, please fix it.
I don't remember I just told you these functions do not exist in stable
😫
Can i have code examples?
No, u can learn more about bot coding here @unreal plover https://anidiots.guide
Your examples are avalible there
OK, so you'll need to actually go look at the guide and stuff.
Good luck
😦
``` ctx.font = applyText(canvas, ${member.displayName}!);
ctx.fillStyle = '#ffffff';
ctx.fillText(${member.displayName}!, canvas.width / 2.5, canvas.height / 1.8);
node-canvas
so can you help me ?
is applyText a function you made?
I don't see an addText for canvas here though
So I'm wondering why you're using that
the code of my code is at the finally of this page
A guide made by the community of discord.js for its users.
fillText is the closest that I see.
no don't work
Yea, it mentions that it is buggy right now
But there is no addText
in the docs here
in the link you posted, there is this
const applyText = (canvas, text) => {
const ctx = canvas.getContext('2d');
// Declare a base size of the font
let fontSize = 70;
do {
// Assign the font to the context and decrement it so it can be measured again
ctx.font = `${fontSize -= 10}px sans-serif`;
// Compare pixel width of the text to the canvas minus the approximate avatar size
} while (ctx.measureText(text).width > canvas.width - 300);
// Return the result to use in the actual canvas
return ctx.font;
};```
its a custom function
but you dont need it if you're going to use a fixed size font
OK, that explains why I'm not finding it 😛
@quartz kindle I don understant ?
lol
dont copy code if you dont understand
bot.on('guildMemberAdd', async member => {
const channel = member.guild.channels.find(ch => ch.name === 'join_leave');
if (!channel) return;
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('/home/nanobotpro/fondnoir.jpg');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
// Slightly smaller text placed above the member's display name
ctx.font = '28px sans-serif';
ctx.fillStyle = '#ffffff';
ctx.fillText('Bienvenue sur le serveur,', canvas.width / 2.5, canvas.height / 3.5);
// Add an exclamation point here and below
ctx.font = applyText(canvas, `${member.displayName}!`);
ctx.fillStyle = '#ffffff';
ctx.fillText(`${member.displayName}!`, canvas.width / 2.5, canvas.height / 1.8);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
channel.send(`Bienvenue sur le serveur, ${member}!`, attachment);
});
addText is not a function, you have to make it yourself, you ned to use fillText.
my code
yes
this part applyText(canvas, `${member.displayName}!`);
does not exist in your code
either make it, or remove it
I was reminded of making dbl widgets and the fun I had making them
not sarcastic
it was actually kinda fun
some bits
my bot makes heavy use of canvas, and lots of weird math
for those circular charts
How do we invite the bot to your server
the most frustrating part was when I was trying to load an svg image and use it
I think I ended up making a large png instead lol
yeah canvas works with pngs mostly
Help
disable this checkbox
can you help me to create a system to activate a commande on just one serveur or ..
check server id
@quartz kindle the weird part was that while looking for help online others were doing it fine
with canvas?
yea
i have won
well idk, i havent tried working with svg
to use canvas
my canvas is entirely generated without any external image
even tried weird stuff like loading into a buffer and using that buffer as a source for an image
I only needed external images for the avatars and the certified badge (svg)
you could convert them to png or to base64 and have them embedded in your code
embedded base64 would get rid of disk i/o as well
assuming you dont need to resize it
can you help me to create system activate or desactivate
activate or deactivate what?
you can choice to no ue this command on this server or use this command
with a activation or desactivation
you need a database
then you need to add the server id to the database
and save if the server is enabled or disabled
its difficult because you dont have enough knowledge or experience, so you need to learn/study more
Can someone help me with bot's join message? I need to send a "welcome" message to a joined server. Ex. - Tatsumaki (BOT)
like:
CHANNEL.SENDMESSAGE("Hi! I'm a bot! Thanks for adding me to your server!")
});```
it's TatsuBot code
BUT IT DOESN"T WORK
Lol that's very old JavaScript from when @slender kestrel was actually open source
yep
I am op af
Yes lol he is
Op af
hmm whos op-er than u
None is more op than @bitter sundial

Oily isnt more op?
oliy*
i read it wrong
Lol I thought your keyboard fucked up and autocorrected you
@dull breach is basically channel.send("hello") but first you need to get a channel, like in which channel is the bot supposed to send that?
you can probably do something like channels.first() to get whichever channel happens to come first
channel.sendMessage() @dull breach
sendmessage is deprecated in discord.js
its .send()
client.sendMessage(channel, "hi") ???
unless you're using eris or something else
no, discord.js
channel.sendMessage('hello'); or channel.send('hello');
i've seen something like (variable) = bot has permission SEND_MESSAGES in channel
ah ok ll try B https://stackoverflow.com/questions/51447954/sending-a-message-the-first-channel-with-discord-js
interestingly, according to that link, .first() does work if you use channels.sort().first()

according to the docs, .first() should work with channels too
yeah it should
ok thx @quartz kindle
but in his example it didnt for some reason
yeah that might be
like, it will turn into category.send or voicechannel.send
which dont exist
ye so you'd need to filter categories out first
idk if it's possible in d.js, but in d.py you can choose to either get a list of all channels or a list of specific type of channels
yeah not natively, you have to filter it yourself
anyone knows how to use RPC with the new development portal?
There's a section for that in the sidebar
yea but where do I enable it?
set the images
etc
this is only rich presence visualizer
it's already enabled for all applications now I think
and yea theres a subsection for art assets
im using discord bot maker and the mod about music dont working whats the solution
Don’t use discord bot maker.
waow why
That’s the solution
i dont know coding
I suggest learning
you are cruel
unfortunately he is right
discord bot maker might be a fun experience, but in the end its just a toy, you cant make a serious bot with it

My friend uses DBM he says it is way easier than python
He used python before DBM
of course its easier, its made for noobs
but python is a fully featured programming language which can do anything
dbm is just a tool that can do a few things and has a lot of limitations
How to get a token of weeb.sh?
If you think that you should also be a part of weeb.sh, feel free to write us at devs@weeb.sh```
Yes
Ok .thx!
You must send an email to the developers, their api is not public
ok.
is it possible to let my bot make a invite link for me from the guild is he joined
?
it should be, as long as the bot has invite permissions
oke now i need to figure out how ^^
Yo im trying to connect discords gateway with ws module but i dont know how to use it i tried to identfy but the websocket closes can someone help me
With a method like Server.createInvite
you may want to read the documentation about connecting to the gateway: https://discordapp.com/developers/docs/topics/gateway#connecting-to-the-gateway
you first need to get the gateway and then attempt an identify 
Hey, i found this part of code in the discordbots tutorials (https://medium.com/discord-bots/how-to-make-a-discord-moderation-bot-in-java-44a534a32474)
Role muteRole = guild.getRoles().stream().filter(r->r.getName().equals("Muted")).findFirst().orElse(null);```
`
what is that part ``r->r``?
supposed to be a greater than sign
it's html escaped
ye i would lly like to know what it is it that it meant to be here
I'm having issues loading images onto an embed with eris, I'm using an image object and i set the url to load the picture from my localhost server (http://localhost:8080) but when the embed displays it shows a placeholder picture from discord, can someone explain why this ain't working?
I have the pictures stored in a folder called media, i set the server to load that folder
if i visit the server through the browser it shows correctly
that's not really how discord api works, if you want to do something like that you have to download the image to a resource accessible by discord and pass that
like imgur
That sucks
or you upload it as a file
he/she can
ronin pls
hehe
Well node can access it
Discord can't i guess
Makes sense
So if i like get a domain and put a server on it using node then discord can access it correct?
Not a local host domain that is
well you can work-around it i mean
Yeah, you can even use GitHub Pages as a CDN kinda
does github pages actually allows you to do that
iirc github doesn't like to be used as cdn
I have images hosted on my GH Pages that I use in commands
you could just run a smol webserver to serve the images alongside your bot if it's on a VPS or something
My bot is setup on localhost right now lol
are you sure you are following all the steps
also you should check out the error code discord returns
I am trying to understand
it should give you a lead on what you are doing wrong
I need some info about the module I am new to websockets
does anyone know how patreon bot assigns roles? if I have made it to assign 3 roles on a specific tier does it trigger 3 separate on_member_update events or does it do that in one?
not sure
Roles undefined...
let patreonPlusRole = client.guild.roles.get("471259869085827072")
is it role.get?
client,guild is not a thing
What about client.roles.get?
You have to get the guild.
yes
Lol trying to get the guild of a client? 
I mean you can try and get the guilds the bot is in
But there is no way to get the client's guild because it doesn't exist
Anyway what's the best way to contact discord support? I'm having bot avatar uploading issues with the new dev portal
dont advertise
@scenic axle in case you havent noticed, advertising will get you banned, i suggest you delete that post immediately
The edit lol
Looks like they don't care, do they?
probs a throw away account or they really just came here to do that then leave
I personally would leave it up to mods :^)
same
case 'setlogs': {
if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send(nuaiacces)
if (!message.mentions.channels.first() && args.join(" ").toUpperCase() !== 'NONE') return message.channel.send(folosesteaga)
let newChannel;
if (args.join(" ").toUpperCase() === 'NONE') newChannel = '';
else newChannel = message.mentions.channels.first().id;
db.set(`logChannel_${message.guild.id}`, newChannel).then(i => {
message.channel.send(afostsetat)
})
};```
I want to set up the event channel
message deleted
message updated
when I set the logs on a channel
and I want to send the event, tells me that no channel has been set
I'm using the latest version of quick.db
6.3.2
if I use version 3.0.3, quick.db, it works but they can not make the economy system because it's the latest version
What does this mean?
(node:4492) MaxListenersExceededWarning: Possible EventEmitter memory leak detec ted. 11 guildMemberUpdate listeners added. Use emitter.setMaxListeners() to incr ease limit
@earnest phoenix, you have too many guildMemberUpdate events and it's causing a memory leak.
ok thought so
it doesn't cause a memory leak certainly, its just a warning so you're aware you are listening to the same event more than X times (10 by default) which might result in a memory leak if unintended, you can change the X using setMaxListeners either to the emitter or in the process (catch-all)
what is an alternative to canvas i can use?
@knotty steeple jimp is stand alone and way faster also not a truck on dependencies to setup
some people say jimp is slow
@shy rose
especially windows
ubuntu got me
which i am trying to install it on now
bloody spent a day on it

cario cdn died that makes it fun
jimp is slow if you read images from disk all the time
if you do everything in memory, then it should be close to canvas
there's also sharp which looks very good on paper, but i havent tested it
sharp speed is really comparable to canvas
Tbh if you don't want to spend time setting up stuff you could use prebuilt
If sharp native though or is it binding cause afik jimp was only native one on that graph
sharp uses libvips
idk if natively or not
jimp is the only one who is pure js tho
how to install discord.js v12
Hi
@knotty steeple
`To install and use the Discord.js master branch:
Without voice support: npm i -S discordjs/discord.js
With voice support (node-opus): npm i -S discordjs/discord.js node-opus
With voice support (opusscript): npm i -S discordjs/discord.js opusscript
If you use yarn:
Without voice support: yarn add discordjs/discord.js
With voice support (node-opus): yarn add discordjs/discord.js node-opus
With voice support (opusscript): yarn add discordjs/discord.js opusscript
You need Git for this to work:
Ubuntu/Debian: sudo apt-get install git
Windows: https://git-scm.com/download/win
Documentation: https://discord.js.org/#/docs/main/master/`
why did you have to post all that
i am in it
did you have to post all that in single quote blocks?
@knotty steeple thats the evofficial one
https://discord.gg/bRCvFy9
can you like stop mentioning me on every message pls
also im not joining if im never going to ask anything
so if i have something about bot dev ill just ask/say here
Does anyone know a permission node that checks if the user is the Server Owner?
like ADMINISTRATOR or something
there is none
how
ok what lib
discord.js
discord.js gives you guild.ownerId
Gud when internet lags out and shows u the conva 40 secs later
Lol
if(!message.guild.member(guild.owner)) return message.channel.send(`You are not the server owner!`) would this work?
i don't think so, if you only want to check the owner, you should rather compare the guild.ownerID property with the message's author id
ah ok
Is there no way to make mobile embed titles a different color?
My embed's main color is red and i don't like the blue title with red color embed
But i want to use the title object
message.channel.send({embed: {
color: //color integer here,
description: ("Embed")
}});```
should work on mobile and pc
ah
Mobile embed titles are blue by default
make the title a URL, that redirects to no website
Aren't urls blue
yes
so in a RichEmbed, it would be something like `.addTitle("Title", null)
But guess that won't be possible
you can only do blue
I'm not using rich embeds
you can only change title color in RichEmbed()
however, you can mak a title a color if you put it in a code block
for example, green text = css
so: css This is green text
there is no other way
all i want is to change the embed title color to white
but nevermind
seems like its a no go
mhm
ye
maybe they just strip the markdown.js from it
Lol probably so
On mobile embed titles look blue
By default
On pc they're white
I wonder when discord is finally going to make mobile embeds look like pc embeds
also for embed titles you can do
title: "title here"
That's what i use
"embed": {
"title": "Bot status",
"color": 16749459,
"description": msg.channel.guild.shard.latency + "ms",
}
}
}```
using eris
then bot.createMessage(msg.channel.id, embed)
the title object is blue on mobile
I've been trying to get music to work on d.js for a long time, but ever since I moved from Glitch.com to DO, YouTube-search or ytdl-core gas said I have an invalid API key. Can anyone @here help?
It'd be YouTube-search, ytdl-core doesn't use an API key. Make sure you still have the API key stored correctly, and that it's valid maybe?
Side note: Mentioning @here wont' work. 
Ye
Wait. I don't even use YouTube-search
Been so long
Or ytdl-core just youtube-dl
Music on d.js is horrible
Works fine for me. ._.
@sick cloud this is my code screenshotted since I'm mobile:
Can anybody help me figure this out?
coding on mobile? oof
Quick question for any Express users; can you use res.redirect and redirect a user to a page while a POST is still running, then when done redirect them again without killing the process?
Like, here I have a POST on /, when my code's info event runs I want to redirect to /in_progress with that info, then when it's done I want to redirect to /done, though I don't want to stop the POST code from running.
question
through the bot console, is it possible to send a message to a certain channel
if so, how can I do that?
( the bot I use is, node.js / discord.js ), with atom editor
you could attach an event listener to stdin and send messages accordingly
you may not get it
I'm allowed to run commands and type codes and stuff through the console itself
is this a bot you wrote lol
My bot is not on the website nor in any servers, it's only in my personal server
and I want to be able to send messages in a channel
through the console
( without running it in discord chat )
not really
node has a global called process that exposes a bunch of properties of, as you might have guessed, the node process
one of these properties is process.stdin, which is a readable stream sourced from the process's stdin
so if I type process in the console ( which I already did )
it showed me a'lot of stuff
you're at a repl?
ok here's what i suggest
you don't seem to know a whole lot about node or programming in general, i guess?
yeah I started yesterday
and you already have a working bot? lol
did you just clone an open src bot
no
I mean
I know a little on how to make commands and stuff like that
I'm just trying something new with the console
aka trying to send a message to a channel
you uh got that far in one day with no prior experience
Yeah
sounds fishy to me
do u know what an event listener is then
not much about it, kinda
ok what you need to do is attach an event listener to the stdin object
as i recall, you need to listen for the data event
ok
you'll be passed the raw data received from stdin, which you can parse and send to the discord channel
Sorry, for bothering again Nines, but what would I right in the stdin? @glossy sand sorry for ping if u don't like being pinged
er we have a no-spoonfeeding policy
process.stdin is an event emitter so you can attach event listeners with the on method
i assume you've used that before?
👍
there is no option anymore
Nines, it just printed out the process.stdin when you first enter it
oh
there is?!??
its called build-a-bot now
no there isn;t
thats change icon
it changes the bots pfp too
.>
if you really don't believe me, go to the Bot tab and upload it there
bot tag -> copy/reveal token
@median bear
Help
nhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
help
we dont know what to help you with
if you dont say what is causing the error
(╯°□°)╯︵ ┻━┻
oh wait
O
k
i get it
no u can change the value
ita not immutable
u just cant reassign
oh ok
Help me make a bot, it is not working...
i have two bots, my main bot (on the site) and another on the testing branch which has a different user token and everything
is there a way to use the discordbots' websites api bot without validating another bot
use the main bot's token?
^
it says theres an error in the shards.js code.
Although thats not a command in my bot file?
I need help!
Send the error
It says right there there isn't a file called shards.js
What are you even trying to do
Nothing. I just tried to load my bot and it didnt work.
Shards.js isnt even a command.
in my folder.
but theres an error with code?
Because it's seems like your trying to shard
You are using the shard class
fs.js is an internal thing
I dont get why its not working? In my folder for my bot theres literally not a single command fs.js
or shards.js
fs.js is a node thing
Comes with it pre installed
I forgot to ask this but show code
const prefix = ('=');
const client = new Discord.Client();
const bot = new Discord.Client({disableEveryone: true});
const ytdl = require("ytdl-core");
const ms = require("ms");
const Manager = new Discord.ShardingManager('./shards.js');
fs.readdir("./commands/", (err, files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0){
console.log("Couldn't find commands.");
return;
}
jsfile.forEach((f, i) =>{
let props = require(`./commands/${f}`);
console.log(`${f} loaded!`);
});
});
client.on("ready", async () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setStatus('idle');
client.user.setActivity(`=help`);
});
client.on('message', async message => {
let msg = message.content.toUpperCase();
let sender = message.author;
let args = message.content.slice(prefix.length).trim().split(" ");
let cmd = args.shift().toLowerCase();
if (!msg.startsWith(prefix)) return;
if (message.author.bot) return;
try {
let commandFile = require(`./commands/${cmd}.js`);
commandFile.run(client, message, args)
}catch(e) {
}
});
client.login(``)```
Oh I see.
Im dumb..
That is not how Discordjs sharding works
I usually keep my sharding manager In a separate file
Im so dumb..
Speaking of that I need to ad a separate Shard
hey does anyone know how to create a patreon if you pay then get access to a command in heroku?
I would recommend you doing it my way which is a stolen way of how rythm bot devs do it
@ruby dust how do you do it?
after they execute the command the bot checks if they are donators according to your database
have a private bot for your support server which will be adding/removing people from database when they have an apporpriate donator role in the server
SQLite3
any database works, as long as you know how to use it
Problem is he uses heroku
Yes that's the biggest problem, heroku sucks
Heroku does not support sqlite
Heroku sucks 
ok

Hi my bot was declined cuz google command can search some 18+ in non-nsfw channels. Can someone help me with search filters? Maybe Google have something like "baby-mode"
@earnest phoenix umm what
In discord there are nsfw type text channels
You can make it so your command only works there
Google command can search some 18+ in non-nsfw channels
So its not a nsfw command
But user can search "sex"
no
Are you generating links?
snekfetch
searchUrl = https://www.google.com/search?q=${encodeURIComponent(message.content)};
maybe some arguments in link
You could always restrict words
if you'd use a google api, you would be able to enable safe search that filters out the excplicit content from your result matches
But does the filter work 100%?
oh wait
no
but it's not controllable at all
No, not 100% but it's pretty reliable.
I have a bot that uses the same system to automatically detect NSFW messages in Discord, 80-90% accuirate.
He can still get declined then
safe search is one of the google's apis, so it handles what results you will get on their end
it's still a better fix than any other workarounds that you might think of yourself
Is SafeSearch puts one his arguments in request url? Like google.com/q=aaaaa&safe=true
You could do a forEach to check the content of the message to see if it includes https://hastebin.com/kayeyahusa.cs one of these words in this array...
(kinda nsfw)
i guess?
still not the best solution
It's just a matter of finding and developing the block array over time.
safe search is all I can suggest
That one is... oddly detailed.
lol
@ruby dust Safe Search + that will make for a pretty decent combination.
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
@ruby dust the best solution is up to jarvis to decide for his bot
I guess, but I'm afraid that will limit out too much while hiding actual results
https://www.google.com/search?num=30&[[[[[[safe=active]]]]]]&ei=FahYW6mIJout0gLO6b2wBw&q=I+love+you&oq=I+love+you&gs_l=psy-ab.3..35i39k1j0i67k1l9.11230.14960.0.15319.26.16.7.2.2.0.141.1227.12j3.16.0....0...1c.1.64.psy-ab..2.24.1240.6..0j0i131k1j0i10k1.67.dejskJZgd_0
yup
uhh wait
does anyone know any free recommended vps that doesnt require a credit card cuz im only 14 and dont have one XD
free vps?
Kek
if google command can search 18+ content dbl verification will decline too
Jarvis, that's why you implement the array I sent
The best solution: delete google command 😃
🤦

@earnest phoenix there are no free vps out there that i know
Just host on your machine
If it's decent enough
then i would have to leave my computer on
Yes
fri.gate extension for chrome
^
I mean... I'm paying $5 per month for a server hosted by Digital Ocean
It's flawless
Just do chores around the house for the money or something
Sucks he doesnt have credit card
or buy like..a Raspberry Pi lol
virtual credit card?
What
how do i get a virtual CC?
XD

@dull breach how do you transfer money onto it
I have no idea
@earnest phoenix You could also get a Pay2d credit card
https://www.noswearing.com/dictionary found, will just add words into array
uhhhhhhhhhhhhhh 400 words
ok how i said best solution - delete
haha i found the solution
just use google only in nsfw channels
sounds stupid to use google commands only in nsfw channel tbh
doesn't matter 🙃
noone use google command
btw isn't google a 13+ service like discord ?
yes
yes with SafeSearch
ew safesearch
@slow ice whats a Pay2d CC?
ok safesearch doesn't do anything cuz when i google sex it OUTPUTS SOME INFO
safesearch prevents images afaik
like bad images
and some words
sex aint a bad word
ok here is no rule about bad words (only arguing)
idk i'm russian i don't know what is bad words in eng :)
Hello! I have a question that is sort of urgent.
I want to make my bot @ancient mirage 's purge command only delete messages that aren't 14 days old or above. I figured I have to use the before parameter, but I don't know how to make a datetime object that will do the job. Does anyone know how to do this?
These are the documentaries. I can send the links when requested.
maybe request now time minus 14 days
catch the error, check if the error message says that you cant delete messages that are older than 14 days, send message that you cant delete them
No, I need to go for messages created since now (let's say) up to 14 day old ones. The time now minus 14 days wouldn't do it, as well as it might not always work the way I might've done it.
The command proceeds to delete messages older than 14 days either way, but one-by-one. I've been told now inside of the official discord.py server that that's not recommended and that I should set a limit, though I'm not sure how.
If it would've thrown an error, my error handler would've taken care of that.
bots cant delete messages 14 days or older anyways
if it tries it just throws an error
Just delete everything until discord says no
^
just catch error and say haha you can't
It can. The message cache is at 5000 by default, which means messages older than 14 days are still inside, until they just get forgotten by the client.
(That is, if they are one of those 5000 messages)
well i asked library devs and they said that only the bulk delete endpoint has a limit to 14 days
also you can check the timestamp of the message and compare it to now
I'm afraid however that datetime will pull a prank on me, since if the command is called, let's say, on the 20th of Sept, the bot will go and look for messages that are sent before the 34th of Sept instead of the 4th of October. Though, I'm not certain of this.
I also hardly work with datetime, so feel free to judge if it's a dumb mistake/thought.
Wait, I just figured that I mixed the dates.
Though, wouldn't the number go negative or would datetime figure out that it has to go 1 month back and continue from the last day?
also which api do you use?
ok, also timestamp is the number of second since the 1/1/1970
According to my quick maths, I just have to look for messages that are younger than 1209600 seconds?
(That's 14 days)
I'm not familiar with python, also https://discordpy.readthedocs.io/en/latest/api.html?highlight=message#message you can see it has a timestamp method, use this and compare with the timestamp of now
yes
you could also use datetime.timedelta()
theres postgresql XD
@earnest phoenix Im sorry for the late response but a pay2d cc is a virtual card
oke
Does anyone here know how to use postgresql to set up patreon pay to access command
lol i dont, but if i did, i would help
stackoverflow
might
know
what?
check stackoverflow/google
ok
if my tag bot was in this channe, i'd do +googleit and you'd get a nice gif
???
wahts this for?
its for laughs
but it got no laughs
so ill shut up
XD
Does anyone know do they add the bots manually here or how?
once the bot gets approved the moderator who approved it invites it to this server
so it's all manual
how do you think people would do it automatically if discord has a captcha on authorization page
I don't know that's why I am trying to figure out is there any way to automate it
bypassing captcha is a thing too 👀
Good luck coding it though, without taking other's entire scripts. Code samples are okay.
yup
cool
im writing a bot
its c# on top of Discord.net
im trying to figure out if/how i can use the link feature in Markdown
I know average users cant
but i've seen some posts about how bots CAN
but no actual record of how. I've tried just sending this is a link from the bot
it doesnt work.
thoughts or ideas @earnest phoenix ?
the reason why it only works for bots is because hyperlinking only works in embed descriptions
So I'd need to make an embed?
yes
Pretty easy using libs
cool, there was some debate in a reddit thread I found whether you actually NEEDED the embed
although, webhooks can hyperlink in message content 
... BLARG
it would be great if i could get that working, but if an embed is necessary thats helpful
thanks guys
sure
Any alternatives to canvas that run on Digitalocean? I really need one
why not canvas?
It fucks up my vps
Errors no matter what I do
well what is the error
also please replace "runs on Digitalocean" to "runs on [the distribution of linux my droplet is running]"
Ubuntu 16.04
exactly what I was using
and it was fine on my vps
you're probably missing a dependency
But here's the code. The commented out stuff was what was causing the bot not to run
Canvas had some type of error installing I think
And it retried with prebuilt or some alternative, and the installation went through
Lol
anything above that?
Here:
I don't understand this and I'm about done screwing around with this
Pls help this is killing me
@bitter sundial ^^
@bitter sundial the second image is what's above
@earnest phoenix nodegyp doesn't work well on android
that's ssh on a vps
@neat falcon I want to be use one command ..join #thechannel (message) and that wrote the id of #thechannel and wrote the message
what kind of os
@earnest phoenix try sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
yes
literally just said
no the module work just the probleme is the modules was temp (forme) with Termux
What
U can run windows me on android
I am running through codeanywhere ty and @bitter sundial I'll try it
@bitter sundial I think it worked
What happened... I didn't kill it. It did it automatically
maybe the keys that take screenshots are used to kill as well idk
No. I took it after it killed
Well u could use pre built ones
How exactly?
@split lantern ^^
I need to get off. I have parents who want me off
and will do anything to get me off my phone
@bitter sundial I used prebuilt and it broke the bot. Just won't even start
again, error please
Nvm I still required 'canvas' not 'canvas-prebuilt'
How do you set up an sqlite database file?
Name.sqlite
gg
rip me
i need a vps but im broke XD
im trying to look on google for a free one XD
ok
@sick cloud do you recommand VIRMACH
i have music command tho
so idk?
@bitter sundial latest error with canvas rip:
XDDD
this is the prebuilt?
you run your bot on your phone?
what's your code like
i don't use them so idk
@earnest phoenix I do not run my bot on my phone I run it on Digitalocean, which can be accessed by an app on my phone, and @bitter sundial, yes this is prebuilt
you commented out all your code?
this one is still using canvas instead of canvas-prebuilt
and you're probably reading version 2.0.0 documentation
Fuck
let's get you a 2.0 one
I'm kinda stupid. Prebuilt does have 2.0 binaries, right?
npm i canvas-prebuilt@2.0.0-alpha.12
now im confused did that work or not
Ikr
just run it again
Should I append -S?
-s is no longer needed in newer versions of npm
I've never seen node-gyp say Killed
How do you add a dropdown selector and get the value given from it in html/express? I'm too dumb to understand them, so far I only understand how to use usual input fields and res.body.inputname
alright
<form action="/" method="post" name="inputs">
so set it as that or something?
with this setup res.body['pet-select'] == 'cat'
@bitter sundial it finally worked. Thanks for all your help. And may the force be with you
Note: everyone but heroku is not lifetime you only have 500 hours of hosting
Extra hours: if you add billing information you get extra 450 hours
seems like heroku provides 550 hours per month for all free dynos that run on an account, which goes up 450 per month when you add CC info. https://devcenter.heroku.com/articles/free-dyno-hours#free-dyno-hour-pool
@bitter sundial think you can help me more? everything i select returns undefined
did you add values to the options
yeah i did
@ocean moss i could answer questions since i've used discord.py
and a name to the select element
self.dblpy = dbl.Client(self.bot, self.token)
self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while True:
await self.dblpy.post_server_count()
await asyncio.sleep(1800)```
I have this atm @uneven depot
Get a 403 error
yey 👀
does "HTML escaped" mean that <p></p> and such will show as plain text instead of their actual element?
did you add that add_cog thing at the went for your discord.py client?
Yeah i did
i guess what i would try to do is add try and except blocks from within the loop, with logging to see what's going on. One sec i'll post example
Okaays
try:
await self.dblpy.post_server_count()
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
and for logger could do something like
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('discord')
after doing import logging
If it's a new bot, it's possible that maybe it throws exceptions when it doesn't have anything to post yet (not sure if that's how it behaves, but this is what i have and it seems to work for me)
just correct a typo i had. I had pass instead of logger, which basically tells it to do nothing and continue the loop lol
@earnest phoenix it was killed bc it was found compiled already
whether thats online or cached somewhere on ur pc
oh anyway its fixed now @earnest phoenix
nice
Thanks!
@bitter sundial another issue:
12|mini-me | Error: error while reading from input stream
12|mini-me | at Image.src (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/lib/image.js:30:17)
12|mini-me | at Promise (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/index.js:34:15)
12|mini-me | at new Promise (<anonymous>)
12|mini-me | at Object.loadImage (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/index.js:23:10)
12|mini-me | at module.exports (/home/node/mini-me-stable/events/guildMemberAdd.js:24:35)
12|mini-me | at emitOne (events.js:116:13)
12|mini-me | at Client.emit (events.js:211:7)
12|mini-me | at Guild._addMember (/home/node/mini-me-stable/node_modules/discord.js/src/structures/Guild.js:1142:19)
12|mini-me | at GuildMemberAddHandler.handle (/home/node/mini-me-stable/node_modules/discord.js/src/client/websocket/packets/handlers/GuildMemberAdd.js:12:13)
12|mini-me | at WebSocketPacketManager.handle (/home/node/mini-me-stable/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
i don't do much image manipulation you can probably tell
@earnest phoenix, means the file path you've added is incorrect and Canvas can't find the image.
oh thx
i'm dying out here
all these stupid fucking complicated-ass error messages
@sick cloud will it load a .jpg?
yes
hmm, i'm pretty darn sure i've got the path right
its relevant to your cwd
so if you have your image in / and the cmd using it is in /stuff/, you'd need to require it as ./image.png or whatever
(i think, thats on @next at least)
try ././assets/welcome.jpg
?
on loadImage
that calls the cwd twice
just try it
i can do for you


