#development
1 messages · Page 410 of 1
That actually makes sense
I remember fiddling with that while I was programming stuff with Vue
guess I learned something new today 
just switched to d.js I understand how the docs work now, and i agree that it is better than d.io now
Is there any way to convert an adobe air (.air) app to an electron app?
google?
thats sum hawt electron
d.io was deprecated long ago, even its stable is on Discord API v5(which is outdated, the current version is APIv6)
theres also v7
I don't think v7 is ready yet(released)
Whatever, putting any version >= 6 will be using v6
well d.js lets u use v7
what's so great about v7
@topaz fjord Neh, its v6
Putting any version >6 will be automatically downgraded to 6
Cuz theres no more above 6
Yuh, using version 6/7/8/9 doesn't break the bot
But using 5/4/3/2/1 does
¯_(ツ)_/¯
cus there discontinued
yeah but v7/8/9 theoretically doesn't exist, its just v6
they do in my world
¯_(ツ)_/¯
inb4 connects with v10
Yeah it works
Is the page falling?
discordbots.org seems to be down
it is indeed
discord.py rewrite how to stop console getting spammed by webhook updates?
can someone help me to use glitch?
This is my first time really using json for storge so i wanted to know if this is optimized enough ?
public void removeOldStuff() {
JSONObject file = read(dataFile);
for (Iterator<String> it = file.keys(); it.hasNext(); ) {
String key = it.next();
if (file.getJSONObject(key).getLong("sentTime") < (System.currentTimeMillis() - 604_800_000L))
file.remove(key);
try {
Files.write(Paths.get(dataFile.getPath()), file.toString(4).getBytes());
} catch (IOException e) {
e.printStackTrace();
}
}
}
@loud bear set logging level to info or warn
@gilded thunder hello
School.
And I have loads of homework after.
As well as 2 assignments.
Find someone else who can help you in this time frame.
Any good frameworks for Eris? 
your own
mine is just plain eris
@dusty shuttle Also someone who actually knows your bot language.
yeah
You tell us
us?
Honestly the best would you try it first yourself
okay
i have coded my own bot in android.......
How to do math command for Discord.NET (C#)?
maybe you'll find something here
Is there a global rate limite for sending messages ?
with global, I mean not just in one channel or guild
yes
What's the actual rate then ?
i dont know
😦
About 5 messages I thought
Wait with djs then
Djs does auto rate it, to prevent api spam I believe
Not sure about the rest
all libs here https://discordapp.com/developers/docs/topics/community-resources#libraries have ratelimits
It is
the 5/5s ratelimit is per channel
there's a global ratelimit as well, but you are very unlikely to hit that (and if you do you can contact Discord about it)
Well messages are being sent sometimes really slowly while reactions are like usual
So i wondered if ir was that
Or just djs saying fuck off
maybe your internet becomes slow sometimes?
Then why emojis are still sent
Have you tried tracking the speed?
const Discord = require("discord.js")
module.exports.run = async (client, message) => {
const request = require('request');
const snekfetch = require('snekfetch');
const msg = message;
if (!message.channel.nsfw) {
return msg.channel.send("Oh, NO NSFW outside of NSFW channel isn't alowwed");
} else {
const response = await request('https://nekos.life/api/lewd/neko', (e,r,b) => {
var imageURL = JSON.parse(b).neko;
var embed = new Discord.RichEmbed()
.setImage(imageURL)
.setColor("#FFFFFF")
.setTitle('Random Neko')
.setURL(imageURL);
msg.channel.send(embed);
});
}
}
can't figure out why channel isn't defined
wait a minute...
i added module for some reason
did you find the channel
BRO
it says its not defined
channel is channel as in teh message channel
(node:17196) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'nsfw' of undefined
Dm channels do have an id still......
not channel ids
wait
Yea lol
message.guild.channel.nsfw?
why dont you print message in the console ?
no
bad x)
hmm
nah that won't work
its not the message.
the message works i checked via console
but you'll see message's attributs ^^
the issue is channel? isnt defined somehow
so do console.log(message)
and did you get?
what i got the first time i tested it
was there an attribut channel?
that's howyou start debugging
and whined about the image
thats the issue then
logging every object in which you get undefined
you need a Message object not just the content
but why wouldnt channel be defined?
when you are passing client and message to the command, what is message
just message? not message.content?
you don't have a message object so you must be getting the content not the object
somehow
console.log(typeof message)
try {
let commandFile9 = require(`./lib/commands/NSFWCommands/${cmd}.js`); // This will assign that filename to commandFile
commandFile9.run(client, bot, message, args, func, );
} catch(e) {
//console.log(e.message);
} finally {
// conso
}
this is how its run
bot.on('message', message => {
}```
and thats how message is defined
its weird really weird its not message.content
so one would think what worked in every other command would work here
log typeof messae, you'll be fixed
that doesn't really make much sense https://please.zbot.me/zpQgV0lK.png
does msg work?
ah
object
nope
thats why i tried blank message
its insane
and doesnt make sense
at all
const Discord = require("discord.js");
const movieInfo = require('movie-info')
exports.run = async (bot, message, args) => {
let movies = args.join(" ");
if(!movies)return message.channel.send("Oh, no please list a movie")
movieInfo(`${movies}`).then(
function (res) {
// success
var voteEmoji = ":shrug:"
if(res.vote_average < 5){
var voteEmoji = ":thumbsdown:"
}else if(res.vote_average > 5){
var voteEmoji = ":thumbsup: "
}
let movieE = new Discord.RichEmbed()
.addField("***Title***", res.title, true)
.addField("***Original Title***", res.original_title,true)
.addField("***Votes***", res.vote_count, true)
.addField("***Id***", res.id,true)
.addField("***Popularity***", res.popularity, true)
.addField("***Video***", `${res.video}.` ,true)
.addField("***Vote Average***", voteEmoji + res.vote_average,true)
.addField("***Originail Language***", res.original_language, true)
.addField("***Genre Id's***", res.genre_ids,true)
.addField("***Adult***", res.adult, true)
.addField("***Overview***", res.overview, true)
.addField("***Release Date***", res.release_date, true)
.setThumbnail(res.imageBase + res.poster_path)
.setColor("#FFFFFF")
message.channel.send(movieE)
//=> { ... }
},
function (err) {
// failed
})
}```
like here
message.channel.send works
const Discord = require("discord.js")
exports.run = async (client, message, args) => {
const msg = message;
const dateFormat = require('dateformat');
dateFormat('dddd, mmmm dS, yyyy, h:MM:ss TT');
var ch;
if (msg.mentions.channels.first() !== undefined) {
ch = msg.mentions.channels.first();
} else {
ch = msg.channel;
}
const millisCreated = new Date().getTime() - ch.createdAt.getTime();
const daysCreated = millisCreated / 1000 / 60 / 60 / 24;
const embed = new Discord.RichEmbed()
.setTitle(ch.name)
.setDescription(ch.topic)
.setColor(`#FFFFFF`)
.addField("Channel ID", ch.id)
.addField("Created At", `${dateFormat(ch.createdAt)} That\'s ${daysCreated.toFixed(0)} days ago!`)
.addField("Users", ch.members.size);
msg.channel.send(embed);
};```
here to it works
do you have each command in a different try block or is that just the variable name https://please.zbot.me/p4iBpdxU.png
oh
i see the issue
?
commandFile9.run(client, bot, message, args, func, );
you provide client, bot, (etc) to this command
async (client, message) but it only takes two variables
you are defining message as bot
since you pass bot on that second variable
lmao
:d
👍
thx alot i really couldnt figure it out XD
tbh, what is the advantage of using d.js? eris is more powerful I think
sharding is way better on eris
d.js is more aimed towards beginners imo
hm
I never coded in js, and I started learning with eris, without any tutorial :x
Im gonna be honest the reason there is client and bot is im to lazy to switch it and im using code from my old bot with depreciation im reworking
@austere meadow do u plan to recode zbot in eris?
zbot is a massive project so switching to eris would (ideally) be a last resort thing https://please.zbot.me/u3gF3H2v.gif
Oof
@austere meadow agrreable
1 file bots are the best thats why
what does zbot do?
#1 porn bot 100% truth
Why won't this display the image, or the embed at all for that matter. Discord.py async
import requests
# dog command
@bot.command(pass_context=True)
async def dog(ctx):
url = 'https://random.dog/woof.json'
response = requests.get(url, verify=True)
embed=discord.Embed(title="Bork.", color=0x176cd5)
embed.set_image(url=data['url'])
await bot.say(embed=embed)```
Please don't bring up the fact I'm using async, I just want help.
I'll convert eventually.
error whenever i try to install canvas
i have node gyp installed
i have windows tools installed
it just wont install
i have gtk 2 install for canvas to.
¯_(ツ)_/¯
fixed
Xd
const Discord = require("discord.js")
const { createCanvas, loadImage } = require('canvas-prebuilt');
const snekfetch = require('snekfetch');
const path = require('path');
let canvas = require("canvas-prebuilt")
module.exports.run = async(client, message) => {
msg = message;
const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 });
const base = await loadImage(path.join(__dirname, '..', '..', '..', 'images', 'rip.png'));
const { body } = await snekfetch.get(avatarURL);
const avatar = await loadImage(body);
const canvas = createCanvas(base.width, base.height);
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, base.width, base.height);
ctx.rotate(3 * (Math.PI / 180));
ctx.drawImage(avatar, 69, 102, 256, 256);
ctx.rotate(-3 * (Math.PI / 180));
ctx.drawImage(base, 0, 0);
return message.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] });
}
now whats the issue with this their is none.
SO WTF
XD
the []??
¯_(ツ)_/¯
The module '\?\C:\Users\fireb\Desktop\Bot&Dev\BAYMAX\node_modules\canvas-prebuilt\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
my error
hmm
can you check if someone voted for your bot ?
yes
:o
...
reinstall ur stuff @earnest phoenix
@inland pulsar its more to an #topgg-api question
Oh didn't see that channel thx
Guys Guys guys guys
how to make my bot response when anyone mention him
i used
if (message.content.startsWith(bot name and the id and even <@id>))
if message.Mentions.Any(mention => mention.Equals(myUser.GetMention()) ..
you should write an "extension" for it
No idea which lib you use, but some have a member "Mentions" or a Method GetMentions etc.
i use js
prefixes = ["urprefix", "<@" + bot.user.id + ">", "<@!" + bot.user.id + ">"]
for(prefix in prefixex) {
if(message.startsWith(prefix)) {
handleCommand(message.substring(prefix.length))
break
}
}
just add a space between the prefix and a command
is adding an on server join message a bad thing
@uncut slate
can I get your opinion?
I mean when the bot joins a server, send a single message saying thank you
How do I get my bot approved?
@uncut slate
I should stop pinging
sorry
just really need someone to discuss this with
Is it bad if I add an on_join message
Some people hate it, but it'll help your dumb users get started
I guess how complicated your bot might be is also relevant
I wouldn't call it a bad thing myself
Thanks. People in d.py is making me half guess adding a message.
I'm still not sure.
For which version @toxic oracle?
iirc like 11.3 and further
i just remember them saying something about deprecating it
whether they didnt idk
i dont use d.js anymore anyways
yo, is it possible to code a bot with .bat?
i think thats not
wtf
noice
@tulip kraken I highly recommend you to refactor your code
wdym?
Well, you will have trouble reading, maintaining or debugging that.
also why require admin
needed to setup the roles and overwrite channel permissions upon joining
use manager roles/manage channels instead
meh
meh what? 👀
i mean
"use manager roles/manage channels instead"
Thats funny tho
i just refactored it
nothing changed
@sage hare
(node:1410) UnhandledPromiseRejectionWarning: Error: read ECONNRESET
at TLSWrap.onread (net.js:602:25)
(node:1410) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1410) [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.```
This sis first time
Can you show me the code that triggers that error
I mean your bot's code.
async(args) => {
}
you probs forgot the arrow function or something
Just add a catch to the promise
or that
How can I get my bot to only reply to messages sent in a channel called bots?
if(!(`name`, "bots")) return;
``` I tried message.channel and message.channel.sent but idk
if (!['bots'].includes(message.channel.name)) return;
why not just message.channel.name !== "bots"
or let thingy = message.guilds.channels.find('name', 'bots');
damn
you guys are smart
xD
let p1 = ("Backstabbers", "Traitor", "European", "Innocent");
let p2 = ("Backyard", "club", "Gmod");
let p3 = ("servers");
let responce1 = p1[Math.floor(Math.random() * p1.length)];
let responce2 = p2[Math.floor(Math.random() * p2.length)];
``` Why does it only chose 2 random letters then from p1 and p2 ?
because maybe its not working
It works though
Juptian bot is in 5 servers!
e G servers
Juptian bot is in 5 servers!
c o servers
Juptian bot is in 5 servers!
omservers
coservers
oh
Yes what poof said
(node:804) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at item.request.gen.end (C:\Users\home\Desktop\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
at then (C:\Users\home\Desktop\node_modules\snekfetch\src\index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:182:7)
(node:804) 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: 2)
(node:804) [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 this?
what code is causing the error
Idk
tbh looks like snekfetch is the problem
doubt it
you're probably trying to edit / delete a message that doesn't exist anymore
hmm
ok so im trying to get the channels of a discord server but it doesnt seem to be working
any ideas?
<?php
$info_request = "https://discordapp.com/api/guilds/$server->id/channels";
$info = curl_init();
curl_setopt_array($info, array(
CURLOPT_URL => $info_request,
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer $access_token"
),
CURLOPT_RETURNTRANSFER => true
));
$channel = json_decode(curl_exec($info));
curl_close($info);
?>```
```php
<?php foreach ($channel as $ch){ ?>?
<option value="<?php echo $ch->id; ?>"><?php echo $ch->name; ?></option>
<?php } ?>```
o rip
ye
oh phew
xD
php discord bot 
doesnt seem like it
no its not a php discord bot lmao
Failed to load extension info
ClientException: extension does not have a setup function
def setup(bot):
bot.add_cog(Info(bot))```
am i missing something or did discord brake discord.py rewrite?
add a setup function lol
i do have it....
send code
is that mario
ya
for extension in startup_extensions:
try:
bot.load_extension(extension)
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
print('Failed to load extension {}\n{}'.format(extension, exc))```
that?
https://github.com/dondish/Soko/blob/master/events.py look at this for example
what are startup_extensions lol
my other files whitch half of notx loading because this issue
startup_extensions = ["owner", "general", "info", "sfw_actions", "nsfw_actions", "sfw_self_actions", "nsfw_self_actions", "test"]
im using the came coding on my main bot @lone nymph but it seems to be having issues with my testing bot
Can someone help me with a purge command? To delete messages from chats?
yes Tomas one sec
def setup(bot):
bot.add_cog(Testcommands(bot))```
is at the bottom off all thoes files
@loud bear it's really weird because it looks good
of course the testcommands replaced with class name
check out the example bot I sent you
Ok thanks
@vital bluff what lib?
Shall I DM you the discord?
could it be because im using python 3.6 and not 3.5
I mean github
The github?
@loud bear shouldn't make a difference
update the lib though
@vital bluff ask here
ill see if that works
what lib are you using Tomas
It's discord.js
how would i update the lib again?
But it's set out weirdly
im gonna see if its out of date
i honestly think windows f**ked me over
yeah I saw
Gl
Hey I need help with .js
scripts
I have a thing so it has. "let mod_role = message.server.roles.find('name', settings.modrolename);"
and what’s up?
It has an error
at the r
for roles
I reinstalled discord.js
If it was that but no..
😦
.guilds
it’s guild
message.guild
not server
message.server was never a thing
shouldnt have
https://media.turtle-bot.com/f/8DbOo.png message doesnt have the property server
so idk wut ur talking about
can anybody hmu with some jokes, I need some for my joke command
diff = datetime.datetime.now() - context.message.created_at
await m.edit(str(diff))
https://did-you-know-that-the-last.letters-of-the-alphabet-are.xyz/33M1DIdD.png
i feel stupid
hhm i got my test file working again had to rewrite it but what ever
lol
and as of my other files incorrect tabbing XD
but i just tried to use embeds for the first time and got this <discord.embeds.Embed object at 0x0000021242BD4E58>
discord.py rewrite
@spring ember i found out why the file was not working XD
@commands.command```
is what i had
```py
@commands.command()``` is what i have now i think that was the issue
I'm having issues sending a DM to me using a bot. (d.js) Does anyone know how?
user.send()

what does client.users.get do?
gets a user 
gets a user
¯_(ツ)_/¯
then whatever you want with them
bot.users.get('blah').avatarURL
ok
Any idea about why discord would randomly close socket connexion with bots and make them crash ?

(3 / 4 bots had the same error at exactly the same time, not same connexion)
dunno
odd 
if I were to get a message object, how far in the channel's history can it go before it gives up to find that message?
nvm, found the issue for why the dm wasn't working. The database I was using was not formatted correctly :p
@halcyon abyss if your lib is worth anything then it should detect that and try to reconnect again

And the error seems to be at a really low level
throw err;
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:116:17)
at WebSocketConnection.onError (/path/to/bot/node_modules/dis cord.js/src/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/path/to/bot/node_modules/ws/lib/event-target.js:128:16)
at WebSocket.emit (events.js:127:13)
at WebSocket.finalize (/path/to/bot/node_modules/ws/lib/websocket.js:185:12)
at ClientRequest._req.on (/path/to/bot/node_modules/ws/lib/websocket.js:641:12)
at ClientRequest.emit (events.js:127:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:539:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
at TLSSocket.socketOnData (_http_client.js:444:20)```
19:28:35 Gateway System.Exception: WebSocket connection was closed ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Discord.Net.WebSockets.DefaultWebSocketClient.<RunAsync>d__33.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
19:28:35 Gateway Disconnecting
19:28:35 Gateway Disconnected
19:28:36 Gateway Connecting
19:28:37 Gateway Resumed previous session
19:28:37 Gateway Connected
my websocket error
d.net will try to reconnect automatically
not sure about djs
Seems like I have to catch it manually
lemme guess, the js error crashed the application?
happened to me when i was a js dev too
yeah
fatal error, exited before I could even do anything
and I doubt I can even catch it with promises handling
well, error were generated by npm modules so I doubt changing engine will solve anything
What version of node and d.js are you using?
1.0.0
i got embeds working now lol
cool
well, i found this event in the docs and added the listener just in case, but if you say it catches it, i'll guess it's problem solved
...
Either woods[wUser.id].woods += 2 or woods[wUser.id].woods = woods[wUser.id].woods + 2
help! I was developing my bot on another computer, but I can't turn it off! (to update the code) If I run my new code, it makes the bot run twice. How do I manually shut off the bot?
rip, i can't access it till tomorrow
well... for some reason the issue fixed itself :p
Eval is nice
Actually the best way to make a bot shutdown is resetting the token
You'll instantly get logged out
... I just said that
¯_(ツ)_/¯
await channel.send('{} **{}** - {}HP\n{} **{}** - {}HP'.format(p1, p1title, p1h, p2, p2title, p2h), file=discord.File("storage/error.png"))
Literally just sending a file.
I don't have nothing closed.
if I use new Discord.RichEmbed, how do I send the embed? I'm getting this error: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message
Js?
Im using this (d.js): msg.channel.send({embed:emb});

What a thing, right?
the embed is empty
const embed = {
description: "test",
title: "my embed"
}
msg.channel.send({embed: embed})```
¯_(ツ)_/¯
If you're using embed builder you can send it directly
const embed = new Discord.RichEmbed()
.setTitle("haha yes");
msg.channel.send({embed: embed});
haha yes
can anyone help me out here? for js how would i make a bot react to its own message mutliple times? This is like going to be used for pages in a big help menu
You could use a for statement.
its weird cuz this is what "emb" was:
RichEmbed {
title: 'Channel Reminders\n\nCurrent Time',
description: '1525914988820',
url: undefined,
color: undefined,
author: undefined,
timestamp: undefined,
fields:
[ { name: '[1] Reminder:', value: 'testing', inline: false },
{ name: '[1] Reminder Time...',
value: 'undefined',
inline: false } ],
thumbnail: undefined,
image: undefined,
footer: undefined,
file: undefined }
how would i do that?
basic js tbh
i forgot to mentoion that im bad
or this for diff types of loops https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration
thank you
np
wait a minute, i should have been more specific, the bot will react to its own message twice, each time with a different reaction.
still possible with for loop
ok
msg.react(emojiA);
msg.react(emojiB);
or
const emojis = ["emojiA", "emojiB"];
for (let i = 0; i < emojis.length; i++;) [
msg.react(emojis[i])
}
i assume the emojiA and B are ids (just the numbers)
nope
the unicode symbol
unicode
thanks yall
actually if u want custom emotes its only the id
[<Role id=406278479483633665 name='@everyone'>, <Role id=423723362469019649 name='Cookie'>]``` how would i fix it so it only list the role names? discord.py rewrite
embed.add_field(name="All roles:", value="{}".format(user.roles), inline=False)
``` is the line of code that its on
i was gonna say use list but that doesn't work, thats correct ^
where would i put it in the line?
does anyone have an issue where spliceing arrays with objects in them turns it into an object?
Why would you got from object to array back to object?
ok so itll look like py embed.add_field(name="ALL Roles:", value=''.join([x.name for x in user.roles]", inline=False)
mmmm no
more like
embed.add_field(name="ALL Roles:", value=''.join([x.name for x in user.roles]), inline=False)
you had some typos
ok thanks
np -w-
i just learned how to do embeds today so ya....
now there is no responce for that command
send the traceback
oki
ok appently it did not refresh the file
@everyoneCookieRaspberry hmm 3 roles squached together
squashed
thanks that worked
np ^w^
you seem to know discord.py better than me XD
meh i'm still trash at it.. its just learning from your mistakes
lol
all my coding experinces i have learned was whenever im coding my bot
so im still relativly new to coding
some times i still fuck up
same
every programmer fucks up
ya programing is trial and error
*internal screaming*
Programming requires very good problem solving skills
testing server im guessing?
thats my bots support server i have a webhook handling events
but i fucked up the on_guild_join embed
how would i add the little pictures to the embeds for user pfp or server pic?
By linking to the CDN url
@commands.command()
async def userinfo(self, ctx, user: discord.Member =None):
"""Get info on a user."""
if user==None:
await ctx.send("Please tag a user you want info on")
else:
embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb)
embed.add_field(name="Username:", value="{}".format(user.name), inline=False)
embed.add_field(name="Nickname:", value="{}".format(user.nick), inline=False)
embed.add_field(name="ID:", value="{}".format(user.id), inline=False)
embed.add_field(name="Status:", value="{}".format(user.status), inline=False)
embed.add_field(name="Playing:", value="{}".format(user.activity), inline=False)
embed.add_field(name="Joined at:", value="{}".format(user.joined_at), inline=False)
embed.add_field(name="Top Role:", value="{}".format(user.top_role), inline=False)
embed.add_field(name="All Roles:", value=', '.join([x.name for x in user.roles]), inline=False)
await ctx.send(embed=embed)``` how would i do that here is the code of my userinfo command
to get a users icon use user.avatar_url
how would i put that in the code? can u send a example line
or is it more than one line
ez
oh tru
Just look at the docs
i am not really helping
Precisely why google and documentation exists
lol
@elder rapids people makes discord bots before event knowing what py, js, java, etc is they dont understand docs and think that they could learn the lang while coding a discord bot which is wrong it is easier to learn the language first then coding a discord bot. thats why they google stuff(as most people copies code)
embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb, url="{}".format(user.avatar_url)) is that what itll look like?
class datadog extends Manager {
getName() {
return 'datadog';
}
init(bot) {
function pushDataDogStats() {
client.gauge('botmem', (process.memoryUsage().rss / 1024 / 1024).toFixed(2));
client.gauge('botguilds', Math.floor(this.bot.guilds.size));
client.gauge('botuser', this.bot.users.size);
client.gauge('botUptime', this.bot.uptime);
client.gauge('botlisteners', this.bot.getMaxListeners());
client.gauge('botPing', Math.floor(this.bot.ping))
client.gauge('botChannel', this.bot.channels.size)
client.gauge('botHeap', (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2))
};
push = setInterval(this.pushDataDogStats(), 2000);
}
};``` does this work?
ik telk, a discord bot is not really something anyone should be doing as a first project if they have never programmed
Hello, if esque send the request for my bot's certification, how long is the response time?
wrong channel
Raspberry, you can just use url=user.avatar_url to shorten
?
ok
oh py
.py is the easiest lang to understand *imo
not really, it depends sometimes.
easy once you know what you doing
the easiest lang is smallbasic
imo, idk anything easier than print("hewwo")
embed.add_field(name="Amount of users I can see:", value="{}".format((len(list(self.bot.get_all_members())))), inline=False)``` will this work?
that could be simplified
oh how so
so py embed.add_field(name="Amount of users I can see:", value="{}".format(len(set(self.bot.get_all_members()))), inline=False)
aw sh-shucks it was nothing..
do everyone mentions ping in an embed?
it does not ping anyone
Pings don't happen when they are in embeds
Required to be in message.Content
The ping part isn't problem
Problem is you have a useless everyone role listed there
We all know everyone is part of the everyone role
so how do i fix it so the users pfp shows up in the corner since url=user.avatar_url does not seem to be working
did you try and put it in the author bar?
and how do i exclude the @everyone tag
embed=discord.Embed(Title="User Info:", description="Here is the info of {}".format(user.name), color=0xa40bdb, url=user.avatar_url)
ok so image.url=avatar_url
check the docs i don't think its image.url
@languid dragon
Hello, if esque send the request for my bot's certification, how long is the response time?
a long time
was I pinged here?
You tell us
I can't see it but it had the red pingu style here
my friend was trying to invite my bot to his server but he gets this error saying "sorry we tried very hard but somthing went wrong:( Forbidden 403"
is the application public?
yes
on discord app site?
@fair elk did your friend just put his bot on the website recently
it probably hasn't been approved
^
"sorry we tried very hard but something went wrong" is a DBL error, not a discord error
can you give me the link to it
for my bot
also lets move to #memes-and-media
if i use if (message.content.toLowerCase().includes("no")) It accepts nothing and Eno also but i want it to only accept if "no" is present in the string .. how do I go about this?
no
why not split the it per space and check each word
ie. "hi Telk".split(" ") gives ["hi", "telk"]
hey. could i get a hand from some more knowledgable devs?
what language
JS
and what for 👀
it's not API abuse
or at least i really hope it isnt
basically my bot does a grand total of 1 thing right now which is send reminders to any channel that has used the here command
well actually i should specify that it is one channel per server and every time you use it it updates the channel that the reminders are being sent
i want to add an extra layer to that reminder being sent by allowing admins to set up notifs which the bot does all the work but it makes a role that it would ping with the reminders.
how ever right now im having a huge issue with that because i am trying to make it so it wont ping servers that dont have the role and pings the servers with the role.
i have also made it so that users are able to receive and remove the role if they do or dont want to be pinged
i have the reminder function working tho. so i am proud of that
I don’t rlly understand wat ur saying but I presume the problem is that it errors when there isn’t a role
Ah...
yeah
It means it’s an invalid role
yes i understand that part
Iirc there is like message.guild.roles.find(“name”, “Ping meh”)
Idk I’m on mobile
So make a var with that
bot.guilds.get(serverID).channels.get(channelIDs[i]).send(msg)
And if (!var) return
d.js or eris?
d.js
indeed thereis no such thing in eris
fs.readFile('reminder.json', 'utf8', function readFileCallback(err, data) {
if (err) {
} else {
var dict = JSON.parse(data);
for(var serverID in dict){
var channelIDs = dict[serverID];
for(var i in channelIDs){
bot.guilds.get(serverID).channels.get(channelIDs[i]).send(msg);
}
}
}
});
}```
that is currently how i am doing the read through my list of servers and send
wow as expected it does send to all servers
wait you are sending a message in every guild?
yeah
So if there is 10, it sends to 10. And if there is 100, it sends to 100. And if there is 1000, it sends to 1000
right?
¯_(ツ)_/¯
the way worded that sorta felt like you were accusing me that i was sending to every server my bot is on
well since you are doing that at once
if there are 1000 reminder set up
going to spam the API
hmmmm
but anyway I don't get what is your actual issue?
Same
ok so i want to add an extra layer to the reminder being sent
which is the option to get pinged when one of the reminders goes
hm
i just dont want to share them
it's per server
only one channel per server
lmao
{
"serverID": {
"ch": "channelID",
"ping": true,
"roleToPing": "roleID"
}
}
forexample
yeah so?
anyway.
Just resend it
yeah what is it for?
Girls Frontline
open beta dropped yesterday so i busted my ass to get this stupid reminder to work
anyway. the reminder works great
no offense but I don't advice spamming all your server like that tho.
I mean whenever you get some server, i'll spam the API
sends on time and functions nicely. how ever the 2 servers that do have my bot have asked if i could make it so the bot makes a role and pings the role when the dailies reset
alright.
just add the role id to your json DB and add the ping in the msg.content part of you msg object
not the msg.embed cuz it doesn't ping in embed
yeah. worked that one out

as to your above non offense question/statement im sure there is a work around and i'll jump that when i reach that point
how do you people know if a bot belongs to the owner?
are you talking about the approval process?
there's most likely telltale signs that a bot is an instance of red
Which isn't necessarily bad, but Red is under GPL i think so you can get rejected if you aren't open source and also under GPL
i ment like if i try submitting dyno bot (imagine no one knows about it and the original bot owner is not on here) how would dbl know its not my bot
depends on how good a job you do of hiding it
Wait do we have to be open source?
Only if your bot is a fork of another (like Red) and the original bot's license dictates you make your project open source as well
Oh cool. Glad I built mine from the ground up then
GPL does not dictate you make your project open source for a non-conveyed work (i.e. a bot)
how do i auth my endpoint requests?
request.post('https://discordbots.org/bots/422088562586943489/check')
.send({ 'userId': message.author.id })
.then(r => message.channel.send(`Hi ` + r.body))
.catch(err => message.channel.send(`Oh ` + err))```
this is what ive got rn
@uncut slate ?
Take a look at the channel description
sorry. i just saw you respond to someone recently
your req has to be a get
not a post
and userId is a query string param
r.body will be an object btw
request.get('https://discordbots.org/bots/422088562586943489/check')
.query({ 'userId': message.author.id })
.then(r => message.channel.send(`Hi ` + r.body.voted))
.catch(err => message.channel.send(`Oh ` + err))```
userId has to be a querystring
that's what 403 means, yes
request.get('https://discordbots.org/bots/422088562586943489/check')
.set({ 'authorization': '(key i set in my bot page?)' })
.query({ 'userId': message.author.id })
.then(r => message.channel.send(`Hi ` + r.body.voted))
.catch(err => message.channel.send(`Oh ` + err))```
authorization is the dbl token
request.get('https://discordbots.org/api/bots/422088562586943489/check')
.set({ 'Authorization': '(DBL Bot Token)' })
.then(r => message.channel.send(`Hi `))
.catch(e => message.channel.send(`Oh ${e}`))```
still returning 403? idk what is wrong. yes the token is correct
like i have no idea
it is
yeah its an endpoint
did you try to go to this endpoint with your browser?
^
it works in my browser
postman 
with UserId and Authorisation keys set?
no auth key set
https://discordbots.org/api/bots/422088562586943489/check?userId=359794248570109972
maybe try with the Auth too
it loads in my browser tho
without auth key
so unless my server is blocking discordbots.org
okay yeah my servers not blocking it
how do you get the auth key btw?
the token that dbl gives each bot
where it is? :x
its not for vote locking
i try in a non logged in browser and get Unauthorized but when using Snekfetch i get Error: 403 This host is not accessible.
@low wasp how did u manage to get the recent logs to show up in ur eval
magic
would logs be the console logs
yeah
sharing is caring
npm >>> consoled
RunKit notebooks are interactive javascript playgrounds connected to a complete node environment right in your browser. Every npm module pre-installed.
every npm module
that is a horrible idea
oh nvm it doesn't actually import them all in the same instance
yo Timmy
lmao what about it
no the issue is im getting 403
I see all these bots saying you must upvote the bot to use this feature
how do i do that?
link me api or some docs idk
hi,
Does anyone know any way for the bot to get information about how many users are on a server and the server logo of the invitation?
[ discor.js ]
read the docs
server logo of the invitation is the server icon
@spring ember yup
I know I am right lol
@raw wharf https://pokecord.net/webhooks if you want a quick way to link upvotes to your discord webhook. Tonkku and blake already said its ok if i share this system. Just trying to help people out, no ads, just free help for the time being.
https://hastebin.com/rirayadoqa.tex - error
http://prntscr.com/jgajrh - Where the FFMPEG folder is
very development related 👌
@earnest phoenix we said that to a deleted message
see case 4858
also ffmpeg folder should be lowercase
and don't use ffmpeg for a music bot
use lavalink
uhh
guys
how would i provide some sort of authentication key with superagent in node js
Wdym auth to what?
i want to add twitch announcements in my bot
but
i dont know how to use the authentication
read about oauth2
And twitch probably has an api, try to find the website which probably has documentation
Anyone code discord.js? Can you help me be able to make my bot find a channel and then message in that channel?
client.channels.get("channelID").send("noot noot");
read the docs
i mean
if you cant even find a channel
probably learn
do some tutorials
practice js
Hey sorry this isn’t much discord related but it’s todo with a bot software called DiscodPandl. And I want know the best website software to sell software keys? Been looking at WHMCS but want to know if any of you know any good ones?
why did you post that in #memes-and-media also
idk
http://prntscr.com/jgck4t what did I screw up? (discord.js)
its telling me r1 isn't a function
what in the heck are all those arrays for
hex generator
Ofc r1 isn't a function...
Why do you have a million of them
Ik
Are they all the same...?
If they're all the same arrays why tf is there so many
Rather than just using the single one
Because its easier for me
ikr
Ok
Do not repeat your stuff in programming, it's a bad habit
Try and make "repeated" code singular as much as possible
well, what did I screw up more acuratly
?
am I meant to use [] instead of ()
Do you know the difference between those
i dont think he does @elder rapids
I know one is for arrays
nope
ok
yes
👏
xD
yay
can any please help me i am new to coding
Help with what
my bot
i keep getting errors in my code and i cant turn\ it on
can u help me @tepid laurel




