#development
1 messages Β· Page 471 of 1
On the developer page of discord
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
But I do need a discordbots.org token no ?
No
In order to connect my bot to discordbots.org ?
Only the code needs the token
not discordbots.org
Running the code with the bot's user token will make it online of that bot account
So here it's the Discord token, not discordbots.org right ?
T h e f u c k ?
How do I connect my bot to discordbots.org
That's my question
I need a discordbots.org token, but where can I find it
I don't think you can get it yet.. you don't have the developer role. So your bot isn't officially on the list?
I was wondering how to get the developer role anyway
@sick iron it's basically on pending so the moderator have to review it in order to get the token ?
I believe so
Ok ty, i'll wait π
How do you call to a function thatβs in a different file using JavaScript?
Cheers
So once I required the file that the function is in, would I do
βββjs
requiredFile.function()
βββ
Sorry Iβm on phone. Backtocks arebt a thing on iPhone lol
Backticks*
main file:
require('./file.js').someFunction();
file.js:
exports.someFunction = function someFunction () {
return 'no';
}
is an example
different ways to do it though
Ah, I see
like:
module.exports = {
someFunction: function() {
return 'no'
}
}
%alia
[debug] left-channel
[debug] joined-channel
[debug] stopped-and-left```
hmmm
no
@earnest phoenix
function.js
module.exports = async () => {
...
};
main.js
const function = require('./function');
I do it like so, if you still need it
I managed to figure it out now lmao. Thanks tho
Oh, I see...
sorry for my english
i using google translator
@earnest phoenix if you told us the programming language someone might be able to help you
Python
<a:{name}:{id}> Like this?
I mean react, not mention it
again... custom emoji... it's not a unicode
it's literally an uploaded image that is resized to fit in text
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == bot.user:
return
if ':EmojiName:' in message.content:
emoji = get(bot.get_all_emojis(), name='EmojiName')
await bot.add_reaction(message, emoji)```
?
I'm on rewrite
oh
sooo
async def on_member_join(member):
with open('users.json', 'r') as f:
users = json.load(f)
await update_data(users, member)
with open('users.json', 'w') as f:
json.dump(users, f)
@bot.event
async def on_message(message):
with open('users.json', 'r') as f:
users = json.load(f)
await update_data(users, message.author)
await add_experience(users, message.author, 5)
await level_up(users, message.author, message.channel)
with open('users.json', 'w') as f:
json.dump(users, f)
async def update_data(users, user):
if not user.id in users:
users[user.id] = {}
users[user.id]['experience'] = 0
users[user.id]['level'] = 1
async def add_experience(users, user, exp):
users[user.id]['experience'] += exp
async def level_up(users, user, channel):
experience = users[user.id]['experience']
lvl_start = users[user.id]['level']
lvl_end = int(experience ** (1/4))
if lvl_start < lvl_end:
embed=discord.Embed(title="LEVEL UP!", description="{} has leveled up to level {}".format(user.mention, lvl_end), color=0x00ff00)
embed.set_thumbnail(url=user.avatar_url)
await bot.send_message(channel, embed=embed)
users[user.id]['level'] = lvl_end```
Why when I add this piece of code, the command does not work for me, and the bot does not respond to my commands
Python
When you have 1 bot.on('message', and you get this error (node:12600) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
Is this where I can ask for help in using the Discord API?
yes
How can I look up the name of the game that a user is playing using Discord API?
I am trying to learn how to make a bot and this little feature is kinda the core of the functionality I am trying to build
what lib
I should mention I don't know jack-***t about how bots work in Discord. I just wanted to learn how to build one, so I went and opened the Discord API documentation to find what I needed
uh
use a library in the language of your choice
dont directly make requests, that'll be a pain to do anything
what language do you use?
Does C++ qualify?
you can't even get presence with (http) requests
you need to connect to the gateway and use events
for js check out this
well you can use either discord.js or eris
d.js is noob friendly
Thanks! But does the Api allow getting the name of the game the user is playing?
yes
Properties
.game
The game that the user is playing
Type: ?Game
.status
The status of the presence:
online - user is online
offline - user is offline or invisible
idle - user is AFK
dnd - user is in Do not Disturb
Type: string```
Thanks, I will look up discord.js and get going
π looks like .game was changed to .activity in master
true
for discord.js .setPresence is preferred but .activity is accepted
is there a way to get the a guild object from a guild id in discordpy? (rewrite branch)
basically i have the id, but not the actual guild object and want to get the guild object π€
specifically this is through an on_raw_reaction_add() event
in a cog
ok well that issue is solved
little css question i guess, i'm using a forEach to push cards with bot info to a page, but there can only be 4 cards per "row". how do i add a new row every 4 items listed?
and this is how its structured:
<div class="row">
<div class="column 25">
<div class="card">
<p>hello</p>
<a class="button button-clear" href="#">View Bot</a>
</div>
</div>
</div>
i can easily forEach them, but splitting the rows and columns is hard
is this regardless of screen size?
both small and big screens should have 4 per row?
can i see your foreach?
I might need some help with the discord.js Discord.Shard() thing. I specify a path to the ShardingManager, as a string, and I get the following as an error:
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.resolve (path.js:1174:7)
at Shard.spawn (/rbd/pnpm-volume/b1008a1b-84fd-432e-b3ef-6bbc83b270b2/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/sharding/Shard.js:72:43)
at new Shard (/rbd/pnpm-volume/b1008a1b-84fd-432e-b3ef-6bbc83b270b2/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/sharding/Shard.js:61:10)
at Object.<anonymous> (/app/server.js:21:15)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
Is there any way to avoid this error or is this an unavoidable bug?
I specified the Shard as followed:
const shard = new Discord.Shard("./shards.js", 0);
I might just be stupid
π
@subtle merlin <client>.get_guild(id)
@ruby dust may I ask what IDE you use for python?
yeah, i didnt have a client object, but its all good now
Sublime text
That's an editor though π€
Hmm
I'm using PyCharm and it just doesn't suggest correct types, so autocomplete gets fucked
People say it's bad cause they never tried it, it's actually not meant to be free but it is as free as WinRAR apparently 
^
and it's not electron
sublime has an open api which can run node, meaning it has plugins that can do basically anything
I mean, sublime does give you correct autocompletes, and in python it does actually try to give you correct indentations all the time
Yeah, sublime may only be a text editor, but it manage to be better than most of those IDEs
Because I'm not familiar with the discord.py lib at all, and I'm someone who has been using Visual Studio for 7 years and so dependent on intellisense to figure out the architecture of a lot of libs
So it's a bit frustrating for me
It's what I'd call being simplistic better that hassling yourself with fancy unnecessary stuff
I really hope sublime doesn't have that problem
idk about py, but for js and php sublime is pretty awesome
It's same with py
not only it autocompletes correctly based on context, it also remembers things like objects, variables and functions you typed once, and adds them to the autocomplete menu
Just so you know, ignore any popups that try to sell you a sublime license 
but the best thing in my opinion is the automation plugins, such as auto upload on save, and auto compile/minify on save
first of all you need to install package control
then you can install a dedicated plugin for python
of which there are many
Well I do everything without any plugins
So you don't need anything if you don't want anything
So if I need to test my file I have to save and run it in an external terminal every time?
any libs support bots receiving guild video yet
Anyone here who knows discord.js' Discord.Shard() property? I need to know how to define the ShardingManager
can i get a html markdown reference sheet
@pale marsh if you dont use plugins, yes
Why does python have to be such a pain
whats the best css framework html
Why am I even bothering to learn python. I already know C#
Pythonk
Ikr?
what do you mean "css framework html"?
@frail harness check up there a bit. I'm having a problem with pycharm
I've sent an image above
Do you know if there's a solution for it?
I'm trying to get the number of messages read, and the number of commands used up onto my website, I got stumpted and now I'm here, both the bot and the website are running on nodejs, is there a not extremely complicated way to do this?
@brittle loom there is no "best", depends on what you need. i personally dont use any
oh ok
nope idk
but if you want to learn more about them, take a look at react, vue, angular, etc
@fervent oyster count the number of commands, and say every x command executed you push that number to a database
And pull it on the website I guess π€·
Ok
Anyone know a good JSON exporter for Prometheus? I found some, but couldn't get any of them to work.
prometheus doesn't use json 
I mean something to interpret JSON data and make it readable for Prometheus.
http://prntscr.com/kn78ts js newGuildSendChannel.send({embed: { title: `Joined the guild: ${guild.name}`, fields: [ { name: 'Owner', value: `${guild.owner.tag}` }, { name: 'Member Count', value: `${guild.memberCount}` }, { name: 'Roles', value: `${guild.roles.array().join('\n')}` } ]
i dont know if template literals are accepted there. besides, you dont actually need them @west raptor
{
name: 'Owner',
value: guild.owner.tag
},
{
name: 'Member Count',
value: guild.memberCount
},
{
name: 'Roles',
value: guild.roles.array().join('\n')
}```
alright
You can also just use richembeds and make your life a whole lot easier
object literals are easier for me lmao
does anyone remember what's the difference between Missing Permissions and Missing Access when reacting to a message?
is it that the bot no longer can see / find that said message?
anyone know this new error?
include more details like
- your code
- what lang
- what lib
lang node.js
lib discord.js
the code of music bot
lot of my friends got this thing, and couldn't be fixed
i mean actually send the code that has the error
code?
what command does it come from
Kinda bot not weally
?
since only users can create bots
which means that a bot creating a bot would be a self-bot right
so thats not allowed
Do you mean webhooks? They can have different names and avatars and look like bots
how would that even work @vernal basin
bot.on('guildRemove', guild => {
is guildRemove right it dont send a the message but ive made sure its been told to be sent
Get Sublime or something to help you not get that error in the future.
The error is self-explanatory. You are indenting with tabs and spaces. Python doesn't like that.
Is .repeat() even a thing, I wonder
if thats notepad++ go View->Show Symbol->Show White Space and Tab
to distinguish them
or you can replace space with tabs
well
thats all my code
for repeat it does reply but it doesnt repeat the song and there is no error to be found
C:\Users\kevlar\Desktop\TicketBoot\node_modules\integer>if not defined npm_confi
g_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-life
cycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else
(node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-
gyp.js" rebuild )
Traceback (most recent call last):
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_m
ain.py", line 16, in <module>
sys.exit(gyp.script_main())
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\__init__.py", line 545, in script_main
return main(sys.argv[1:])
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\__init__.py", line 538, in main
return gyp_main(args)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\__init__.py", line 514, in gyp_main
options.duplicate_basename_check)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\__init__.py", line 98, in Load
generator.CalculateVariables(default_variables, params)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\generator\msvs.py", line 1916, in CalculateVariables
generator_flags.get('msvs_version', 'auto'))
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib
\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)```
Anyone can help me here?
I am getting this error
when i am installing an npm package, e.g Quick.db or Enmap
Okie. Different time, let's try again. Anyone know how to define the ShardingManager in the Discord.Shard() property?
I put a string that points to the file handling the shards and it doesn't seem to see it as a string.
I've never worked with Shards before either, that's also a problem lol
discord.js
That only covers the ShardingManager.
anybody know why this class based command is exporting as a function and wants me to call new on it?
https://github.com/caelinj/Aruna/blob/master/src/commands/help.js
Discord.js- can you say "if (message.aurhor has helper role);"
Yes, that's possible
but thats not how you run it
Nope
if (msg.member.roles.has(HelperRole)) ...```
HelperRole = a role object from the guild
How would you add a const to it
What would it need to say
To define helper role @sick cloud
var helper = message.guild.roles.find("name", "Helper")
if(message.member.roles.has(helperRole)) {
message.channel.send(`${message.author.username} has the Helper role`);
} else {
message.channel.send(`${message.author.username} does not have the Helper role.`);
}
Sorry it took a while
Okie
Yes. When a bot is set to Private, only you can add it :3
Thanks
Oh?
1: use let or const instead of var
2: .find needs a function now ie. r => r.name === "Helper"
The website doesn't show anything deprecated for .roles.find()
Β―_(γ)_/Β―
Luca, how well are you with discord.js sharding?
Aight. Is it okay if I call you Tony?
yeah
i've never touched it
Dangit
never owned a bot that needs sharding ._.
I want to learn it and test it a bit on @wet hull for when one of my bots hit 2.5K servers. And besides, if Nerdcore Radio hits 2.4K servers before @small moth, it's already prepared to shard itself.
i think v12 has internal sharding now which is nice, so you shouldnt really have to do anything
honestly, you don't need to shard until you hit 2.5k, but i'd suggest not worrying until 1.5k or until your performance starts dropping from resource use
yea i heard internal sucks tho
well it sucks eventually no matter what
single threaded nodejs 
eris clustering 
internal and external to get a good balance
To be honest, I'm one of those people who'd rather be prepared instead of wait. I simply want to know how to define the ShardingManager in the Discord.Shard() property, I asked it about 3 or 4 times now and I keep getting ignored lol
(node:6579) DeprecationWarning: Collection#find: pass a function instead
(node:6579) DeprecationWarning: Collection#find: pass a function instead
(node:6579) DeprecationWarning: Collection#find: pass a function instead
(node:6579) DeprecationWarning: Collection#find: pass a function instead
(node:6579) DeprecationWarning: Collection#find: pass a function instead
in console my bot does this spam. (about 50 times - 100 times)
how can i fix this error?
so, my bot is does this spam infinity.
smh cant you just read up
@earnest phoenix 2: .find needs a function now ie. r => r.name === "Helper"
ok
am i going to get help?
when i use the command it doesnt repeat the song
no errors and it does reply
am i messing something?
@earnest phoenix pretty sure internal sharding is only on the internal-sharding branch
ah ok
(node:1644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildCreate listeners added. Use emitter.setMaxListeners() to increase limit
(node:1644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMemberAdd listeners added. Use emitter.setMaxListeners() to increase limit
(node:1644) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 messageDelete listeners added. Use emitter.setMaxListeners() to increase limit```
what's this error?
which d.js version do you use
v11.4.2
in ds sharp how do i get my bot to send message from another bot as it only will send ingame messages from people on discord
https://pastebin.com/Nrvf2ueL
@restive silo no
do you have multiple message listeners, or are you perhaps creating one every message/in a command?
jeez thats alot of events you have too many listeners for actually
This wouldn't work would it
let guild = msg.guild
let embed = new Discord.RichEmbed()
.setColor("GREEN")
.setTitle("Now showing the users online and there statuses.")
.addField("Online", `${msg.guild.members.filter('avalible')}`)
.addField("Do not disturb", `${msg.guild.members.filter('dnd')}`)
.addField("Idle", `${msg.guild.members.filter('idle')}`)
.addField("Offline/Invisible", `${msg.guild.members.filter('unavlible')}`)
.addField("Member count", `${guild.memberCount}`)
msg.channel.send({embed})
},```
it also says
```UnhandledPromiseRejectionWarning: TypeError: fn is not a function``` ?
I want a short Invite Link
i need help
for example
Invite Link:
Discordapp/invite/botblablablabla
i want that Discord App thing
to be shorter
like 'Click Here'
@earnest phoenix No, because you are using .filter() wrong. check docs, it takes a callback function as argument
i got it working now
go into testing 1
@earnest phoenix
ah k
if (message.content.startsWith(client.msgs[message.guild.id].message + 'ping')) {
message.channel.sendMessage('Pong! Your ping is ' + ${Date.now() - message.createdTimestamp} + ' ms');
}
the client.msgs[message.guild.id].message is equals ! why when i !ping is not working
- why is the name of the thing u use to keep ur stuff under
client.msgsthen it is.messagenot.prefix
becousse this - if (message.content.startsWith(prefix + "prefix")) {
var editedmessage = message.content.slice(7);
client.msgs[message.guild.id] = {
message: editedmessage
}
fs.writeFile("./msgs.json", JSON.stringify(client.msgs, null, 4), err => {
if (err) throw err;
message.channel.send('Written.');
});
}
@lament meteor help?
ah.. dont use json dbs pls
so what to use?
there is a lot of choices
Hmm, what are the limits of a json database?
mongodb, rethinkdb, sqlite
@warm mantle there isnt iirc but it isnt smart at all to use a json db
Ah all right.
the limits of a json db is that it doesnt have any built in data buffer protection
meaning any crash or process.end during writing will destroy your json file
also, it its read directly form disk, it costs a lot resources from disk I/O operations
what databases do that make them so much better, is that they introduce safe buffers and only read/write to disk when absolutely necessary, thus making operations fast and secure, with minimal disk I/O operations
I use JSON databases
i use json too, its not bad to use it, you just need to keep in mind its limitations and work around them
I wouldn't see any limitations in using it, especially for small key/value entries
I use mongo
The overhead other storage providers provide isn't worth the performance gains you get in most applications, unless for some reason you're attempting to write Shakespeare's entire work into it
Does about 7 read/writes per second count as writing Shakespeares work to a db
guys y u violent?
Depends on whether or not you have the I/O Capacity vs the Memory cap and CPU cycles
No lol
If I where violent
PLANE TXT FILES WITH COMMA NOTATION
That's violent
in most cases, disk is the main performance bottleneck, unless you're using raid-0 nvme ssds or ramdisks
hence why its often best practice to use memory as much as possible
Sure but do you really need to waste memory resources if you're just changing true to false every half a second
I know this is a bad example because why would you but you get me
i'd rather use memory than disk I/O anytime
i still use json, but what i do is that i read the entire json file into a js object on startup, and only write back to it when needed
so my disk operations are basically only 1 read, and a write every now and then depending on usage
How do I make it so that presence update doesn't spam my console like this
Don't log it.
^
How would I do it
why are you listening to all events lmao
idk
show code
{
Console.WriteLine($"{DateTime.Now} from {Message.Source} : {Message.Message} ''");
}```
idk what language is this, but i dont think the problem is in this code
which library?
.net
Stop writing console.write??
Thereβs only one console.writeline
did you try the code without it
No
But itβs giving me an error
And without the whole line nothing shows up on the console
show the main code
you mean the whole code
this part
{
var client = new DiscordSocketClient();
client.Log += Log;
string token = "abcdefg..."; // Remember to keep this private!
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
// Block this task until the program is closed.
await Task.Delay(-1);
}```
1 second
also
Since we want to listen for new messages, the event to hook in to is MessageReceived.
{
Client = new DiscordSocketClient(new DiscordSocketConfig
{
LogLevel = LogSeverity.Debug
});
Commands = new CommandService(new CommandServiceConfig
{
CaseSensitiveCommands = true,
DefaultRunMode = RunMode.Async,
LogLevel = LogSeverity.Debug
});
Client.MessageReceived += Client_MessageRecieved;
await Commands.AddModulesAsync(Assembly.GetEntryAssembly());
Client.Ready += Client_Ready;
Client.Log += Client_Log;
<token part>
using (var ReadToken = new StreamReader(Stream))
{
Token = ReadToken.ReadToEnd();
}
await Client.LoginAsync(TokenType.Bot, Token);
await Client.StartAsync();
await Task.Delay(-1);
}```
wait
i have no idea what this does, but try removing this
LogLevel = LogSeverity.Debug
8/27/2018 10:17:34 AM from Gateway : Connecting ''
8/27/2018 10:17:35 AM from Gateway : Connected ''
8/27/2018 10:17:36 AM from Gateway : Ready ''``` this is the only 4 things that show up now
alright, then that was your problem
you need to code that yourself
like the one you did above for logging messages
you have to log new servers, etc
Hmm ok
I implement the DiscordBots widgets like this into my docs website:
<a href="https://discordbots.org/bot/349966335352242187">
<img src="https://discordbots.org/api/widget/status/349966335352242187.svg" media="only screen and (max-device-width: 768px)"/>
</a>
I have three of those widgets. In total they take about 1 MB to download. Usually that's not a problem, but I also offer a mobile version and there I hide them. Unfortunately they are still getting loaded.
How can I prevent those widgets from being loaded on a mobile version?
I already tried the media="only screen and (max-device-width: 768px)", but that does pretty much nothing.
@earnest phoenix put the media query on the a tag. media is not an attribute for img, and without it, that link would be invisible anyway.
Thanks, I'll try that :)
If you mind telling us what the issue is.
Sure.
ApophisToday at 8:42 PM
if (message.content.startsWith(client.msgs[message.guild.id].message + 'ping')) {
message.channel.sendMessage('Pong! Your ping is ' +${Date.now() - message.createdTimestamp}+ ' ms');
}
what is wrong with that code?
the client.msgs[message.guild.id].message is equals = ?
Jason DeruloToday at 8:46 PM
whats the error
ApophisToday at 8:47 PM
there is no error @earnest phoenix Derulo(edited)
TehiToday at 8:48 PM
what is this client.msgs[message.guild.id].message
and why is it
and when is it
ApophisToday at 8:49 PM
it equals ! i check it by this code :
let nprefix = client.msgs[message.guild.id].message;
if (message.content.startsWith(prefix + 'checkprefix')) {
message.channel.send(nprefix + " is the current prefix");
}
TehiToday at 8:51 PM
what
ApophisToday at 8:51 PM
it equals !
TehiToday at 8:52 PM
whats the difference between nprefix and prefix
ApophisToday at 8:52 PM
prefix equals ?
but nprefix is dynamic
helpme
yes
Geez that is hard to read
Donβt use json, use a db
i dont want to
Why
bcs i want to learn json
the more you know bro

{"a":"b"} theres ur json bro
now go use a db

but how can use it with custom prefixes
store a prefix as column in table with (guild_id, prefix) 
done
{
"408336105172369410": {
"message": "!"
}
}
message = prefix btw
wow
from a class i took last year -- somebody made a meme of the fucking OSI layers
you dont make a db
(node:9316) UnhandledPromiseRejectionWarning: DiscordAPIError: You can only bulk delete messages that are under 14 days old.```
How can I fix this?
you cant
did not clear after using command. So it is not confirmed that the command is not used.
what
I tried it too. It does not delete posts 14 days ago. Can not I do that now?
discord doesnt let you bulk delete messages that are older than 14 days
the only way to delete messages 14 days or older is to delete one by one
^
But how?
what...?
huh
@craggy roost you should be able to filter the creation date
.bulkDelete(5,true) ?
bulkdelete deletes all messages that are 2 weeks old or younger
given the filterOld parameter is true (the second value
so TextChannel#bulkDelete(5, true); should only delete the messages of the 5 that are 2 weeks old or younger
Ok. Thank you bro.
no probs
sis btw ^^
I made @earnest phoenix in Java and @wooden obsidian in JavaScript btw
Poppi took me around 4 weeks and challengebot was my first bot in js (15h works time approximately)
I'm a fast learner ^^
π
does anyone know how the message constructor works on discord.js
How to fix this error? https://gyazo.com/fa353608426889e983706a69a479a5b5
@tulip snow ur probably making some http request with the wrong token
Oh wait thanks I think I figured it out https://gyazo.com/71786a9db2f46e7bcea376f856541ad8
Okay it was that thanks
@knotty steeple you can look at the source
oh ok
In d.js, Ik there's a limit for massdelete, what's the max?
100/request
Thanks
I need to actually be a bot dev and fix bugs but it's kinda annoying tbh
Like I wish I could be a bad one but no
I had to make a bot and have it be successful
How can I have it notify when someone uploads video?
You have a specific lib or api in mind?
discord.js @viscid falcon
i meant for youtube
ah some specific channel you say?
No
API I have the one from YouTube v3
to notify when someone uploads you can use a webhook and ifttt
how?
wdym as
IFTTT: https://ifttt.com/discover Body: { "username":"IFTTT YouTube Test", "avatar_url":"https://blog.eu.playstation.com/files/avatars/avatar_4364447.jpg", "...
I want people to be able to put !setupdatevideo (channel) (youtuber)
@topaz fjord
for help with the reminder part this bot has a remind command that you might be able to take the frame work from https://github.com/Novuh-Bot/Custodian
and then i bet that tutorial he gave u would work for the video part
take
oh yeah its ok to steal bot code
also thats an actual reminder @viscid falcon
not a yt upload watcher
the youtube api for stream/video notifs uses pubsubhub @earnest phoenix
so you need that iirc
lol, idk what i was thinking
google it
idk where i thought time from
@loud salmon basically they told me they had the bots click links and stuff
i keep getting a bunch of errors when i try to install ffmpeg-binaries, any ideas why?
and not the noraml this requires so in so errors
how would i do that, is there a command line command?
ffmpeg binaries installs fine on linux
idk which part of the error i need to give u guys, theres a lot
does anyone know how to fix the FFMPEG not found error i tried fallowing this guild but no work.
https://www.youtube.com/watch?v=pHR3ttH5t-w
does anyone know?
How to install FFmpeg on Windows 10, download FFmpeg application for Windows at https://ffmpeg.zeranoe.com/builds/ FFmpeg is a command-line tool to decode, e...
did you add ffmpeg into ur path
yup
how do u do that
@viscid falcon are u on linux
and if i do ffmpeg in cmd it works for me but still error
kinda, if you have ever used a raspberry pi im on their fork oh it
but bassicly linux
cpmmands work the same
this might work for u https://www.ostechnix.com/install-ffmpeg-linux/
do you know how to help me jason?
installing rn, no errors so far
ok installed no errors
time to reboot bot and see if it worked
looks like it kinda worked but to diffrent errors
thanks though
i still do not know how to fix mine its weird
whats ur os, if linux, maybe try the link above, worked for me
im windows
oh rip srry
ye
i dont really install dependancies on windows srry
i use linux to host my stuff but i like to test on my windows pc first
still same error if anyone can help that would be nice
@radiant current
did it i needed to reboot
hey for somereason on my music command, when i do connection.playArbitraryInput(the video url, not actually whats here) it doesnt play any audio
any suggestions?
d.js
k thanks
doesnt even mention it
https://discordjs.guide/#/popular-topics/miscellaneous-examples this one might work though
A guide made by the community of discord.js for its users.
i honestly dont see where
const Discord = require("discord.js");
const bot = new Discord.Client()
const DBL = require("dblapi.js");
const dbl = new DBL("X", bot);
module.exports.run = (bot, message, args) => {
let user = message.mentions.members.first()
dbl.getBot(user.id).then(bot => {
const embed = new Discord.RichEmbed()
.setTitle("Discord Bots Stats")
.addField("id", bot.id)
.addField("username", bot.username+"#"+bot.discriminator)
.addField("lib", bot.lib)
.addField("prefix", bot.prefix)
.addField("tags", bot.tags)
.addField("owners", bot.owners)
.addField("upvotes", bot.points)
message.channel.send(embed)
});
}
module.exports.help = {
name: "db"
}
why its not working? the token Censored
module is not declared
What it means?
oh wait
The second programmer of the bot has already fixed the problem
@earnest phoenix btw, please paste code in code blocks (```)
ok
Does eris have some nice selfbot interaction?
I hope this is a troll
I mean interactions like jlin a server an so on
I tried discord.js it just unverifies my ccount
Fuking crappy shit
Y
S e l f b o t s a r e a g a i n s t T O S
Is unverifyig acc by disvord ir
What
Discord
Im thinking of finding a good programmed selfbot to add ppl and join servers
Yeah that's big tos oof
So i can annoy em lol
Yes
k
k will do
Got big plans for the #apeswillescape campaign but before that, do you guys know anyone who might take commissions for discord bots? #Discord #Bots #Commission #apeescape #Campaign #Revival
Not sure if this is an appropriate place to put this
But if anyone is interested, drop a DM please
I'm part of a campaign, we've got a bot idea that we want to bring to life and we're looking for someone to help
Jea!
Bot limited to 1 server but cant change it
Do you have a whitelist, blacklist or what
how do i use discord.Color in embeds in discord.py rewrite?

i mean
eris 
yes
@neat falcon how it not work 
idfk
def setup(bot):
bot.remove_command('help')``` i follow auguwu instructions and it still not work and auguwu is offline 
oof that should work
yes
Oh for fucks sake
tiredboye did a mistake
changed test prefix and was using production 
lmao
Hey, I'm using the discord.py libary.
I'm having problems with this code:
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member):
await bot.send_message(user, ctx)
error?
Oh
Leave it
tf
Oh
no
oops
I get this:
<discord.ext.commands.context.Context object at 0x000001F34F9CC278>
But as message.
It doesn't give me an error.
await user.send(message)
You are sending the ctx object to the user
Anyone else getting this error? HTTPException: Internal Server Error (status code: 500): {"error":"Oops, I think a bad happened, I'm trying again just hang in there"} Traceback (most recent call last): File "/root/BrooklynMusic/modules/dbl.py", line 25, in update_stats await self.dblpy.post_server_count() File "/usr/local/lib/python3.6/dist-packages/dbl/client.py", line 100, in post_server_count await self.http.post_server_count(self.bot_id, self.guild_count(), shard_count, shard_no) File "/usr/local/lib/python3.6/dist-packages/dbl/http.py", line 189, in post_server_count await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload) File "/usr/local/lib/python3.6/dist-packages/dbl/http.py", line 164, in request raise HTTPException(resp, data) dbl.errors.HTTPException: Internal Server Error (status code: 500): {"error":"Oops, I think a bad happened, I'm trying again just hang in there"}
hello
yes what do you need
Hey, My pm thingie code works but it only takes the first word, does anyone know to fix this?
code:
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member, context):
await bot.send_message(user, context)
Python lib.
add a *, before context
Oh hell no.
'k.
Don't do that.
Ok.
@vestal moth if ur saying dont do that what to do then
str: content
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member, str: context):
await bot.send_message(user, context)```
β€
Should work.
NameError: name 'context' is not defined
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002CB2D56AEF0>
@vestal moth
Sorry If I'm dumb, I'm in the early stages.

context: str does this work xd
I'm dumb.
lol
@knotty steeple It doesn't give me an error.
That's what I meant to type lmfao.
But It only sends the first word.
what doesnt give an error
So its the same as the previous code.
do the thing i told you to do
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member, context: str):
await bot.send_message(user, context)```
Yes
He's using master d.py I'm pretty sure.
Not rewrite.
@ruby talon Or are you using rewrite?
idk lol
well i use rewrite so idk
So he has to pass pass_context if he defines ctx.



