#development
1 messages · Page 340 of 1
message.mentions.first()
you want to tag the user, get that
just put that in a string, it'll automatically tag the user
let user = message.mentions.first();
message.channel.send(user + " is getting banned.");
user.ban();
then u an do
I knew it!
My apologies.
Message.mentions.members
Eh its fine bro
But thank you!
Wait what are you splitting
In the code
Just curious
thats just the way i did my args
Okie 👍
-kick @user here are the args
Ik
it would return here are the args
Oh!
k
Okay so it would return the args
And then use them
👍
Thank you so much
Wait
I think something is wrong with my if statement
if (message.content.startsWith('---ban')) {
This doesnt seem right 🤔
Okay wait
Nvm
if (message.content === `---ban <@${message.mentions.members.first().user.id}>`) {
why
Because it still didnt work
thats so extra
Ik but then why is it still not working >.>
🤔
.
🤦
Omg I forgot to log it into the main index file ommmggggg
😐
Well it should work now
Thank you!
@earnest phoenix that logic is pretty horrible
Which
this
if (message.content === `---ban <@${message.mentions.members.first().user.id}>`) {
Oh lol ik
so many things wrong with this
I ran out of ideas of what was wrong
jesus
dies
Which is much better
I only changed that because I thought something was wrong with it
learn js :((
because you didn't define it 
did you declare a variable as args?
How can I use the "a" variable outside the sqlite function? 🤔
js sql.get(`SELECT * FROM something WHERE guildId =${msg.guild.id}`).then(row => { if(!row) { let a = 0; } else { let a = row.number; } }); //How can I use the "a" variable outside the sqlite function?
declare it outside the thing and set it on the inside
can you not do like
But
let a;
if(blah){
a = dis;
} else {
a = dat;
}```
yes that
can you not do that
I guess I'm the only one using prepared statements even when getting data from events directly from the discord library I use...
@thorny hinge use prepared statements
LUL
wew
Prepared Statements are smart, and you should use them
no excuses not to
otherwise some shit will figure it out and do derp'; DROP ALL DATABASES; --
Wait how would I put args into a variable
!setprefix a');DROP * --
learn js to find out?
@thorny hinge google is your friend
me too
Google didnt't help 
then you don't know how to google
ok
Oh i see
A prepared statement is a feature used to execute the same (or similar) SQL statements repeatedly with high efficiency. Prepared statementsbasically work like this: Prepare: An SQL statement template is created and sent to the database.
But how do you make one 
what lib
How do I make an uptime command? In discord.js
^ .js
Ok thank you
what
Okay wait
This command still doesnt work
"args.join" isnt a function
client.on("message", (message) => {
let args = message.content[1];
if (message.content.startsWith('---ban')) {
if (message.guild) {
message.mentions.members.first().ban(args.join(' ').split(1).join(' '));
} else {
message.reply('You need to be in a guild to do that!');
}
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
}
});
args is not an array
no...?
idk how JS treats strings but in some langs a string is an array of characters
either way
it's not an array in this case
let args = message.content[1];
I don't know exactly, but that either won't work or just sets it to the second letter in the message
and that's a string
args.join(' ').split(1).join(' ')); this .join() and is only for arrays
What it does is it sets args to the second half of the message
that's the 2nd letter
What
Out of three phrases
Arg 1 would be the second phrase
Because its zero-indexed
exactly
it's a string
zero index
Yes its a string
its a part of the array
thats
index 0
.join
does not work
on strings
it requires
Oh
an array
message.content is a string, and [1] is takign the second letter. If you want to take a second thing, separated by space you need to split it
Splitting it makes it into an array which it seems you want
The second letter?
Okay yes
My code does have a splitter
Do I not need to join the args then?
You cant .join() a string, as you currently just grabbing second letter
so on args = message.content you would want to .split(" ")
Okay
Im gonna put a comma inside the ""
Wait
No
But then there would be two splitters
client.on("message", (message) => {
let args = message.content.split(" ")
if (message.content.startsWith('---ban')) {
if (message.guild) {
message.mentions.members.first().ban(args.join(' ').split(1).join(' '));
} else {
message.reply('You need to be in a guild to do that!');
}
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
}
});
Theres a second splitter
".split(1)"
split 1? 👀
Okay hold on
Okay what
This isnt
This code shouldnt be correct
Theres two splitters and two joins
I got rid of a join
And a split
Now its saying ban is undefined
This is so annoying
it'd be a lot easier if you learned js first sigh
I do know js
I get what he means by its grabbing the second letter
So you need a splitter
There is a splitter
But then why were there doubles of each
@thorny hinge https://sqlite.org/c3ref/stmt.html
literally took me 2 seconds to google
:l

hecking use bing
int sqlite3_prepare_v2( sqlite3 *db, /* Database handle */ const char *zSql, /* SQL statement, UTF-8 encoded */ int nByte, /* Maximum length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ const char **pzTail /* OUT: Pointer to unused portion of zSql */ );
So thats a prepared statement? 
And that will solve my issue of getting the values at the same time the database is accessed? 
Boi
OMG
I DID IT
I CREATED MY BAN COMMAND
BIJGUKWAGWDWAKHJVWFQJKWF
And it works
It was so simple!
Lol someone tried
Im more of a js guy and i just got on
Okay lmao
-bots
@atomic sierra 
@reef nexus
Yep
Omg that took me forever
Im in the middle of a javascript course and I just got to arrys lol
Wanna see how easy it is to ban
@earnest phoenix
message.guild.fetchMember('376147022660632587').ban()
Sure
¯_(ツ)_/¯
Lol srsly
That is your id btw
My code
client.on("message", (message) => {
let args = [message.content]
if (message.content.startsWith('---ban')) {
if (message.guild) {
message.mentions.members.first().ban(args[1]);
} else {
message.reply('You need to be in a guild to do that!');
}
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
}
});
It uses args
Yep
most of my commands also use args
Anyways
Yea
If you need help tag me @earnest phoenix
Most devs here dont like js
👍
True
I have a question for you
Sure
Yes
otherwise known as a switch
xD
Uh k then
Did you get a message @earnest phoenix
That is my bot
Take a idea from this code
message.guild.fetchMember('376147022660632587').then(e => e.send("This is mybot btw its String(\"Cheese\")"))
Okay
xD
Ignore the \
I use
I can replace the ID with a userID
Yea
bot.fetchUser()
that will also work @vale orbit
But
i was just going to use it for this guild
lol
😂
Oh
My bot was in Discord Collection, so I warned the owner of that server using dm command
👍
Wait
?
UserID
Okie
xD
Thx
Created a rough help system
@sinful meadow
Erm I need a bit of help
If your even online lel
hmm
I need a bit of help
With
People can easily crash my bot
By using commands in the DM
Or by not providing a mention
I have tried coming up with solutions
But nothing is working
xDDDDD
Yep
But
if(!messsage.mentions.length >= 1)
That also @rich kiln
Okie ill add this to all oh meh code
*of
Thank you!
I see how it works
I tried something like that tho
if (args[1] === null) {
message.channel.send('Stuff')
}
I think I used the variable wrong tho
Yea
you did
normally
args aint null
they are undefined
null is if it is a value
as in
1
2
3
It can be undefined
if(args[1] === undefiend
np
hmmm
@quiet bobcat
message.guild.fetchMember('ID').then(e => e.avatarURL)
¯_(ツ)_/¯
i dont know if you need the .then
but i still did it
Ok
Thanks
``INPUT:
message.guild.fetchMember("297433416998191127").then(e => e.avatarURL)
OUTPUT:
Promise { <pending> }``

Alright
Need help with what @sinful meadow
Cleverbot.io @vital lark
oh, you need a key
Do you do it like this? ```js
clev.create(function (err, session) {
clev.ask("Just a small town girl", function (err, response) {
console.log(response); // Will likely be: "Living in a lonely world"
})
})
since like
its weird
How to make a cleverbot command: https://gist.github.com/ohlookitsAugust/f75e94f7036990fca31877b99afd4a38
This is how to make a cleverbot session with Discord x Cleverbot.io
1 sec
@vital lark ```js
let dankarg = message.content.split(" ").slice(1)
let arg = dankarg.join(" ")
clev.ask(arg, (err, data) => {
message.channel.send(data);
});
Ignroe the arg crap i have a command handler i just have that for now
ive tried your code
and that doesnt work either
Did you define clev?
Yep
hm...
How to change the text color in the whole bot page?
color: white;
exp?
example...
Wew
it shall be a bean
they joined 5 minutes ago as well 
@fossil oxide Bad user saying the N word and also quick deleting DMs with it
for pizza?
lol
discord.css looks good
@fossil oxide homemade fresh pizza made from 0,0.1% horse meat
:^)
Help: How do I connect my codes to discord bot, when my it said the .Connect is "No overload..."?
(Using C# Console)
public MyBot{
discord.ExecuteAndWait(async () =>
{ await discord.Connect("AppBotToken'sCodes"); });
}
Lib? @earnest phoenix
How can I make a prepared sqlite statement 
@sinful meadow what is Lib? By the way, I'm using C# language
SOz i cant help
Hello
lib is the thing u using to connect to discord
THE DISCORD BOT LIBRARY IS THE THING U USE TO CONECT TO DISCORD
Lol ik
OK THEN
But it doesn't do just that
Like
It allows you to reference the bot in your code and use discord methods
...
Mad kids?
@median lintel basically what you said
Because it's in general to make your bot connect
^
What is the function name for a prepared sqlite statement 
How to merge two pictures in jimp? discord.js
why not read the jimp docs lol
yeah but how to make 2 pics in one. like for example. a grey bg and the message authors avatar on the bg
no
@glossy sand i dont want to merge a Jimp image and an image from a directory
i want to merge 2 images from a directory
then do it :p
@earnest phoenix can I see your php upload script pls, and your htaccess file... my stuff won't work
Is there a bot that has custom welcome messages like this?
With what @earnest phoenix
making a bot i tried it gives me unknown error
Ok what language?
...
-botinfo @worn relic
What programming language
Hmmm..
All I know it needs to be english
javascript
Ok
Is there a bot SIMILAR to Welcomer?
Do you have node.js or just javascript?
uhhhhh wht code
The code for the bot?
this is my first
is this it? 2146958591
Oh my
no
;-;???
i messed up didnt i
You need to write a program
To make the bot run
I dont even understand what you did 
The bot
U can create a png welcomw msg w python
What bot do you want to make @earnest phoenix
@earnest phoenix I would recommend this one https://www.youtube.com/watch?v=-5jJaO17Gjs
the xp bot is just to level people up
and the mod is just for like banning and ranking
Ok
like all do for mods
Watch this tutorial https://www.youtube.com/watch?v=024upsEuHaU
Should be good
ep 6 is for xp
Its good for learning to code
I cant install things on chromebook it says cant open file
Hmm
UGHHHH
What does it say exactly?
Chrome Cant Install This File, Need Window 10
What os does chromebook have?
wish someone could do it for me
Ye
I wish that someone could do stuff for me aswell
its a school chromebook tho ;_;
Then idk
ARGH
:/
hey guys, can you help?
i want to know how to make me bot DM everyone, literally everyone
makes sense ok
but why
wanted to share my patreon page, but it does seem like a bad idea
You'll probs run into errors tho because bots and blocked users
so i did it on the contact owner command instead
But its a bad idea in general
it sure is
99.999999% risk of api ban
lol true
101%
Im trying to make a music bot but I just get this error Error: Cannot find module './settingsforbot.js'
const settings = require("./settingsforbot.js"); and thats the code
Any Idea why this wont work?
if(command.startsWith("+8ball")) {
let supportserver = client.guilds.find("378923069521133589")
if(message.author.memberOf(supportserver)) {
return message.reply("You are a member of the Mod Bot Support Server!")
} else {
return message.reply("You are not in the Mod Bot Support Server!")
}
}
USING JAVASCRIPT
if(command.startsWith(prefix + "8ball")) {
let supportserver = client.guilds.find("378923069521133589")
if(message.author.memberOf(supportserver)) {
return message.reply("You are a member of the Mod Bot Support Server!")
} else {
return message.reply("You are not in the Mod Bot Support Server!")
}
}
That should do it
:/
- is the prefix
hmm
is .memberOf even a function?
hmm, idk what it would be then
Are you trying to find a member with that role?
No, If a user is in my Support Server, the command will work, If they are not in my server. Then the command must not work
Hmmmm
hmmmmm
hmmmmm
You're using d.js right?
yeas
I can ask on their server
kk uhmm me neither xD

No. I dont want it to be only typed in the support servers guild
can i use mybot here or what?
No
No
A Person is able to use the command outside of my support server, however if they are a member of my support server then the command works, If they are not a member of my support server then the command will not work for them
Bots only work in #commands #265156322012561408 #306891333405245450 and #265156361791209475
Can someone help me? Im trying to make a music bot but I just get this error javascript Error: Cannot find module './settingsforbot.js'
const settings = require("./settingsforbot.js");``` and thats the code
Im using d.js lib
Try __dirname+"/settingsforbot.js"
Thats if its in the main directory
And use a json for settings
Unless it serves functionality beyond just configuration
So it has to be as a js
Show?
looks like file doesn't exist
var google = require('googleapis');
module.exports = {
getVideo: function (query) {
return new Promise(function (resolve, reject) {
var service = google.youtube('v3');
service.search.list({
auth: `Token`,
part: 'id,snippet',
type: `video`,
q: query,
}, function (err, response) {
if (err) {
reject('The API returned an error: ' + err);
}
if (response.items.length == 0) {
reject('No video found.');
} else {
var video = {
title: response.items[0].snippet.title,
url: `https://www.youtube.com/watch?v=${response.items[0].id.videoId}`,
thumbnail: response.items[0].snippet.thumbnails.high.url,
description: response.items[0].snippet.description,
publishedDate: response.items[0].snippet.publishedAt
};
resolve(video);
}
});
});
}
}
Well it does
The same folder as everything else
With the __ aswell?
Yes
Error: Cannot find module 'C:\Users\Jonas\Desktop\Lion./botcode.js'```
Whats your foldername lmao
Remove ./
Error: Cannot find module 'C:\Users\Jonas\Desktop\Lion/botcode.js'```
I got that now
I get the feeling that youve named it wrong
Or youve done something silly and misplaced it in another folder
Are you kidding me... I spelled it wrong -.-
Sorry for taking your time
And thanks
Lmfao np
May anyone help me with the bot @gentle ether . I want to change it's custom message...
This.
to.
This.
Use jimp
What lib do you use
Yes. What is your bot coded in
Dunno..
Sigh
I did..
then youve probably done something wrong :-]
Look at the documentation for the bot
Im sure theres some for it
Or actually go to the bots discord and ask for help
Alright.
I don't freaking code.
Don't you just love when the bot gives you NO info?
"
Server based prefix and other settings.
General, moderation and fun commands.
Permission based help command i.e. see only commands which you can use when you do `!help`
24/7 Uptime
And many more
All it gave me.
No discord.
get a better bot
Idk dude theres way over 800
Alright.
Im having another problem...
var patreonlist = ["274923987480346635"] //Tobramas User ID
var patreonlist = ["223460406398550016"] //Jopety / Zeus' User ID
let question = message.content.split(/\s+/g).slice(1).join(" ")
if(command.startsWith(prefix + "8ball")) {
if(!message.author.id===patreonlist) {
return message.reply("You do not have access to Patreon commands!").catch(console.error);
} else {
return message.reply("Your allowed to use this command!")
}
}
It just allows everyone to use the command. Not the people with the id's specified
ur comparing a single id to a list of ids? that looks off already
Try patreonlist.includes(message.author.id)
are you kidding me? XD
How can I return a value within an sql function
sql.get(blablabla.then(blablabla => {
//stuff
return hi;
});
``` I can console.log() stuff fine but returning it gives me undefined ;-;
I tried sql.prepare() too
no luck
What are you trying to return?
Bit
aTmG, what language?
js
i think hes using sqlite http://www.sqlitetutorial.net/sqlite-nodejs/query/
Summary: in this tutorial, you will learn how to query data from the SQLite database from a Node.js application using sqlite3 API. To query data in SQLite database from a Node.js application, you use these steps: Open a database connection. Execute a SELECT statement and process the result set. Close the database connection. The sqlite3 module …
Thanks 
What's the cheapest vps I can get for web hosting
$3 from ovh is the cheapest I know of for VPS's
there is one $2.50 but it sucks as no paypal and shady
There was a 40GB for $5 on OVH
[01:01:22] [ ERROR] [SocketServer] Caught exception in websocket
java.lang.RuntimeException: java.io.EOFException
at lavalink.server.io.SocketServer.onMessage(SocketServer.java:176)
at org.java_websocket.server.WebSocketServer.onWebsocketMessage(WebSocketServer.java:524)
at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:417)
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:170)
at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:781)
Caused by: java.io.EOFException: null
at java.io.DataInputStream.readFully(DataInputStream.java:197)
at java.io.DataInputStream.readUTF(DataInputStream.java:609)
at java.io.DataInputStream.readUTF(DataInputStream.java:564)
at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.decodeTrack(DefaultAudioPlayerManager.java:272)
at lavalink.server.util.Util.toAudioTrack(Util.java:44)
at lavalink.server.io.SocketServer.onMessage(SocketServer.java:156)
... 4 common frames omitted
has anyone seen this before?
In python, for the logging module, is it possible to run a function after logging something?
i have a problem ```JAVA
if(message.getAuthor().getId() != Main.jda.getSelfUser().getId()) {
LevelSystem.addPoints(message.getAuthor().getId());
if(level.levels.containsKey(level.getLiveLevel(LevelSystem.getPoints(message.getAuthor().getId())))) {
int levelcount = level.levels.get(LevelSystem.getPoints(message.getAuthor().getId()));
message.getChannel().sendMessage(Embed.simpleColorMessage("**Nice! " + message.getAuthor().getAsMention() + " has now level `" + levelcount + "` !**", Embed.defaultColor)).queue();
}
}```
getAsMention 
what programming language?
looks like JDA
ignore my stupidity using lavalink

const Discord = require('discord.js')
const request = require('request')
exports.run = async(client, message) => {
let args1 = message.content.split(' ').slice(1)
let args = args1.join(' ')
if(!args) return message.reply('search something')
let url = "https://api.redtube.com/?data=redtube.Videos.searchVideos&output=json&search=" + args + "&tags[]=Teen&thumbsize=medium"
request(url, (error, resp, body) => {
try {
let json = JSON.parse(body);
let videos = json.videos;
let firstVidImg = videos[0].video.default_thumb;
let firstVidTitle = videos[0].video.title;
let firstVidUrl = videos[0].video.url;
var embed = new Discord.RichEmbed()
.setImage(firstVidImg)
.setTitle(firstVidTitle)
.setURL(firstVidUrl);
message.channel.send({
embed
});
} catch (e) {
console.log(e)
}
});
}
exports.conf = {
aliases: []
}
exports.help = {
name: 'rt',
description: 'redtube vids',
usage: 'rt'
}
how could i get it
to show the video
and i can watch it
.
🤔
xD
for redtube lol
get youtube_dl
it supports redtube
hm
and a lot of other stuff
i have it
but dont know how to use it
:/
🤦
google.
xD
it'll help you better than we can help anybody
@edgy dew
snekfetch.get(`https://discordbots.org/api/bots/348205766127124480/votes`)
.set('Authorization', 'bish no')
.then((r) => console.log(r.text))
[
{
"username":"TurtleGamingFTW",
"discriminator":"4822",
"id":"220271040658407424",
"avatar":"9bb5f79b5070883c33f701fd60db42c7"
},
{
"username":"Cheiftan",
"discriminator":"9948",
"id":"183871141759156225",
"avatar":"c4a9ab0f815f71f81750e6a5ff1d7a60"
}
]
thats how r.text
servers.json
Would this work?
http://senpai.ga/_____56?!?!?!
...
ty, very helpful :]
kek
app.use(express.static("/uploads/", {
extensions: [ "png", "jpg", "gif", "mp4", "mp3", "txt", "jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv" ],
}));
app.post('/url-to-send-post', (req, res)=>{
res.setHeader('Content-Type', 'text/text');
var file_name = randomToken(6);
var form = new formidable.IncomingForm();
form.parse(req, function (err, fields, files) {
if(fields.key !== "YOUR KEY HERE"){
res.write("INVALID KEY");
return res.end();
}
var oldpath = files.fdata.path;
var newpath = __dirname+"/uploads/"+file_name+files.fdata.name.toString().match(/(\.)+([a-zA-Z]+)+/g, '').toString();
fs.rename(oldpath, newpath, function (err) {
if (err) return res.write(err);
res.write("http://"+req.headers.host+"/"+file_name);
return res.end();
});
});
});
const bodyParser = require('body-parser');
const formidable = require('formidable');
const randomToken = require('random-token');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.listen(8030);
http://senpai.ga/_____67?!?!?!
request = http://YOURURL:8030/url-to-send-post
key = YOUR KEY HERE
const express = require('express');
const fs = require('fs');
const app = express();
const path = require("path");
uh
OMG, http://senpai.ga, your website is not motion design !! IN 2017 not motion design ?! 👉🏽 🚪
LOL?
Any Idea why the roles come up as undefined?
let roletag = args[1]
if(command.startsWith("+roleinfo")) {
let modrole=message.guild.roles.find("name", "Mod");
if(!modrole) {
return message.reply("Please create a Role called 'Mod'.").catch(console.error);
}
if(!message.member.roles.has(modrole.id)) {
return message.reply("You do not have access to Moderation Commands!").catch(console.error);
}
if(!roletag) {
return message.reply("Please specify a role!").catch(console.error);
} else {
return message.author.send({embed: {
color: aqua,
author: {
name: "",
icon_url: ""
},
title: "Role Info",
description: `
__**Displaying information about the specified Role!**__
**Selected Role:** ${roletag}
**Position of Role:** ${roletag.calculatedPosition}
**Colour Of Role:** ${roletag.color}
**Role Created At:** ${roletag.createdAt}
**Role Editable:** ${roletag.editable}
**Role ID:** ${roletag.id}
**Role Members:** ${roletag.members}
**Role Permissions:** ${roletag.permissions}
`,
timestamp: "",
footer: {
icon_url: "",
text: `© Support us on Patreon to get access to Fun Commands!`
}
}
}).catch(console.error);
}
}
JavaScript*
Nevermind, I got it
wow
Lmao
Sup?
Any Idea how i would do a command that would tell me all the names of the servers my bot is in? I dont exactly know how to use arrays 100%
Javascript*
Discord.js im assuming
client.guilds.map(g => g.name)
client.guilds.map(g => g.name).join(", ")

When I request this page https://discordbots.org/api/bots/355380581770461193/votes, it says { error: 'Unauthorized' }, do I need to use my token to see the data?
yes
How Do i get my bot to send a new message when the max 1000 characters is exceeded?
I want my bot to be able to tell when its sent over 1000 characters and It will create a new message but carrying it on...
My bot wont reply with all of thge members in the guild...
let guildname = message.content.split(/\s+/g).slice(1).join(" ");
if(command.startsWith("+guildsearch")) {
if(!message.author.id==="277917944866930689") {
return message.reply("You are strictly forbidden to use this command!").catch(console.error);
}
let guild = client.guilds.find("name", guildname);
if(!guild) {
return message.reply("Cannot find a guild named that...").catch(console.error);
} else {
let guildmembernames = guild.members.map(g => g.name).join("\n")
return message.author.send({embed: {
color: orange,
author: {
name: message.author.tag,
icon_url: message.author.avatarURL
},
title: `${message.guild.name}`,
description: `
**Displaying Guild information:**
**Guild Name:** ${guild.name}
**Guild ID:** ${guild.id}
**Guild Owner:** ${guild.owner}
**Guild Owner ID:** ${guild.ownerID}
**Guild AFK Channel:** ${guild.afkChannel}
**Guild AFK Channel ID:** ${guild.afkChannelID}
**Guild Created At:** ${guild.createdAt}
**Guild Default Role:** ${guild.defaultRole}
**Guild Member Count:** ${guild.memberCount}
**Guild Region:** ${guild.region}
**Guild Icon:** ${guild.iconURL}
**Guild Members:** ${guildmembernames}
`,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: `© ${client.guilds.size} Servers. ${client.users.size} Users.`
}
}
}).catch(console.error);
}
}
Is there a good discord oAuth library for java?
There probably are a lot of generic oauth Java libs. Oauth is a standard so it should be pretty easy to integrate
anyone here using raspberry pi to host their bots and also using mysql/mariadb willing to help me?
/home/pi/.djsbots/yasashii/PBE/node_modules/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MariaDB client
I'm using the RPI through SSH if that matters
I trued using insecureAuth: true aswell but to no avail
var con = mysql.createConnection({
host: `localhost`,
user: `root`,
password: `xxx`,
database: `yasashii`,
insecureAuth: true
});
@uncut delta By DMs?
Any idea why the bloody hell this wont work?
JavaScript
client.on('roleUpdate', (oldRole, newRole) => {
if(!guild.id==="378923069521133589") {
return;
}
let patreonrole = guild.roles.find("name", "Patreon - Honoured")
if(!patreonrole) {
return;
}
if(patreonrole===newRole) {
client.channels.get("378926234073169931").send.send(`@everyone, Shoutout to ${guild.member.name} For supporting us on patreon and getting the Honoured Role!`.toString())
}
})
u said that 3 times
?
.send.send() wat
wait wtf lmao
Fixed it but it still wont post anything into chat and it is not giving me errors on console
client.on('roleUpdate', (oldRole, newRole) => {
if(!guild.id==="378923069521133589") {
return;
}
let patreonrole = guild.roles.find("name", "Patreon - Honoured")
if(!patreonrole) {
return;
}
if(newRole===patreonrole.id) {
client.channels.get("378926234073169931").send(`@everyone, Shoutout to ${guild.member.name} For supporting us on patreon and getting the Honoured Role!`.toString())
}
})
why the .toString() though?
The everyone tag lol
it is already a string
Got rid of the .toString() But still happening... No errors on console and no message appears in the specified channel
you should try adding a console.log() near the .send to check if it even reaches that part of the code
that's how I debug at least
kk lol
if there are no errors but it still doesn't work, that might be it
Tried it and it doesnt even fucking get to the
if(!client.guild.id==="378923069521133589") {
``` line :/
So annoyed rn :/
@ornate shadow
because client.guild.id isn't a thing
what did you change it to
that won't work either
nope
messsage.guild.id 
No
that won't work too
No messages are being sent
cuz it's in the roleUpdate event
lol
guildMemberUpdate?
?
depends on what you're trying to do
have you looked at the documentation?
When a user gets given the Patreon - Honoured role, A Message is sent into a specified channel
yep
ye that's not the event you want
guildMemberUpdate is the one you want
Thanks lmao ffs. Everything else is right i guess?
lmao ohh
your event would look like client.on('guildMemberUpdate', (oldMember, newMember)=>{});
to get guild id, follow my gif and do newMember.guild.id
I am getting the following error:
https://gyazo.com/d9f85812b0d3526de3656cbe2d55902c
I even tried adding the insecureAuth: true and removed the password (reinstalled mysql-server aswell with no
I gave up
and submitted a question on stackoverflow
I'm trying for 2 days now
gonna take a break and play some LoL until someone may know a solution
can i ask another question
{
"username":"TurtleGamingFTW",
"discriminator":"4822",
"id":"220271040658407424",
"avatar":"9bb5f79b5070883c33f701fd60db42c7"
},
{
"username":"Cheiftan",
"discriminator":"9948",
"id":"183871141759156225",
"avatar":"c4a9ab0f815f71f81750e6a5ff1d7a60"
}
is there a way
to retrive all the ids
instead of just 1
snekfetch.get(`https://discordbots.org/api/bots/348205766127124480/votes`)
.set('Authorization', 'hahahahah')
.then(r => console.log(JSON.parse(r.text)))
thats the way i get it out of array
var ids = [];
for(var i=0;objectArray.length>i;i++){
ids.push(objectArray[i].id);
}
if you want all ID's in an array
that's how i'd do it
don't forget to close the bracket 😄
ty, my bad
xD
why doesnt this work
client.user.setPresence({
activity: {
name: "you 😉",
type: 3
}
})
client.user.setPresence({
activity: {
name: "you 😉",
type: 3
}
})
@languid dragon i still dontunderstand how to put that in my snekfetch
yh idk what ur doing, u best ask someone else cos im sleeping goodluck x
i want to get all the ids of who voted and push it into an array
this isnt setting games @thorny hinge
type 2 + type 3 are new things
Watching and Listening
instead of just Playing

or Streaming
<?php
$uri = $_SERVER['REQUEST_URI'];
$url = "https://cdn.itsmoose.space/pls/";
$uritrim = substr($uri, 7);
echo $url . $uritrim;
echo '<meta property="og:image" content="' . $url . $uritrim . '" />';
?>
.........wut is this?!!?!?!?
mmmm
blue
how are you supposed to edit buttons in the bot page
edit what exactally
like you know how they have that header and the icon stuff
wat
like how poeple move icons
i wish i could do that



