#development
1 messages Β· Page 395 of 1
not really development related
Anyone here can guide me to a page that can explain, how to make custom images (f.e. to use for profile-commands) with JDA/Java?
Should be more or less for noobs, because I never did such a thing before but really want to try it.
take a look at BufferedImage/Graphics2D
@inner jewel how much do you know about java dev on linux
like the bot cant find my role
server? aws?
can i send you an invite to show you what i mean?
@uncut slate define "java dev on linux"
any one else have problems with roles? ``` let mod = message.guild.roles.get("432263170178940928");
message.delete();
if(message.member.roles.has(mod)) console.log("ok this works");
if(!message.member.roles.has(mod)) return;```
make sure its the correct id
@finite tendon
It is the right id I checked it with console.log(message.guild.roles) but it worked when I did message.member.roles.find("name" ,"mod") @low wasp
hey
does someone knows how to make custom prefixes?
ples halp
lol
a bot answers to ples halp
No one can help if you don't say what lang.
Yeah that would be helpful
they're using JS
Iplayhttps://www.youtube.com/watch?v=ZPlUjhroNd4&list=PLmPcutjCl4YdS_aq6Jh_AwuxlyyZG7rou
Keys To The Kingdom from the album The Hunting Party - the sixth studio album by American band Linkin Park. The album, produced by band members Mike Shinoda ...
So I'm trying to use lavalink.py with Lavalink for a music bot. I've got most of everything working. However, when trying to play music Lavalink's console comes up with this error. Anyone else?
@abstract mango you should ask in the lavaplayer server
This gives me an inconsistent indent error
@bot.event
async def on_command_error(event, ctx):
if isinstance(event, commands.CheckFailure):
embed=discord.Embed(title="An error has occured.", description="Whoops! An error has occured and I can't run the command you wanted to run, the most common causes of this are", color=0xff0000)
embed.add_field(name=Invalid permissions, value=You may of tried to run a moderator command without permissions., inline=False)
embed.add_field(name=Invalid command, value=This command may not exist!, inline=True)
embed.add_field(name=Owner only command, value=The command could just be reserved for the developer., inline=True)
embed.set_footer(text="All good, you haven't broken the bot or anything.")
await bot.send_message(ctx.message.channel, embed=embed)```
Yes, it is indented properly, 4 spaces each and 8 right now.
@cedar jasper Thought the code I showed you was complex?

Arc v4
Connecting to Discord API...
Arc is online.
Ignoring exception in on_command_error
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/discord/clien
t.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "bot.py", line 327, in on_command_error
embed.add_field(name="Invalid permissions, value=You may
of tried to run a moderator command without permissions.",
inline=False)
TypeError: add_field() missing 1 required keyword-only argum
ent: 'value'
^Croot@Joshek:~/Arc#

But there is a value.
wait nvm
i'm a tarf
*tard
All clear now.
@restive silo can u unmute my bot again? i removed my levelup msg
my bot is on 18 servers but it shows that for me why?http://prntscr.com/j2erk8
are you posting your server count to the API?
wdym? @trim plinth
@cunning karma for it to show the servers, you need to post your server count to the website, using the api, docs here https://discordbots.org/api/docs
ohh
title: "Profile for " + cooldude.username,
^
TypeError: Cannot read property 'username' of undefined
at Client.client.on (/app/server.js:593:38)
at Client.emit (events.js:180:13)
at MessageCreateHandler.handle (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/discord.js/11.3.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:180:13)
at Receiver._receiver.onmessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/websocket.js:137:47)
at Receiver.dataMessage (/rbd/pnpm-volume/768faaa2-1c53-4031-b548-770885ea090a/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/receiver.js:409:14)
var args = commandbody.split(' ');
let cooldude;
if(message.mentions.members.size > 0){
cooldude = message.mentions.members.first().user;
} else if (args[1].length == 18 && args[1].match(/^[0-9]+$/) !== null) {
let cooldude = client.fetchUser(args[1]).then().catch(console.error);
} else {
cooldude = message.author;
}
let uiembed = {embed: {
color: 0x4A90E2,
title: "Profile for " + cooldude.username,
"thumbnail": {
"url": cooldude.avatarURL
},
fields: [{
name: ":tickets: Discriminator",
value: cooldude.tag,
inline: true
},
{
name: ":id: ID",
value: cooldude.id,
inline: true
},
{
name: ":battery: Status",
value: cooldude.presence.status !== null || cooldude.presence.status !== undefined ? statustags[cooldude.presence.status] : statustags['offline']
},
{
name: ":robot: Bot",
value: cooldude.bot
},
{
name: ":comet: Account created on:",
value: cooldude.createdAt
}
],
timestamp: new Date()
}
};
message.channel.send(uiembed);```
why?
i'm not an expert in promises
@trim plinth I am on the site but i am lost can you tell me how? π
which language is your bot in?
whose? mine d.js
mk
d.js
@cunning karma https://discordbots.org/api/docs#jslib heres where you should be at if you're using js
okay
and my error?
@trim plinth const DBL = require("dblapi.js"); const dbl = new DBL('my key'); setInterval(() => { dbl.postStats(bot.guilds.size, bot); }, 1800000);
i used that but it is still not working and sorry for another ping
for dbl.postStats, you don't bind to the bot
const DBL = require('dblapi.js');
const dbl = new DBL('some api token');
setInterval(() => {
dbl.postStats(bot.guilds.size);
}, 1800000)
@cunning karma
Error?
Nothing
you could also have it this way @cunning karma ```js
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
instead of client you'd do bot
or whatever you have your client variable named as
If u rlly want search dis
from: Telk#2726 snekfetch
It shows u the way to post stats the long way
that takes too much hassle 
it's easier to just use the lib instead of POSTing manually with snekfetch
Well ye I said if u want to do it the long way
any one knows why windows created this \\?\C:\Users\sande\Desktop\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot
it just keeps going XD
I need help with the Nadeko bot :3. I can't seem to add new .iam roles ?
@fleet mason press Ctrl and C at the same time to stop it
its 265 folders
@small bane go to nadekoβs support server
oh god
I couldn't find it @earnest phoenix
yea
what have you done
it send me to the "Discord bot list" server
did you actually run the code
yeah
and you should put that in your ready event btw
yeah thats what i did
@cunning karma did you install the npm package
yes
\\?\C:\Users\sande\Desktop\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands it wont stop going like WTF any of you guys know how i can delete this?
bot.on('ready', () => {
console.log("Loading...");
setTimeout(function(){
console.log("Bot has been loaded completely.");
}, 1000);
setTimeout(function(){
console.log(`Logged in as ${bot.user.tag}`);
}, 2000);
bot.user.setActivity(`t!help | ${bot.guilds.size} | ${bot.users.size} users`, {type: "PLAYING"});
setInterval(() => {
dbl.postStats(bot.guilds.size)
}, 1800000);
})```
@cunning karma check your console for errors
@fleet mason kill the terminal process
before you get a bsod from letting sit around for too long
the best thing is that all my pces have these folders now because i sync them with onedrive :/
ew onedrive
i have no better option for school XD
ur missing the token
i hate it because its updates so slow
close the terminal and delete the folders, ez
@cunning karma did you put the API token
ok there you go 
Thanks π
np
wtf have you done
Idk
like actually what
It just happend

