#development
1 messages · Page 444 of 1
can you try
npm uninstall snekfetch
npm install snekfetch@3.6
okay
3.2.4 is outdated af
snekfetch@4.0.4 is known to have issues with requests

that too
what causes the issues with requests? 
im not quite sure tbh
i know that discord.js had to move away from the newer versions of snekfetch due to request issues with ratelimiting or something similar
other people were also reporting issues with getting 401's
or just use request ;)
lol
can you use npm ls snekfetch again?
if the version is right you must have something misconfigured in your code, or you have the wrong token
okay
i don't know much py
can't help you there
also please https://please.zbot.me/FLl0I4Rg.png
code?
there's a few music bot templates online
there's one for py
did you want it
https://github.com/Just-Some-Bots/MusicBot
if you want to submit it to this server though, you need to make your own modifications
im pretty sure to run a python bot (or any python file) its just python <file>.py
otherwise you're just submitting a clone
or if you have python 3 just do python3 <file>.py
that template does have a start.bat file tho
wat
just open a folder
File > Open folder
i think
pls no spam
luca bot developed by weebsite admins
^
might be shit internet and mobile
true
@restive silo @knotty steeple Is there a way to bring them in right order by commands or sth ?
i was about to screenshot that
and i have no idea
```js
// code
```
code block
now you're just spamming
{type: 2} im pretty sure this is wrong
Whats so hard about giving useful answers 😃
@knotty steeple type can be an integer
ok stop
yeah a string or a number
@mellow plume you've spelt member wrong https://please.zbot.me/wQAGWGiJ.png
memeber
yes i just told you
yes
if you don't give us an error to work with we cannot help you
there is also something else wrong
please read the topic of this channel
internet maybe that bad that messages are being sent with like 2 minute delay
dude... get a better internet
^^
Blake showed you what was wrong =>
I don't know if you did not understand what was wrong or if you actually did
Just copy that...
Fair enough
i made a music bot in js but i have a problem idk why its not working can someone help me?
Send the error and relevant code?
the code is big
the error
this is the error
this is the code
idk
why is not working
@spring ember
What error on the console
emm
Discord.py rewrite latest.
Are there any code examples for voice commands?
code: 400, message: 'Bad Request' you did a bad request
is there a way to add/remove a column in the existing table in the database with sqlite3?
ALTER TABLE {tableName} ADD COLUMN NewCol {type_here}
alter table is very limited in what it can do
for example, I'd like to be removing more than adding new ones
I find a workaround by making a temporary table with temporary data, but I need to be 100% certain that there is no official way of doing it
is there none for c# in there
i asked you if there isnt any c# examples in the channel
@raw horizon DiscordSocketClient.Guilds.Count
What causes a bot to take forever to start?
database maybe
- how many guilds do you have
- do you have to compile before every run
- what's your connection speed
I find that the more guilds a bot is in the slower the loading time
can someone help me for testing , i want to speak with <@&304313580025544704> if it is possible
🤦
uhh
yikes
Rofl
oof
👏🏼
@vagrant sinew what's up
Um
@someone
um no its not possible
as you know i declined a lot of times 😄
Sherlock is that you
but i have to explain it
I have a question anyway
now it is working
got declined
apply it again?
okey
yep
wait
Is that what you needed the whole staff team for?
Is it possible to make an async function to load my bot commands from a separate folder when my bot goes online
Right now I just have a bunch of require lines under my message function
@vagrant sinew if you have any further queries please mention them in #memes-and-media so we don't disrupt others
okey sorry zBlake#0007
I need help, could anyone help me?
not to ruin your day or anything but https://please.zbot.me/NbC3QXfk.png
go ahead
still hasn’t asked the question
lol
Can someone give me code
Nvm
My eval command is brok.
an someone give me link to something that can help me?
JS
Dude I litterly gave MY eval command to you
Literally*
👌
don't be rude.
Anyone knows how to fix this error?
con.get(`SELECT * FROM blacklist WHERE snowflake = ? AND guild = ?`, message.author.id, message.guild.id, (err, r) => {
console.log('6')
if(err) throw err;
if(r) return message.channel.send("You are blacklisted.");
let command = bot.commands.get(name);
if(command) command.run(bot, message, args, con, cfg);
});
That's the wrong one XD
This error
It has something to do with the code above
The eval command doesnt work for me.
I don't know how to help when you don't show the code
Other then needing python and notepad of coarse why do you need to make a discord bot? Tag me plz because I won’t see this unless
It's fun
Like discord devdocumentation?
Link?
One sec
This is why I mean...
Oh, you also want discord.py
What’s that I’ve heard of jt
Link for that?
So can I have the link to discord py
Google it
For starters
Ok
Could I use notepad ++ would that be better
That’s better
Notepad++ is a text editor. If you use IDLE you can run your bot from it while developing
Why not use PyCharm?
Eats a lot of RAM, doesn't it
What does?
PyCharm
I have been told that it requires quite enough RAM, not sure myself though
1 GB of RAM is good enough.
In fact, I only allocate 1 GB of RAM for that IDE because that's all it needs.
Nah kthx Imma use notepad instead
Notepad?
:^)
The ++ one or the crap from Microsoft Windows?
Either you wish to imagine
just make the bot send arguments
by getting the message content and slice off the <prefix>say part
! keep getting this error:
at Timeout.setTimeout [as _onTimeout] (C:\Users\jorda\node_modules\discord.js-musicbot-addon\index.js:1892:17)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)```
well
My code at that point is:
const dispatcher = voiceConnection.player.dispatcher;
let vc = client.voiceConnections.find(val => val.channel.guild.id == msg.guild.id);
if (!vc.player.dispatcher) return;
try {
vc.player.dispatcher.end();
vc.disconnect();
} catch (e) {
console.error(`[leaevCmd] [${msg.guild.name}] ${e.stack}`);
}```
If I remove vc and instead put voiceConnection like the rest of my code would I receive an error?
maybe 
?
I don’t get it
It’s hard, but doable
i think he was talking about getting the token for his bot on mobile
which is fair
because the dev docs on mobile are unusable
If you want to get your bot token on mobile
Here's the steps:
- discordapp.com
- login
- go to /developers
- Desktop Version ✔ <- Since mobile isn't supporter you will need to do this
- make/get your token from the application
If you want to get your own token, on mobile it's not possible, nor on chrome nor on the application
It is possible, just tricky on mobile, but the problem is what you will use your own token for