Yes.
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member, context: str):
await bot.send_message(user, context)```
I made a typo.
Fuck.
You might have to do this.
@bot.command(pass_context=True)
async def pm(ctx, user: discord.Member, *, context: str):
await bot.send_message(user, context)```
Eeek
xD
This is why I went to rewrite.
What does rewrite have to do with rest consuming???
idk
Nothing.
{
module.exports.run = (bot, message) => {
const pinged = new Discord.RichEmbed()
.setTitle("Pong")
.setDescription(":ping_pong:")
.setColor(0x0000ff)
.setAuthor(`Ponged at ${message.author.tag}` `${message.author.displayAvatarURL}`)
message.channel.send(pinged)
}
}```
the bot doesnt respond
why?
discord.js lib
I n d e n t a t i o n i s s u e?
{
module.exports.run = (bot, message) => {
const pinged = new Discord.RichEmbed()
.setTitle("Pong")
.setDescription(":ping_pong:")
.setColor(0x0000ff)
.setAuthor(`Ponged at ${message.author.tag}` `${message.author.displayAvatarURL}`)
message.channel.send(pinged)
}
}```
better?
indentation in js LUL
how should it be indented?
why is ping in parentheses
can you just help
lmao.
export the command as a module
a different file
the require it
remove parenthesis around ping
and when the if statement is true, execute the command.
right now you are just exporting the command
in the command handler which makes 0 sense
pretty obvs why it aint working lul
{
const pinged = new Discord.RichEmbed()
.setTitle("Pong")
.setDescription(":ping_pong:")
.setColor(0x0000ff)
.setAuthor(`Ponged at ${message.author.tag}` `${message.author.displayAvatarURL}`)
message.channel.send(pinged)
}```
or that if you prefer not to make it a module 
i just want the main code to be in one file
i cant get command handlers to work
commands folder with each file
require them all and attach to object or put in map
when command executes, check if the key in object or map exists
if so, run the cmd
they r on
Your message could not be delivered because you don't share a server with the recipient or you disabled direct messages on your shared server, recipient is only accepting direct messages from friends, or you were blocked by the recipient.
@earnest phoenix
enable dms
@bot.command(pass_context=True)
async def changeprefix(ctx,str):
str = str
if ctx.message.author.server_permissions.manage_server:
bot = commands.Bot(command_prefix=str)
embed = discord.Embed(title="Changed prefix.", description=":white_check_mark: I have changed the prefix to: {}".format(str), color=0x77B255)
await bot.say (embed=embed)
else:
embed = discord.Embed(title="Oh no!", description=":no_entry: You don't have permissions to use this command...", color=0xe74c3c)
await bot.say (embed=embed)
Not changing prefix..?
401 - unauthorized

Idk

Not fluent in what ever that lang is
Deivedux if you can show me how to do it properly I'd be grateful.
you are changing the global prefix first of all
You would need a db
^
store it in json
json is shit
db equals database
store a prefix into some data storage, then in on_message check the message content starts with the said config, if so process commands afterwards
sorry, i'm pretty new, trying to figure it all out
Google is a very helpful tool
either way you won't be using the commands extension if you want per-server prefix
Can't you do
bot = commands.Bot(command_prefix=get_prefix)
def get_prefix(bot, message):
if message.guild: # server prefix
return ('?', '!')
else:
return 'p!'
?
commands.Bot defines a global prefix, discord.py library is not made to maintain per-server prefixes mostly because it doesn't have it's own data storage to save that config
Wait fuck it shouldn't be a coroutine.
so you'll be using on_message for pretty much everything
fuck it, they can deal with it being ;; as a prefix
no
yes
maybe
@bot.command(pass_context=True)
async def info(ctx, user: discord.Member):
embed = discord.Embed(title="User Info", description="The user's username is: **{}**\nThe user's status is **{}**".format(user.name).format(user.status), color=0x234D87)
await bot.say (embed=embed)```
"tuple index is out of range"
Why do you use .format twice???
.format(1, 2)
Not knowing how .format works, eh.
im a js kiddie and i know basic py and stuff like that 
Just use python 3.6 and use f strings...
How would I do onJoined or whatever in discord.py?
The event that is being called when the user joins server?
No, when the bot joins the server
i see it's discord.on_server_join but how would I implement it
?
as you would handle any other event
async def on_server_join(server):
print("Joined {}!".format(server))
so @bot.event
async def discord.on_server_join():
embed = discord.Embed(title="hi")
Yeah, don't forget the indenation as well. :^)
yeah of course
i was just typing it
on here
not in vs
:)*
@slender thistle
Help
lmao
Yes hello I'm here. :^)
InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object
Recieved NoneType
Send code kthx. :^)
@earnest phoenix for your info command, you know you can do embed.add_field right?
Yes, I prefer adding new lines.
π
thanks though
whoever codes in .js dm me
if(!message.member.hasPermission("KICK_MEMBERS")) return ("Sorry, Insufficient Permissions")
i dont have permissions, but it didnt say anything
because you didnt make it say anything
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("Sorry, Insufficient Permissions")```
did you ever try message.channel.send?
depends on what message is defined as tho
message
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("Sorry, Insufficient Permissions") is the line now
yes
how did you colour it?
```js
// code
```
^
js if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("Sorry, Insufficient Permissions")
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("Sorry, Insufficient Permissions")
ah
thanks
np
bot.users.get(id).username
whats the right way ?
yes
no, I mean, this doesnt work
and I wanted the right way to get username of a user
with his id
Share the whole code and explain the issue/error you got, if any, in more detail 
when I wrote bot.users.get(id).username, it error me on "cannot read property username of undefined"
That means the user you're trying to access is not cached. Try client.fetchUser(id) instead
assuming you're using discord.js
meh I don't have :readthedocs: emote
can i do a function that if someone votes the bot does an action?
Votes?
yea on the list
I'm not sure I understand how this "voting" works 
ohh
.hasVoted()
yeah, you can
alright thanks

#topgg-api for api stuff btw :v
oops okay thanks
Any ideas why my bots YouTube command is laggy, my max internet speed is 100mb and my server is a raspberry pi 3
If i upgraded my server would that help
Srry for typos, I'm on mobile rn
Or would my internet be too bad
wdym by 'slow'?
Like very choppy to the point i can't even understand it
so the audio is choppy?
Yeah
can you invite to a server so i can see for myself? it might be on your end
dm it
to me
oof
Can I pm later
ye
Like in 3ish hours
sure, thats fine
Thanks
np
No
database
What?
use a database
Like sequalize or whatever it's called
sequalize isnt a database
Oh
Can someone teach me how to make a ticket system in discord.py?
Ticket system?
such as people who have suggestions, support problems, etc, and then it will mention a moderator
Like @restive grotto
and the moderator will then respond
yes.
one second, I have to update discord.
It would just be sending the arguments of the command to a specific channel with the username Then?
Anyone can help me with this
i already said what you need
Sort of, @viscid falcon
But what databse?
How i use a database?
It would report it as an embed to a specific channel.
Not a
So like on a a bot support server or report it on the server the command is from?
I can use a Microsoft Access Database?
It will report it on the same server, just in a different channel in the server.
@brazen shadow use one of what i said
sqlite, mongodb, mysql, rethinkdb (tho i think its very bad)
And honestly, I'm fine with any programming method for it but I'd prefer it to be python as I'm much better and more fluent in python than anything else.
and yet you use format twice

Samurai can you help?
no i dont do much py
Shit, what are you most fluent in?
javascript (node.js)
Same
Alright, I'm fine either way. π
Now to watch a tutorial to make my bot play songs
But search the servers channel collection for a channel with the name you want, then have it send a message to that channel
i dont think you have collections in py
So in java script it would be something like (This is prob wrong btw) message.guild.channels.find("channelname").send("hi") idk about python though
I just learned js cause it's easy
Anyone having any idea why this happens?
https://i.gyazo.com/9d81a2762db4b665c4dc2be0d3d63ac5.png
(Python lib.)
Do you Python
Yes.
lmao