one more reason not to use onedrive


who uses VPS here?
almost everyone?
digitalocean
My bot is connected but on discord bot list it is diconnected, how to solve the problem ?
Oh ok
Ovh is pretty pkay
Okay*
I got a year plan there with a mate costed like β¬44 each
Cheap enough for meπ€·πΌββοΈ
I would like to add the command &daily (the prefix of my bot is &) which gives 100 experience points to the player and which is done once a day, can someone send me the Java Script line of code for this order ?
we dont spoonfeed here
In private messages
we dont spoonfeed there either
we dont talk about there 
# tempmute command
@bot.command(pass_context=True)
@commands.has_permissions(administrator=True, manage_roles=True)
async def tempmute(ctx, member: discord.Member, time):
"""Tempmutes a user."""
if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.manage_roles:
role = discord.utils.get(member.server.roles, name='Muted')
await bot.add_roles(member, role)
embed = discord.Embed(title="User Muted!",
description="**{0}** was muted by **{1}** for **{2}** seconds!".format(member, ctx.message.author, time),
color=0x146aeb)
await bot.say(embed=embed)
asyncio.sleep(time)
await bot.remove_roles(member, role)
else:
embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.",
color=0x146aeb)
await bot.say(embed=embed)
``` Would this work?
@trim plinth do you thing if someone do !commads/mybot that it will think it is a new directory and make more files?
My command handler ``` client.on("message", message => {
if (message.author.bot) return;
if(message.content.indexOf(config.prefix) !== 0) return;
// This is the best way to define args. Trust me.
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
// The list of if/else is replaced with those simple 2 lines:
try {
let commandFile = require(./commands/${command}.js);
commandFile.run(client, message, args);
} catch (err) {
console.error(err);
}
});```
or anyone?
because something created 262 folders after echother
You don't seem to create a directory at all there
@low owl how could my bot create 262 folders ?
C:\Users\sande\Desktop\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot
these folders just keep going XD
anyone knows why this got created by either the bot or onedrive
No idea, I don't do Javascript. And I doubt require creates a folder if it can't find one
How would you do xp, mysql cant handle a trillion messages with on_message
http://loli-tits.should-be.legal/23d426.png
2muchconnections
cant connect to it π
if I limit it to something like if user.id == x it would connect fine 
Probably does so
when is execute ran
on_message 
smh
But, why?
i need to get lastxp time 
open a connection, store it in client or smth so its always accessable
and then use that for queries
instead of opening and closing connections constantly
Also, I would advise against the way you write queries.
Very prone to errors. There are solutions that generate the query string for you.
And are (imo) much easier to read
I have a retarded question, I'm trying to use an API in the guideline it says 1 request per 2 seconds. does that mean I can only use a command once every two seconds or what ?
i need help
with eval
it doesnt send the message
when !eval was executed by other user
do you get a error
@earnest phoenix ^
I would like to add the command &daily (the prefix of my bot is &) which gives 100 experience points to the player and which is done once a day, can someone send me the Java Script line of code for this order ?
lmao wtf
You won't learn anything from getting spoonfed and it also wastes our time
Ples halp
what do u need help with
ok
It was a semicolon :v
i know what "it" was
What?
dw
ok
why python is better
any one knows how i can delete a infinite file or like 242 folders
Break the chain
Can't you just delete the root?
Ah.. are you on linux?
windows
What does your file/folder structure look like?
C:\Users\sande\Desktop\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot\commands\EUW Bot
ect
Why can you not delete the second EUW Bot?
Is there some sort of error?
Ah
Can you quickly boot up CMD/Powershell and navigate to the root of your recursive folder?
Or just do: rmdir /s /q "\\?c:\Users\sande\Desktop\EUW Bot\commands"
If you wonder what \?\ is, it turns off file name checks
idk
and allows paths > 260 chars
why does windows allow something to create 262 folders... Who does that on purpose
It's not the OS' fault
ik but when it cant delete it i think windows lack some features
Well, that it can't delete it because file name is too big is kind of meh and surely has its origin in some implementation of some system. But unfortunately you have to deal with it.
Were you able to delete it now?
yea
@languid dragon How do you connect to your other shards? π€
like, in your shards command
Yea
you'd need to ask @earnest phoenix he did that
but im pretty sure it's just something to do with the eris sharder we use
Ah, alright, nevermind it then. Thanks for the answer anyways π
Eris itself can do that
You don't need a sharder for that
and I don't even think you're using an Eris sharder @languid dragon
wym
Eris has seamless internal sharding, you don't really need "an Eris sharder"
unless you're in a buttfuckton of guilds
honestly im clueless with the eris stuff
it's all solace that does @cosmic shoal
tbh i just help out with the code and logic with some stuff
Solace has done (for the most part) the structure
and the commands and stuff
i'm just cleanup duty 
pretty sure it is
Eris, a NodeJS Discord library
Yesterday my bot launched both shards fine but today only one shard is working. could someone help as i do not know what to do
you don't have to use an external sharder for Eris below 50k guilds imo
fix d.js sharder when
memer started getting issues with Eris internal sharder at 60k but that wasn't Eris' fault, it was Node not being able to handle that much I/O on a single process
d.js is a lost cause :^)
good thing im rewriting with v12 since i dont want everything to fuck up when its out
v12 is just a lot better than v11 why do people even use stable
people should just use master
very good
i hear people say "ill wait until its stable" but lets get real they won't release it for another good few months
when it goes stable they will probs cry
even though it is relatively stable its still not gonna get released for a loooong time 
cus it breaks everything
it does its a big update
but thats why people should update as new things get released
thats what i do, im always updated to latest master
unless its a bad update
which is why im rewriting :^)
but you wouldn't have to rewrite if you constantly updated your code 
yes
i skipped from 11.2.1 to v12
oof
fuck the rest
possible to move this info? http://prntscr.com/j2kjjw
css
I have a bot that's already on DBL's website, but got recently kicked from the discord server b/c the help command didn't work. How would I be able to request to get it back on this server, since the bug was fixed?
speak with the mod who kicked it
you can find that sort of information by searching in #mod-logs
ok cool
What do i do if i want to get invites to the discords my bot is in
Why do you want to do that
^
To exploit them
I find it rude to have your bot create active invites to servers it's in if it's unwarranted
Or even get active invites if possible
It's not rude, it's shitty.
It's rude also
Language?
no
you can't get the nitro either
you can check for animated avatar
but not all nitro users have aninated avatars
https://discord.js.org/#/docs/main/stable/class/UserProfile?scrollTo=premium is this not nitro?
wat
Premium is nitro.
Not on py >:3
for selfbots @floral stone
Fuck.
Be nice if it did.
ye
http://nekos.life/api/v2/img/bj
what would the path and authorization be for this\
@earnest phoenix So, what is exactly your problem for now?
I Canβt Get My Bot To Go Online, BTW I Didnβt Really Do Much Codingβ¦
What kind of error you getting in your terminal or console.
If I Canβt Get My Bot Online I Cant Have It Approved
I know you can't get it online but is there a any error what you get when you just pressing/entering your command-start line.
Yes
EOF
Or
Just Wait
What you already made if I may can ask you.
In which language?
JavaScript And Discord
Hold on
Back
donβt know what it menas
Means*
MPPPHH STUPID PROBLEMS
Why This Have To Happen To Me??
Soβ¦
Hold On, Take This To DM (Direct Message)
invalid character means something is not right
line #1 is where it is
thats quite easy to fix compared to the other errors
Every time I let my friend host my bot it gives him this error Script: jsfile.forEach(f, I) => { let props = require(./commands/${f}); console.log(${f} loaded!`);
bot.commands.set(props.help.name, props);
});
});
Error;
you need the help object in that command 
What languages do you guys suggest for a starter?
@sturdy herald python
JS or Python
hey
joinedguilds[i] = new JoinedGuild(x.Name, $"{x.Owner} ({x.OwnerId})", x.GetInvitesAsync().Result.First().ToString());```
returns 'One or more errors occurred. (The server responded with error 50013: Missing Permissions)'
please help :0
users wouldn't want a bot logging an invite to their guild
it's for unbans
people can then get a reinvite if they're banned
assuming they're in here or another server with my bot
Hi, anyone want to create βlogin with discordβ button on dashboard.luki.xyz, I have some money I can give for that <
406800811700781076>
Not really
What lang
Wew
I want something like that
And when you click on server you can invite the bot to him
Iβll do the dashboard later
Ohh gg
I was gonna dm u about that

So, can you do such thing? For money if you want
-botinfo @earnest phoenix
365958655926992896
Luki
9729
Luki is an easy-to-use bot with commands that can be used for fun, moderation, games, and more!
Luki.js
l.
102
1535 Servers
@upper ember 
@astral patio 
@timber hawk
Yeah
So.. can you do such thing for me?
Yeah
How much do you want for that?
5$
Ok
Iβll pay and then the code?
I prefer, youβll finish, show me, I will pay, and then the code
Yeah. Iβll even show you the product
Thatβs the question 
Ohh about the secret/token just do
var token = TOKEN_HERE or something like that
@gilded blaze what should be the question?
Ye
how 2 rounded image in PIL π
-botinfo @fiery fractal
-botinfo @jagged helm
430714908653387777
7/24 Asistan!
8839
TamamΔ±yla tΓΌrkΓ§e | Moderasyon | Resimli profil | Liderlik sΔ±ralamalΔ± level sistemi | Destek sistemi | Reklam engelleyici | NSFW. TΓΌrkiye
discord.js
<
55
No server count
@hallow nimbus
@worthy bronze
can you not
-botinfo @signal aurora
-botinfo @gilded plank
264811613708746752
Luca
0393
Luca is a bot for managing and informing members of the server
discord.js
- or @Luca#0393
79
2 Servers
@fossil oxide 
@languid dragon 
@bitter sundial 
Invite | Website | GitHub | Support Server
someone gets told not to do this, next one continues it π€¦
testing channels exist for a reason
thanks
whats a good meme api?
You can try https://api.ksoft.si for ease of use, but you can also just use reddit, but it's a bit slow if you want a random image (https://reddit.com/r/memes/top.json)
isn't there something like message.guild.id in discord.py ?
Hey, I was trying to use fonts on my bot page:
On safari, it worked perfectly
but on chrome:
does anyone know what's happening?
here is the code:
@font-face {
font-family:makerbot;
src:url('https://github.com/tandpfun/makersandbot-files/blob/master/Android%20101.otf?raw=true');
}
and where it's defined:
.titleandvote h1 { height: 75px;color: #F8B90E;font-size:3vw;font-family:makerbot }
and
IIRC you can only use google fonts if you're not certified. CC: @bitter sundial
.votebutton { background-color: #F8B90E; box-shadow: 5px 5px 5px grey;font-family:makerbot }
wdym?
I think you can use any font
well, i'm not certified
Does the Developer Console show any warnings?
ummm
this is the DBL page
I know
is there a console?
Inspect Element, Console tab
(I'd have checked myself, but am on mobile.)
the top one
what does that mean?
@bitter sundial r u sure, somthing is being blocked
I'm trying to remember (bare with me if I misremember), but I believe because of CORS you are not allowed to hotlink from GitHub.
why?
there's no Access-Control-Allow-Origin header where it redirects and that makes chrome not load it
Try that.
ok
ok
this won't work just so you know: https://www.dropbox.com/s/v91ev3gjhxtao2y/Android 101.otf?dl=0
dl=1?
It won't work on dropbox because file redirects aren't allowed I believe
oh
That's why ?raw=true wouldn't work either
didn't work
Ugh hmm
Nice
Why can't i edit these fonts: https://i.gyazo.com/52af989f37626e60ab76b10558e65264.png
are they pre-defined?
How to get discord.Member object from message in on_message function in discordpy?
@wet ferry you can edit them
@wet ferry css?
yes
!important
it ignores it
using !important after it
oh
i see
Hey
hi
hmm i have discord.py installed and its giving me this oof
ping me if you know the solution
for the deletion of messages, how would you make a bot do that? i'm using js
@dusty sandal for discord.js it is <message object>.delete()
<message object> means what
A message object
sorry im an idiot
Example this message I am sending is an object
ok
So in your message event handler it gives the message object
what i put in the () is the amount of messages to delete
purge?
Mass delete
well i want to specify the amount of messages to delete
I think that is bulkDelete or something. Should be able to find it on the docs
ok thank you for your help
Np
@loud bear there is no is_owner function
yes there is it works fine no issues on windows
@loud bear Are you using the same versions of python? Py3.6 changed some stuff
That's like the limit of my python knowledge sorry π
hmm fixed that now im getting this oof TypeError: change_presence() got an unexpected keyword argument 'game'
Using the same versions of discord.py?
I figured it out
turns out the arg. game was replaced with activity so i had to replace all game=discord.Game to activity=discord.Game
for js how do i make a bot delete a message it sent after a certain amount of time
@dusty sandal d.js?
setTimeout(() => { msg.delete() }, 5000)
};
that might work
its returning an error because you are defining it as message
unless you main one is msg
message
ok
what
if anyone can help me, dm me with all the detail for i shall be going away
Nice name reveal @dusty sandal
γγγ¬γ’
i see it in the file directory
:P
i should probably delete that and i would be grateful if you delete your message with my name, thank you
thank you
module.js:559
throw err;
^
Error: Cannot find module '/root/discord-HathorBot/config/app'
at Function.Module._resolveFilename (module.js:557:15)
at Function.Module._load (module.js:484:25)
at Function.Module.runMain (module.js:703:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:665:3
I have a long/high experience but I never saw in my 12 long year Development experience this error (Yes..) really weird. So my question is. Can someone tell me what is wrong
you are missing .js at end of require that tries to require config/app
shouldn't make a difference (unless there's a node version that doesn't handle that kinda thing?)
@frigid thistle what don't you understand
personally i don't really know since i don't use snekfetch inside the browser
what's the web JS equivalent of node js require()
i use XMLHttpRequest
import, i think..
Ok
So
then
I just send a get request to https://discordapp.com/users/@me
and then take the user's username, and log them in with it?
to my site
no
?
Developer
positive it's there and you haven't forgotten to upload it?/
lul
xD
hm i always thought thay worked only with dir/index.js
you need to read the docs
i know what you're going through right now, you don't want to read the docs, you just want to get this working
but 1) you don't learn anything by just skimming over things and asking other people for help, you need to find some stuff out yourself
2) the docs have all the information you need, including endpoints and the authorization required to get information from those endpoints
]]ev -oo new (require('./SQLCommand')(Main).Dir
xD
i know you don't want to read the docs but you HAVE to
oof
alright, I'll try again in the morning, lol
sounds good
ignore that
Can someone also tell me how I would create a PostgreSQL server
cuz I cannot for the life of me
manage to figure out how to create one
well
I know how to get to the create popup
but
what account do I use for username and password
are you on windows or linux
did you install postgres
yes.
when you were installing it it probably asked you what the default username + password should be
you don't need to make an account
oh
well idk the username, pswd etc
for pg
but that explains a lot, thanks π
didn't it ask you though
like what do you want the default password and stuff to be
no, someone else installed it on here
ah
and I had no knowledge of the default username/password, so I thought I had to make an acct on PgSQL website
nah
A fast questions, I've ever just made that I can use one of my custom emoji's that I have in my server how to insult this into my .js code again?
#Forgot excuse me to ask this of course
is ur native English?
how does the sharding stats work?
each shard is to post their guild count
and DBL sums the count from all shards?
@bitter sundial
r u using the module or
manually posting?
if you're manually posting you need to post your summed server count and shard count manually as well
i haven't used the API in a while so IIRC its something like
server_count: Number,
shard_count: Number
what do you mean the documentation is lacking
1 sec
on phone
shards Array of Numbers The amount of servers the bot is in per shard. No (unless server_count is not set)```
that is convoluted af
server_count - ok. the amount of servers the bot is in
shards - the amount of servers the bot is in per shard? as in total_server_count / shard_amount ?
array of numbers?
Every shard has specific amount of guilds
so therefore like: [2500, 2500, 2500] - as in 3 shards each of 2500 guilds?
just easier not to post the shard information
easier sum the guild count yourself and post it in 1 hit than understand what the api is actually doing
Well, of course abstractions are always nice, but you should understand the underlying complexity to some degree
imagine people using shards but having no idea that there are guilds per shard (or how many)
I think you are right though, the documentation seems unreasonably convuluted
i understand the complexity associated. i can also excuse the lack of thorough documentation as DBL is fairly immature in terms of how long it has existed for
all good, Natsu cleared it up enough for me to fill in the blanks
Alrighty, have fun π
ye
what the fuck did I send that like 5 hours ago
-bots @earnest phoenix
@opaque temple 
@austere badge
@visual ivy
@vernal lion
-botinfo @opaque temple
310039170792030211
NekoBot
2551
NekoBot, General commands, NSFW commands, Simple Moderation commands and more!
n!
4541
7671 Servers | 10 Shards
@low horizon 
@solid cliff 
Invite | Website | GitHub | Support Server
Please not in development
@earnest phoenix hi sorry to bother but is there any good way to cache information for guilds? i need to start caching guild configurations since im getting deadlock detected and thats no good, but i can't think of any simple way to store the config or at least make it so there are less requests to the DB
when you get it'll get from that collection, when you set it'll set it into the collection and write to db
on ready just sync all data into cache
There's http-nextra but i forked it and added shit so i call it http-nextra-nextra
Lmao
@earnest phoenix ok im sorry for pinging again but one last quick thing; what do you use for colors in your logger? my colors work on windows but not linux and no matter what i do i can't get them to display on linux so im thinking my colors module is fucked
I told you, Klasa colors
o
Hi, I am new to the development of bots and I ask myself the following question: How to display the number of server or the bot is connected? I use Java for my bot. Thank you π
On DBL or in your bot?
@naive aurora
ok
I think in my bot I use jda.setGame(Game.playing ("!!")); but I will want instead of "!!" the number of servers
jda.getGuilds().size()*
I got an error on getGuilds()
Cannot resolve method 'getGuilds()'
@abstract crystal
Maybe it does not exist
Oh, how should I proceed? Use another lib or what?
what are you using?
JDA and jda-utilities
JDA jda = ...
jda.getPresence().setGame(Game.watching(jda.getGuildCache().size() + " servers"))
to get size always use getXCache().size() instead of getX().size()
first one is O(1) and does zero memory copy
second is O(n) and creates a full copy
^
-botinfo @spring parrot
Please include a bot mention
also @warped frigate use ListenerAdapter
no botinfo here
Okay thanks
okay
I see that and I go back after
Hum :/ I don't understand a got an error on getPresence()
what's your code?
Hum ...
jda.addEventListener(new ListenerAdapter() {
@Override
public void onReady(ReadyEvent event) {
set game
}
})```
I need to put jda on final ?
Variable 'jda' is accessed from within inner class, needs to be declared final
might be wrong language level configured
I need to use Java 7 or Java 8 ?
what's your build.gradle?
I'm using Maven
Okey so now i got an error on getPresence() and getGuildCache()
Cannot resolve method 'getPresence()'
Works thanks
api.getGuildCache()
Nice thanks you so much π
One last little question is there a more precise doc for JDA than the github?
Thanks you
I am stuck on https://discordbots.org/blog/post/making-a-basic-bot - I do not have all the files as the tutorial. including the src. Any help?
"Wait for gradle to finish configuring your project, and you should see a screen like this"
those folders are automatically created
Still i don't have those im in the screen in step 4 But I do not have the included files.
send a screenshot of the whole intellij window
if there's a blue bar in the bottom right corner gradle is still configuring your project
I have this "Could not determine Java version using executable C:\Program Files\Java\jdk-10\bin\java.exe."
@inner jewel
Anyhelp?
Anyone understand Lambda in java and how to get the expressions to compile?
wdym?
you need to replace those
How do I use client.change_nickname in discord.py? TypeError: change_nickname() missing 1 required positional argument: 'member'
await client.change_nickname(member_obj, "New nickname")
After you instantiate client discord.Client()
What do I fill for member obj?
The object of the server member who you are trying to modify. https://discordpy.readthedocs.io/en/latest/api.html#discord.Member
^
@inner jewel Did you figure anything out?
@topaz fjord
const { Command } = require('klasa');
const { Client, TokenTypes: { Wolke } } = require('weebts');
module.exports = class WeebAPICommand extends Command {
get weebAPI() {
const client = new Client({ token: this.client.tokens.wolkeToken, tokenType: Wolke }); // this needs to be saves somewhere but all command instances should share the same client instance
return client;
}
};
if i do this it will create a new client every time this is called
i would like that all my WeebAPICommands share the same client instance
yes but doesnt that static keyword preserver the function
uhh
Anybody know how to fix this? I'm missing the files that are shown in step 5 of the 2nd tutorial.
^ try rebuilding gradle ?
How would i do that?
go to build in toolbar
Thats the 5th time i remade a new project
Can't find build
Its probably a java problem
i have the latest java and then jdk 10
@restive silo does it work
wut doesnt?
look at the pic i sent
you create a new one every time the function is called
yea thats what i wanted to say to turtle
thats why i struggle to find a way to save it somewhere
const globalThing = ...
class X {
static getGlobalThing() {
return globalThing;
}
}
because i want that all my comamnd class instances have acess to the same client instnace
i cant do that
since i need client.tokens for the weeb.sh token

make it lazily initialized
let client;
class X {
static getClient(info) {
if(!client) client = new Client(info);
return client;
}
}```
that wont work since i need the client for that and this is only acessable from the command instance