yes, you can get your token from the client, quite easily in fact
but what would you use it for owo
On phone I tried multiple times to get it, haven't find a single button
desktop client
So i has this embed. Where the red arrow is, how do i push it across so its like there is 3 fields? 
to get the token on mobile you would need to have a development build of the mobile client
cause react native disables the developer menu in production builds
I do have development build
do you
yup
proof?
..
@sick cloud impossible
I'm on my VPS

rn
hmmmmmmmmmmm
um
you add a blank field or something i'd guess, dunno how tho
maybe they're using the primitive embed format and abusing the shit out of it?
ya I believe you have to add a blank field
well no
Blank fields are possible
if you never lnew
Knew*
i.e. directly constructing the json object that embeds are built off of
honestly i just wanna know if its possible :P
oh i thought you literally means 3 inline fields
It is
i think you can just stick a few hundred spaces before your content and hope it works
oof
i mean, would it be possible to add a field (inline) that has no title /desc
use zws or something?
@coral lichen if you have a development build of the mobile client run it in an emulator and do ctrl D if youre on ios or ctrl M if on android
i've read that opens dev tools
Will check when I get my development build as I left it at home
Nope
Android
@sick cloud set the field's title and description as \u200b (Null width space)
thanks :D
let nombrerol = args.split(' ').slice(1).join(' ');
what
It says that args.split is not a function
What is args?
if (message.content.startsWith(',.addrol')) {
let miembro = message.mentions.members.first();
let nombrerol = args.split(' ').slice(1).join(' ');
let role = message.guild.roles.find("name");
let permss = message.member.hasPermission("MANAGE_ROLES_OR_PERMISSIONS");
if(!permss) return message.channel.send("`Error` `|` No tienes Permisos para usar este comando.");
if(message.mentions.users.size < 1) return message.reply('Debe mencionar a un miembro.').catch(console.error);
if(!nombrerol) return message.channel.send('Escriba el nombre del rol a agregar.');
if(!role) return message.channel.send('Rol no encontrado en el servidor.');
miembro.addRole(role).catch(console.error);
message.channel.send(`El rol **${role.name}** fue agregado correctamente a **${miembro.user.username}**.`);
But what is args though
@sick cloud in discord.js there is a method to add a blank field
... it's called addBlankField
lol
@distant raven no, that adds a total space, and it doesn't work inline iirc
maybe
You can just do .addBlankField(true) to make it inline iirc :p
Thanks guys
Sorry for asking another thing (i'm so noob)
if (message.content.startsWith(',.mute')) {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(({embed: {color: 0x6139ad,description:"**❌ | You don't have permissions to execute this command**"}}))
let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send(({embed: {color: 0x6139ad,description: "**⭐️ | You need to mention someone or type an ID**"}}));
let role = message.guild.roles.find(r => r.name == "Rabot mute")
if(!role) {
try{
role = message.guild.createRole({
name: "Rabot mute",
color: "#000000",
permissions: []
});
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
} catch(e) {
console.log(e.stack);
}
}
if(toMute.roles.has(role.id)) return message.channel.send(({embed: {color: 0x6139ad,description:"**❌ | This user is already muted!**"}}));
toMute.addRole(role);
message.channel.send(({embed: {color: 0x6139ad,description:"🌈 | User muted succesfully"}}))
return;
}
That's the code for muting. Now everything goes well, but the bot does not add the permissions
We aren't going to spoonfeed you code. Add some kind of try catch around it maybe, debug it.
Okay 
Hey so I'm using sqlite and i get an error wich shouldn't be... db.get is not a function this is my code:
const sqlite = require('sqlite');
const db = sqlite.open('database.sqlite');
client.sqlite = sqlite;
db.get(`SELECT * FROM settings WHERE guildid = "${message.guild.id}"`).then(row => {
if(!row) {
db.run(`INSERT INTO settings (guildid, prefix, lang, color, admin, mod, user, autor, channel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,)`, [message.author.id, '!', 'en', '#ffffff', 'admin', 'mod', 'false', 'false', 'false'])
client.gprefix = '!';
} else {
client.gprefix = row.prefix;
}
}).catch(() => {
db.run(`CREATE TABLE IF NOT EXISTS settings (guildid TEXT, prefix TEXT, lang TEXT, color TEXT, admin TEXT, mod TEXT, user TEXT, autor TEXT, channel TEXT`)
db.run(`INSERT INTO settings (guildid, prefix, lang, color, admin, mod, user, autor, channel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,)`, [message.author.id, '!', 'en', '#ffffff', 'admin', 'mod', 'false', 'false', 'false'])
client.gprefix = '!';
})
Please mention me or I won't see
I'm trying to make a very dumb timeout function.. lol
a = 0;
sleep(5000);
a++;
and im doing if(a != 1) return;
So?
(t) => new Promise(r => setTimeout(r, t))
@coral lichen honestly you're not making sense, you're saying you want to check if a person has a role in the server, im asking how you have the person as
also im assuming ur using discord.js
Boi
Ye
I want to check if the person have the role
Or let me do it
Better
I want to check like if i or @neat falcon (
) have the L role on the KyaraHost guild
anyways, this is some code that will hopefully work in ur situationjs client.guilds.get('guildID').members.get('userID').roles.has('roleID')
bruh

if you have a user object you can use user.id in place of 'userID'

if u have a message object its message.author.id
why
@coral lichen if u didnt see it
if(!client.guilds.get('guildID').members.get(message.author.id).roles.has('roleID'))
return message.reply('You're not a donator!')
```just put that in the top of the command

i need to make a decent eval command for javascript. mine doesnt even work with newlines
how to i create a channel in a category in discord.js 👀
<channel>.setParent(<category id>)
and to create a category 👀
you use master or stable?
...
just found out
you did npm i discord.js to install it right
y..no
what did you do to install it
its like 11.2.0
thats outdated
i installed it once
update it
every time just copied node_modules
👀
hello alpha ^^
;D
;D
you want to stay on my discord for fun? ^^
dm
Do you know of any weather app that needs you to login to be able to use it?
If yes, what are the features that only logged in users have?
msg.guild.createChannel('announcements').setParent(msg.guild.channels.find('name', 'info').id);``` info is a category.. uhm..\
thats not how Promises works
Hi, i have a lot of else if in my code, do you think that use a lot of "if" instead of all these "else if" is better ?
Or use a switch is maybe a better choice ?
how ? I'm learning coding in same time i code so what sort of handler ?
Yeah, a switch is better for what you're doing without changing much
but I recommend trying to find/create a handler for your commands
@earnest phoenix like putting commands in seperate files
in functions or classes
etc
Ow yes it's I already do for the execution code but calling a file that will call an other file to execute the code will not augment the reponse time ?
no
it won't make a huge difference
in speed
or any difference in general probably
ok so from my index, I set and "if message starts with prefix", launch a commands.js file that will contain all the commands, is that ?
you'd rather put each of the commands in their own seperate files to avoid clutter
is that a question ?
oh ok i've bad translated it
so, if I correctly understand, in my index, i redirect it to a command.js that will contain all commands and they script is that ?
ok but in total, all the commands take around 2k of lines (so it's a little a mess), this is why I decided to separate it in 3 category files
you could have one command per file
wrong server
Why
Lol
@bot.group(pass_context=True)
async def purge(ctx, amount):
"""Purge a number messages. Pass noembed to prevent the success embed from sending."""
if ctx.invoked_subcommand is None:
if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.manage_messages:
await bot.purge_from(ctx.message.channel, limit=int("1"))
await bot.purge_from(ctx.message.channel, limit=int(amount))
embed=discord.Embed(title="Purged successfully!", description="Purged " + amount + " message(s).", color=0x176cd5)
embed.set_footer(text="Responsible moderator - " + ctx.message.author)
await bot.say(embed=embed)
else:
embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0x176cd5)
await bot.say(embed=embed)
@purge.command(name='noembed', pass_context=True)
async def _noembed(ctx, amount):
"""Purge messages without the result embed"""
if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.manage_messages:
await bot.purge_from(ctx.message.channel, limit=int("1"))
await bot.purge_from(ctx.message.channel, limit=int(amount))
else:
embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0x176cd5)
await bot.say(embed=embed)```
Should use the noembed logic if that subcommand is passed but it always uses the standard command.
if its d.js thats normal
i have that "problem" too so i researched
turns out d.js caches users as they come online
oooo I saw something to clear that
so overtime more and more users get cached when they connect
you can clear cache in master
im not running master yet
i solved the out of memory problem with a swap file
sweep
@topaz fjord I use master now, would you just make a sweep cmd?
Settimeout
in the main file right?
yeah
@sick cloud if you want to be able to clear the cache by cmd yeah
alright sweet thanks
the thing is sweep only clears according to a specific value afaik https://media.turtle-bot.com/f/DjsLG.png
when are they releasing the master fully?
dunno
soon™
ok
still in the works
if you want to see the things it changes
but thats only for stores
yeah which is kinda annoying
exactly why you should switch now™
Yeah I guess it's only 200mb out of 2gbs I'll wait.
the highest ive ever been is 700mb with 12 voice connections
rip
mine restarts like once per week and its fine
i dont restart since i dont find a reason for it
even when uploading new cmds i have a reload command
@quartz kindle how do you have auto restarts ?
oh you do it manually
but i need to restart everytime to do some change
and it auto restarts on any error
there's still errors every now and then
if u use pm2 just set interval for 1 week to process.exit(0)
i just use a loop
might change my bot to golang, since its pretty fast
won't change much anyway
since you spend more time doing I/O than actually using the cpu
for most tasks
I keep getting this error:
^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
My code right there is:
await member.kick(reason)
.catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`));
message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
}```
What is it I am missing at await?
discord.js
i see
what would be a fix now Im wondering...
it'd be better tbh if you put all your code in a hastebin or something
so we can better spot the issue
unexpected identifier is often caused by misplaced code, like a missing semicolon before that code
^
seeing as it didn't output the reserved error I don't believe this to be the case but make sure that the function is asynchronous
and some code before it would help
How to setup Atom with winscp
Open a file in Atom when you double-click it on WinSCP?
Right-click on the file you need > Edit > Configure > Editors > Add... > External Editor > Browse for editor directory
I'm pretty sure that's how you'd do it, haven't configured an editor on WinSCP since I first got my VPS
Hm for some reason I am not able to download discord.js commando. I keep getting:
npm ERR! error: pathspec '11.2' did not match any file(s) known to git.
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\*****\AppData\Roaming\npm-cache\_logs\2018-07-10T03_00_57_439Z-debug.log```
I tried uninstalling git and reinstalling, as well as removing and readding that file. Nothing is working...
so
thats the code i was having trouble with
error:
(node:6283) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'playStream' of undefined
at play (/app/commands/play.js:41:43)
at Object.exports.run (/app/commands/play.js:29:25)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:6283) 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: 7)
any fix?
Here is the log of my error:
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\*****\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'discord.js-commando' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 verbose npm-session 05b640078743174a
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for discord.js-commando@github:Gawdl3y/discord.js-commando#11.2 Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
7 silly fetchPackageMetaData error: pathspec '11.2' did not match any file(s) known to git.
8 verbose stack Error: Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
8 verbose stack error: pathspec '11.2' did not match any file(s) known to git.
8 verbose stack
8 verbose stack at ChildProcess.exithandler (child_process.js:275:12)
8 verbose stack at emitTwo (events.js:126:13)
8 verbose stack at ChildProcess.emit (events.js:214:7)
8 verbose stack at maybeClose (internal/child_process.js:925:16)
8 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
9 verbose cwd C:\Users\*****\Desktop\Discord Test Things\Music Bot (live, public)
10 verbose Windows_NT 10.0.16299
11 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jorda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "discord.js-commando"
12 verbose node v8.9.4
13 verbose npm v5.6.0
14 error code 1
15 error Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
15 error error: pathspec '11.2' did not match any file(s) known to git.
16 verbose exit [ 1, true ]
What is the issue? I have reinstalled git twice and deleted the file. Neither worked...
Any way to get a user's full username (discord.net c#)? For example if I do user.Username that gives me their username, but I want say for me, Ethan#5739 instead of just Ethan.
@stable juniper user.Username plus user.Discrim might work
Try Discrim or Discriminator
One of the terms
I'm just guessing how that would work, I don't know d.net
Give me a second I'll try that
👌
Ah that worked. It's either user.Discriminator or user.DiscriminatorValue depending on what context you use it in.
Thank you @gilded thunder
All good
Do you have a Tag property or something @stable juniper?
discord.js at least has <user>.tag, which automatically adds <user>.username # <user>.discriminator together.
Wym?
ohk
No I just concatenated them
I did something along the lines of
user.Username + "#" + user.Discriminator
I'm not asking that, I'm asking if your library has a tag property, in this case like user.Tag?
rip
Hey I need some help. I made custom prefix command but how to show it on help
When someone change the prefix of my bot, it should change on help tab too
language?
Does anyone knows some easy way or some program to learn russian alphabet and cyrillic?
whats wrong with this on python
@client.event
async def on_ready():
await client.change_presence(game=discord.Game(name='j!help'))
print("Bot is online and connected to Discord")
what?
there are 2 versions of discord.py library
async and rewrite
which version are you using?
if that would be rewrite I could help, cause I'm not async
ok
also async is very outdated and pretty much abbandoned
rewrite version is currently the only one receiving new updates
oof
i need a help
say what u need @cinder stratus
¯_(ツ)_/¯
by mistake cleared the code😭
your missing a )
okh
is that sourcecode i see 👀
looks like it
line 6
oo
you should reset your token now
where?
there isnt a closing }
just put a matching
he didnt close the if help
or that
either
doesnt matter
also I recommend learning javascript
^
^^
https://www.codecademy.com/learn/learn-javascript
http://www.learn-js.org/
https://www.udemy.com/the-complete-nodejs-developer-course-2/learn/v4/
Learn JavaScript and build interactive websites and pages that adapt to every device. Add dynamic behavior, store information, and handle requests and responses. This course can help marketers and designers upgrade their career and is a starting point for front-end engineers.
he didnt end the sender id if check not the help if
yes done
reset your token nvm wasn't scrolled down
fix that depreciation warning
how to fix that
ok
@lyric lotus I can help
You need to define the game change under the bot event async def on_ready():
It doesn't work in normal script
msg is not defined
Read the traceback before sending screenshots here
...
Becausen You Got Offend
Because you don't read whats wrong with your code and expect us to fix it for you.
That is what annoys me the most about newcomers
Same.
I'm having OperationalError: database is locked when I restart the bot on windows. Should I be worried about it or will this not happen on a Linux server?
that's what I'm afraid of
if I'm gonna upload the changes to the public bot and that will affect it
I'll have problems with all commands not being executed
cant run a test version?