seems like i need to use tokens in another way now
cant put them on my client anymore
make it not static then
well doesn't solve the problem that the tokens are only acessable in the client
from the this context
but i guess i need to use Enviroment Variables other way now

lmao
let client;
class X {
get client() {
if(!client) client = new Client(this.client.x, this.client.y);
return client;
}
}```
why wouldn't this work?
oh
still global
still lazily initialized
Did anybody solve the problem?
@restive silo
What JDK should i have and what version of java?
why do you assume i write java
but to use JDA you need Java 8 atleast
I have 8, i have to remove my jdk then
your build.gradle has the same contents twice
I am also still missing src
ah thanks
This is where I currently am.
Should it be the one in the tutorial?
nonono. with the token anyone can login to your bot
Im new to this entirely
Well how do i fix my problem?
Im also having errors, about 5 on what you see
@gilded blaze
idk java
What should i replace the token with?
I didn't even import it
public class Main {
} <--------- error here
public static void main(...) {
...
}
the method is outside the class
you don't import your JDK, your import the JDA library
Thats in the external libraries if i am correct?
no
you don't need to worry about that
make sure you have JDA in your build.gradle then import into your main file
Ok here, how the fuck do I import. What part of the Library and what the fuck
Thats mine, tell me what the fuck i am missing i've been doing this for about 4 hours now.
Im trying to make my bot play a sound file when it join a vc, but it joins but doesnot play the file.```js
//Steven Loves Cookie Cat
if (message.content.startsWith(prefix + 'cookiecat')) {
message.channel.sendMessage('I Love Cookie Cat!
\nIf you are in a Voice channel I will sing the song!
');
const connection = message.member.voiceChannel.join();
connection.play('https://cdn.glitch.com/3b971df8-c1b8-4b3d-8b2c-749c9e197d77%2Fcookie_cat.mp3');
}
the file im trying to play: https://cdn.glitch.com/3b971df8-c1b8-4b3d-8b2c-749c9e197d77%2Fcookie_cat.mp3?1523404175369
https://cdn.glitch.com/3b971df8-c1b8-4b3d-8b2c-749c9e197d77%2Fcookie_cat.mp3?1523404175369
@trim plinth How do i put the JDA in my build.gradle?
yay.
way less
unless you have music added
or other resource intensive things
or the bot is in hundreds of guilds
Hey Snarkyllama could you help. how do i set up my build?
hmm
other than the mistake in utf-8
how much ram would an average 5kish~ bot take up
yus
oof
with a bot that has music and 1.6k guilds i use 470mb 