@ruby dust that an sql error right?
sqlite3 yes
@thorny fractal Then write some code for it
idk how to write an code LIKE FR
then i suggest you not code a bot
and learn the basics of some language
then learn basics 2..... 3, 4, 5 and 6
then intermediate
then get a though tof coding a bot
then learn expert stuff on the language
then attempt
lol you don't need full proficiency to make a bot
so I'm still getting OperationalError: database is locked after restarting the bot even in the linux server
my only assumtion is my code
I want to have a list of commands and how many times each command was executed
command_list = ['help', 'invite', 'commandstats', 'lookup', 'uprate', 'downrate', 'logging']
for i in command_list:
try:
c.execute("INSERT INTO CommandStats (Command, Counter) VALUES ('" + str(i) + "', 0)")
conn.commit()
except sqlite3.IntegrityError:
continue
```even though the `Command` column is set to unique, I found this the easiest way to quickly create all rows with all commands, that is when the bot is starting up
if this is the actual reason why it's locking the database, maybe some other options could be handy?
If I have settings.json in the same folder as .gitignore, do I just put settings.json in .gitignore?
yes
Thanks
Okay I feel dumb
How do I make the timestamp on the embed autogenerated
I tried "timestamp": Date();
Have you tried converting the Date object to a string?
I assume JS has a str() function of sorts
I’m not a JS developer, so idk
oof
nice
shouldn't that be in #memes-and-media x
Hello
how do you make the bot send the message to a specific server in a specific guild?
how do we know what library it is?
tried to use this but channel was undefined...
client.guilds.get(<guild id>).channels.get(<channel id>).send(<message>)
discord.js
also to a specific server in a specific guild wat
i want it to send a message to a channel in my devserver...
client.channels.get(id?).send(message?)
??
ill try try that
(node:12996) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
now what
the id must be a string, and only numbers, without the <>, for example client.channels.get("9746593794563").send()
ok thx
uhhh
{ DiscordAPIError: Missing Permissions
when trying to use guild.fetchInvites() on discord.js
what
the bot has the Create Instant Invite perm
what else does it need
View Audit Log
It needs to see all the invites that have been created. The only place to get them is in the audit log
discord needs to add something better
that gets them
requiring the bot to search the audit log is a bit shit
it still says Missing Permissions after giving it the view audit log perm
so huh
oh
it requires Manage Server
according to the Discord docs
that's
what
@sullen path
my bad
Just like us users need Manage Server to access the Server Settings "Invites" tab @stiff juniper. lol
Why is my file sending me this error?
exports.messageEdit = async (old, new) => { ...
you're missing a )
(function (exports etc))
at least that's what I can see from the snippet
Figured out that new is used, but I'm not. :p
👍
How i make user avatar editing with python bot
Hey, I would like to use this documentation page: https://docs.discord.club/xenon/ on my dbl bot page. I tried with an iframe: <iframe src="https://docs.discord.club/xenon/"></iframe> but it just shows a white page.
I thought it's because the page has a pretty long loading time, but maybe there is a way to fix that 
@worn ridge A) where are you placing it?
B) Check the console for errors (CTRL+SHIFT+I -> Console on Chrome)
@gilded plank bots @worn ridge
@quaint flax 
@last onyx 
works for me @worn ridge
actual page
Maybe it's because of this?
but uhh that error in the console isn't fixable by you because it's a header thing
if "X-Frame-Options" is "sameorigin"
as you can guess
it'll only load iframes of discordbots.org
what's the best Discord bot library according to you guys?
But why is it working for you 😄
discord.js in my opinion
it's fast, nice and easy to use, etc etc @red spade
@worn ridge idk
¯_(ツ)_/¯
Ok thank you anyways 🙃
Ok seems like it's a local cache issue
it works in incognito
i see
The best Discord bot library is the one you use
.bot-name {
-webkit-animation: rainbow 5s infinite alternate;
animation: rainbow 5s infinite alternate;
}
@keyframes rainbow {
0% {color: blue;}
10% {color: #8e44ad;}
20% {color: #1abc9c;}
30% {color: #d35400;}
40% {color: blue;}
50% {color: #34495e;}
60% {color: blue;}
70% {color: #2980b9;}
80% {color: #f1c40f;}
90% {color: #2980b9;}
100% {color: pink;}
}```
How does one do that?
Like the rainbow name
this doesn't work for me >.>
How should I make a detailed information and guide about my bot
He is on ca 110 Servers.
Should I make a own website or is there anything other where I can write a detailed Information about it (I saw some people using github)
you could make a own website if you know html, css and js or just document it on the discord bot list, make a help command with detailed information or do it on github
@onyx summit
thx but found gitbool, seems pretty cool
ah k
aahhh
can anyone help me with my play function?
play(message, queue, song) {
const search = require('youtube-search')
const ytdl = require('ytdl-core')
const bot = message.client
const opts = {
part: 'snippet',
maxResults: 10,
key: 'YOUTUBE API V3 KEY',
type: 'video'
}
var intent
let player
let test
try {
if (!message || !queue) return
if (song) {
search(song, opts, function (err, results) {
if (err) return message.channel.send('Video not found please try to use a youtube link instead.')
song = (song.includes('https://' || 'http://')) ? song : results[0].link
let stream = ytdl(song, {
audioonly: true,
qualty: "highestaudio",
highWaterMark: 30000
})
if (queue.length === 0) test = true
queue.push({
'title': results[0].title,
'requested': message.author.username,
'toplay': stream
})
message.channel.send('Queued **' + queue[queue.length - 1].title + '**')
if (test) {
setTimeout(function () {
bot.functions.play(message, queue)
}, 1000)
}
})
} else if (queue.length !== 0) {
message.channel.send(`Now Playing **${queue[0].title}** | Requested by ***${queue[0].requested}***`)
const connection = message.guild.voiceConnection
if (!connection) return console.log('No connection!')
player = connection.playStream(queue[0].toplay)
player.on('error', () => {
queue.shift()
message.channel.send('Sorry lads an error occurred while playing this song')
bot.functions.play(message, queue)
})
player.on('end', () => {
queue.shift()
bot.functions.play(message, queue)
})
}
} catch (err) {
console.log(err)
}
the problem is with the test part
since the test is true it will just play the song when its queued
whats very annoying is this code works in my other bots and not this one
What are the HTML element names that you can edit through CSS in the long description? What’s the name for the upvote button and the invite button etc.?
use Inspect Element
I tried that, I’ll look further, I think I was looking in the wrong place
Can someone with a good antispam give me examples on how it should work, also the numbers whats the limit and etc (Iam not asking for the finished code, just a instruction how a good antispam is build up and Wich numbers for sensitivity)
what page?
add box-shadow: none !important; to .bot-img

i added it directly to the div
the stylesheet has !important on it too
.columns .column .bot-img {box-shadow: none !important;}
this one works
@eager perch
Yep, thanks!
this is my code
public void execute(Context c, String[] args) {
Core.deleteLastMessage(c);
if(args.length == 0) {
c.invalid(this);
return;
}
Giphy giphy = new Giphy(Settings.GIPHY_TOKEN);
StringBuilder s = new StringBuilder();
for (int o = 0; o < args.length; o++) {
s.append(args[o] + " ");
}
String msg = s.toString();
try {
SearchFeed feed;
feed = giphy.search(msg, 1, 0);
String url = feed.getDataList().get(0).getImages().getOriginal().getUrl();
EmbedBuilder embed = new EmbedBuilder();
embed.setImage(url);
embed.setFooter("Command executed by: " + c.user.getName() + "#" + c.user.getDiscriminator(), c.user.getAvatarUrl());
c.channel.sendMessage(embed.build()).queue();
System.out.println(url);
} catch (GiphyException e) {
e.printStackTrace();
c.channel.sendMessage(Emoji.ERROR + " Nothing found by '" + msg + "' (Can be a problem with giphy)").queue();
}
return;
}
and this is the returned url (printed on console)
https://media1.giphy.com/media/aC45M5Q4D07Pq/giphy.gif
but when i execute the code i only get this http://prntscr.com/k5895q
Can someone help me? (JDA)
idk, i tried a lot of things (JDA server people tried to help me) but nothing works
That line of code (the setImage() function) works fine for me, so...
Either your link is bad, or your images are disabled
i have images enabled and my bot has all perms on the server
one sec
@tawdry fox look in #commands , it's working for me
so it's something with your image settings (probably)
embeds disabled?
open console and check if there are huge red blocks saying failed to load
there is no console on the desktop app, browser user 😉
there is on the desktop app xd
🤔
Images disabled? Previews, you mean? That would disable embeds as well
o
how do you generate pictures like the mee6 bot does for its rank card?
lmao, what?
have a look at node-canvas
Thinking of joining both my bots on a single vps running d.js for both. This is possible, right?
I have 5 bots running on my server.
all using java
and my server is bad
take the hint
what
Translation: yes it is 100% possible
why didn't you just say that?
idk
I’m brain dead
I was listening to someone sing despacito for an hour, so that probably didn’t help
k moving to another channel
On discord.js using ytdl-core, this line of code:
let validate = await ytdl.validateURL(args[0]);```
Gives me this error:
```(node:11996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Parameter "url" must be a string, not object
(node:11996) [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.```
How can I fix it, as I think it is what is causing my play command to not work...
Parameter "url" must be a string, not object
so... move it to where then?
you have to join the args together
args.join(" ");
the quotes are a space
which is prob what you want to join them together by
that makes a string
unless well args[0] is an object
then you're kinda
well
console.log the object
i dont think the problem is args[0] itself. the content of args[0] should be the problem
array/object keys/pointers usually always resolve themselves before being sent to the function
so what should I do then? Im still confused...
console log args[0]
in the beginning? or right before?
before
let dispatcher = await connection.play(ytdl(console.log(args[0]), {
filter: 'audioonly'
}));```
.... no...
you are getting that error because args[0] probably contains an unexpected value
so console log args[0] anywhere before the function to see if its content is what you expect it to be
first you need to see what is the problem, then fix after you find out what the problem is
you havent discovered the problem yet
Ok I seemed to find what was giving me that... needed to relook over it.
hi guys, how can I test a bot?
how can I add it to a test server? 😬
create a server
for testing your bot
use the Discord OAuth2 generator to get a link for it
check Bot
and put in your bot's client id
then bam
The use of at least one of our widgets on your website/github page. (Get widgets for your bot by going to your bot's profile and pressing edit), in relation to certification what happens if you dont got a website or github page, just curios
well then
you're fucked
tbf though if you're making a bot worthy of certification
you need one of those
@stiff juniper Thanks!
@safe night no problem
@marsh lark you can make an empty github page with just a readme guide, thats what i did
post a commands list / help menu there and you're good
ah right thanks Tim 👍
Is that normal? 
no
It only happens when I'm not logged in.
I'd recommend filing a report here: https://github.com/DiscordBotList/issues
K. I will do that tomorrow
Hey there 👋
I'm on the latest discord.js v12/master, how would I do these two things: 1, on user join/leave (I already have the event) figure out who invited them, and 2, make a "fake invite" system (i.e, if a user joins and leaves within 15 minutes, add 1 to a variable like fakeInvites.
Thanks in advance!
I've experimented with such a system in discord.py
In my experience you'd constantly needed to check the server invites, then check for changes
How do you do dick length
just randomize between two numbers?
I don't want to do that since if the bot gets big it'll hurt the performance majorly in a way.
also
checking server invites
requires your bot to have the Manage Server permission
sooo
Doesn't matter, I enforce the permission on the invite, and if the bot doesn't have the permission it alerts the user and won't run any further.
The thing is there isn't any invite related events I think
@old swallow You might try the GUILD UPDATE thing
Event
But I"m not too sure that it will include invites
But that's my best bet other than just fetching invites for every server using it
so like in audit logs
this kind of changing
i presume it's talking about
so prob not tbh
I'll try add the event and see if it fires when I make an invite.
In py guild.invites is a coroutine so it's probably fetched from a web api
So I'm doubting that it will send
But best to experiment
The only invite endpoint I found is msg.guild.fetchInvites();
Yeah it's a promise
Yeah
it says
"DiscordAPIError: error"
Probably won't fire then
GUILD UPDATE probably fires when like server name or avatar or region changes
yeah




