#development
1 messages ยท Page 728 of 1
lel
Check if someone voted -> Give Coins
Anyone know how to count how many members that has no roles? Or any bot that provides this feature?
Since prune members feature from discord returns 502 error and can't be used in our server.
what library
I mean, you can loop through each member and check the length of the roles list
^
for member in guild: if member.roles in (0,1): he has no roles
idk if it'd be 0 or 1 lol
nice
@weak parrot ur online cmere
@modern sable sorry for ping but he's done it to every channel
Even more of a sorry it might just be my discord not reloading which is why he's still in for me
Sorry for the ping
ty
my ping didn't get mod attention :pepehands:
I have have no idea what you're even talking about
ads
Pop quiz. You have a JavaScript function where you can put any code you like apart from some restrictions and you want to cause hassle for the system. Your restrictions are your code can't run more than 10ms, it can't use more than 256k and it can't access I/O except to send discord messages and manipulate some objects set before your code runs. Each time the execution ends the complete state is reset. Based on these restrictions, what abuse could be done? I'm trying to cover all bases I can in my bots sandbox.
does it have access to the discord client?
can it be used to mass dm people?
or to kick/ban/edit guilds and members?
It can only do what I give it an interface to do, @quartz kindle
I was thinking that DM would not be a feature of that interface
The bot doesn't have access to kick, ban, etc as it's not a moderation bot, unless someone altered it's invite to give it more permission than intended
It's generally a chat bot
My main concern is flooding, but you can only message channels within the guild your event was triggered in
So if you flood anything you flood your own server and the underlying client has rate limiting
The main interface I was going to give was: find channel on guild by id, find user on guild by id, message channel by id with embed or plain text
That should be enough to do some nice stuff with for starters for beginners yes?
~~okay so
i'm trying to get all distinct weeks ("2019-18", "2019-19", etc.) and and the sum of all bids during that week that are marked with outbid = 0 and a certain product name
My first attempt was sql SELECT DISTINCT week, (SELECT SUM(amount) AS amount FROM bids b2, products WHERE b1.name = b2.name AND b1.week = b2.week AND outbid = 0 AND b2.name = products.productname AND products.id = '1') AS amount FROM bids b1 ORDER BY b1.week ASC;
but this duplicates all weeks like this https://luca.is-inside.me/Ko9W4WbZ.png
My second attempt after using a left join was
SELECT DISTINCT week, b2.amount
FROM bids
LEFT JOIN (SELECT SUM(amount) AS amount
FROM bids, products
WHERE outbid = 0
AND bids.name = products.productname
AND products.id = '1') b2 ON bids.week = week
WHERE
outbid = 0
ORDER BY bids.week ASC;```
While this doesn't duplicate the weeks, sum(amount) obviously ignores the individual week now~~
nvm got it
I want weeks with no bids to show up aswell so thats why a simple group by doesnt work
Does anyone know what software I need to make a music bot other than discord.js, node.js, and Visual Studio Code?
either node-opus or opusscript for voice support
visual studio code isnt necessary. any code editor will do
webstorm gang
vim gang
nano gang
notepad gang
notepad++
no
sublime text gang
node cli gang
ye sublime text
intellij 
ew why would you use notepad 
jetbrains gang
no we're cheap
writing a guide on how to get it right now
Pretty sure there are official instructions already
Fellas, any idea on how to display the status "Bot is typing..." on python?
I only have this:
async def Hey(ctx):
async with ctx.typing():
await time.sleep(5)
await ctx.send ("?")```
bots can
yes
at the cost of another request 
yes
or if your bot's slow
oh whoops
Fair enough
async def Hi(ctx):
async with ctx.typing():
await asyncio.sleep(5)
await ctx.send ("?")```
I only had to type asyncio.sleep(seconds):
Hope this is useful for those who are trying to implement this option to their bots
Now back to work
It's a cute lil feature
Indeed, especially for the Q/A
Idk why people would slow their bot down to make it seem like it's typing.
As in the bot's slow, so it sends a typing signal to say, "I'm working". Just an example case.
An example is @earnest phoenix
I'm saying it's just pretty pointless really.
I know, it was just an example.
@ornate wedge you always want to use anything async in an async code
if (message.content.startsWith('~edit'))
{
var messageID = message.content.split(" ")[1];
var editedmessage = message.content.split(" ").slice(2).join(" ");
var embed = JSON.parse(editedmessage)
message.channel.fetchMessage(messageID)
.then(message => {
message.edit({embed});
});
}
});```
Hi this my embed edit message that worked out, but I noticed that the embed will go away after some hours, how do i prevent this?
like too often
How do i make the bot to delete the embed but not the message? message.delete() and then edit the message to send a new embed
after four months of not touching my code, I get this error always without consistency. sometimes even before the bot can run, sometimes, after the bot runs. help?
Sound like a firewall or proxy issue
ohh I see. Maybe because I'm at work rn haha thanks!
for whatever reason, i randomly get an error, message.content.startsWith is not a function
content is undefined probably
well i made it return when message.content is falsy and it still occurs
well
whatever it is, content is not a string
if it doesnt have a startsWith function on it, it's some other primitive type or null
Some bots use the typing thing when a command is executed that requires some time to process
This way users know it's busy
And not just dead
hmm
if i allow server owners/admins to add custom scripts to the bot and those custom scripts may allow the bot to do a at-everyone or at-here on that server, this isnt an issue, is it, if thats something that the owner decides to do? After all, they could do that themselves anyway with a simple message.
Would making a loop be possible in custom scripts?
Because ateveryone loops...
I'd really advise against making custom scripts public
If you would do custom scripts chance for pwners, they might can destroy ur bot globally.
they can eg. easily get ur bot token by prefixcommand client.token
no, they cant
๐
i factored this in, its a javascript virtual machine within a C++ bot, not just an eval
the way i see it, the server admin is being given enough rope to hang themselves, the api calls i give them only work within the guild where the event is triggered
so yes they could loop and spam a bunch of at-everyone to their own server, but not someone elses, and worse case scenario they piss off their own users
even then, the loop is limited in speed to the discord rate limit
if they get access to do custom scripts, then they can do anything??
LF bot developer (high level), to make a job for $15.
for more info PM me.
Dm Oliy to get access to #434058442764714002
@restive furnace anything? really? ๐ anyone would think i didnt put any thought into this. ๐
its live now, if anyone wants to give it a go. i welcome anyone who manages to find any issues to report them back to me so i can improve it ๐
heres the docs on what the api does and doesnt let you do, the intent isnt to allow you to create a whole bot, just customise responses with extreme prejudice https://github.com/braindigitalis/botnix-discord-cpp/wiki
yeah i highly doubt a regular user of your bot would understand any of this ยฏ_(ใ)_/ยฏ
Yeah, things like custom commands in other bots are insanely simple or have a UI of sorts
You cant expect the users of your bot to always be insanely knowledgeable
yup ๐
i dont have time to create a visual language like with botblocks, nor is that my intent
its for people who know "a bit of" javascript, or can hack and copy and paste to get by
the system is very forgiving, especially compared to full blown node and djs
but not for complete newbies, no
if youre curious you can get to the functions via the bots dashboard
What will probably happen is over time people will share scripts, more technical users will give them to less techie ones
Is your embeds nowdays like this https://gyazo.com/2e9e440119b0422336b5d9b9eec05d4b? (running on v12 and u can test the cmd by saying n$ping)
yes
kk so its disc api or d.js v12?
discord updated
kk
-rwxr-xr-x 1 sporks sporks 69M Nov 13 15:05 bot
lol 69mb bot executable, ouch.
!bots
bud my jar is 13mb lmao
that honestly seems like an outlandish size for an executable
its normal for frameworks like .net core
java nasty
you can pack up a .net core app to a independent executable
meaning it can run without anything additional installed
Yh
Having a exe is very useful
Where C languages Excell at really
Cuz python for example requires quite alot of work to make a exe
same for nodejs
Pytoexe doesn't support all the modules
true
ยฏ_(ใ)_/ยฏ
I tend to build a Kivy framework
I don't make an exe normally
So you turn all of the files in to exe
Nah
Unless it's supposed to be used on multiple systems that might not have Py installrd
its actually a C++ executable
with a ton of deps, and some heavyweight static linking
that one thats nearly 70mb i mean
and yeah its huge
i blame header-only libs
and -O3
You can dm a mod.
yeah, and hoping that one of th 10 i ping has time ๐
lol you could just post it in #memes-and-media people live there
Soo is it possible nodejs to exe?
(but i dont rly need it cuz i use linux mostly anyways)
honestly you shouldnt really need to but i guess you can?
it's always suggested to compile your app rather than run a debug build of it
Hi, in discord.net, is there a more efficient way to delete a message after a certain amount of time rather than delaying the whole task?
This is the code at the moment:
var msg = await Context.Channel.SendMessageAsync("Yikes");
await Task.Delay(15000);
await msg .DeleteAsync();
well no
you can offload it to another thread if you don't want it to block the command
are there no timers in py?
There are
of course there are
You need to make a async background task
or use ext.tasks
Cuz you can't make a new thread using async without alot of hassle
If you just wanna sleep for X, two ways
(that's async, we dropped support for that in april)
fi you want a loop, two ways too
okay then say asyncio
That still will not work with a new thread
Hence why
In the docs
It says
Background tasks r a thing
as you have stated
ProxiPi
ProxiPi
I'm making an API that allows peeps to get anime pictures for their bots, but need a name, so here: React with ๐ฆ for ProxiPI, ๐ง for ProxPI, ๐จ for PIroxy, and ๐ฉ for API
Yeetus
2 votes, seems very good lmao
3*
@earnest phoenix debug?? nodejs doesnt have actually any debug build expect u can put debug mode on some modules
Starting the project now! It's in python and being made with flask
hey,
well im tryin to make my bot auto coins drop system can be switched like
//enable coin drop status
//disable coin drop status
anyone can help please?
||discord.js||
Use a database for each server to log the drop system to on or off
then check if its on it will enable the coin drop
^
if its off it will disable
pretty much that
oh k
i would recommend firebase
u mean host for both?.. xd?
You can create a simple map and store it. Example:
{id: "123456789123456789", mode: "off/on"}
ooo
memory storage (maps, arrays) is a bad practice if ur bot is gonna be bigger
it's recommended to use rethinkdb, MongoDB, or sql-based
firebase is rly cheap
how much?
but mongo is free
well i search the best
and easy to install on vps
i mean no tons of crash
ooo
good luck ;D
ty
I use SQLite, it works fine if you don't write too often to the DB
From experience I learned that trying to write to the DB 5 times per second is too much ๐
which sqlite driver/lib did you use?
and also how did you make those writes?
because
SQLite will easily do 50,000 or more INSERT statements per second on an average desktop computer. But it will only do a few dozen transactions per second
a transaction involves waiting for data to be written to disk
inserts are loaded into memory before they are written
I did 1 write, then a commit, then another write and so on.
I did change it now to group all the writes together before writing it to the DB
don't try to commit every single write action if you do a ton of them ๐
I should probably have been more clear and said 5 transactions/commits per second instead of writes
Firebase costs doesn't it?
It doesnt, but its pretty hard so ill recommend who didnt use any dbs other than json or no any, use these to write and read the db
Keyv
Sequelize
Choose wich want but sequelize is just like sql v2
and keyv is easier
than sequelize
(i use sequelize)
@topaz fjord
depends on your use case
keyv is only for key-value storage, if you need tables/documents/other complex storages, then you need something else
also neither keyv nor sequelize are actual databases
they are just abstraction layers
im guessing this is under development
dont by any chance know how to change keyboard language
my UK keyboard has turned american
-_-
It is in Settings
where
What keyboard are you using
.
-dotpost @queen canopy
@queen canopy
Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.
I nead bot
what
How to defined guild ?
The number of guild where my bot is
<Client>.guilds.size

btw, would be a good idea to use .toLowerCase(), @lunar crystal
I'm a bot dev, how do I get the role.
If your bot will be approved, you will get the Bot Developer role
@unkempt root you have to be certified to use JS on the long description
oh, how do i get certification? does my bot have to be added to DBL? because it's not approved yet ._.
ping me
@unkempt root u need to send a physical letter to Oliy since the online applications are frozen with no ETA planned.
You can use iframes i think
make an iframe that just shows your website and you can do anything you want
@unkempt root
yeah, i decided to use shields.io's JSON badges
How do you get the total count of shards created?
if djs
@limber plinth what library?
Djs
My friend is trying to make it's stats Playing !help | Watching (number) users
He uses java
isnt it
"Playing !help | Watching " + client.getUsers().length + " users."
congrats on hitting 2.5k guilds first of all
as he said, now is the time to start sharding your bot
@compact oriole umm how its hard if u did dashboard and etc. i think thats harder
cuz u just need to use sharding manager
and yeg
wait
Yea its required when your bot hits 2500 guilds
If id knew about that i would have started with it
Nah you dont generally start with it
kk
you can start sharding any time you want
in fact it's probably best to work around it whenever you start a new project tbh
ye but maybe fist code some other functions
It's not that hard to implement so eh
whenever is a good time
mayby when it has 1500 guilds then you should do sharding
https://discord.js.org/#/docs/main/stable/class/ShardingManager?scrollTo=broadcast
What is the event listener on the shard for when the manager broadcasts to them
Manager.on('message', function(shard,message) {}) i know how to do the opposite
that's for a shard broadcasting to the manager
the documentation provides a message for sending a message from the manager to each shard
method for*
would it be client.shard.on('message', function(msg){}) for the event listener in the subprocess
Huh this difficul discord.js. I like python, due this have AutoShardedBot
sharding isn't hard
I just have a multi-server channel feature (messages are sent by webhook on both servers in a specific channel)
and since sharding splits the guilds i need my shard manager to handle that
But... in js you must change some code when you start using sharding, correct?
I heard discord.py AutoShardedBot will break at some point
well sure, but it's hardly any work
remember saying someone it broke on 50k guilds 
True
broadcasting directly to all other shards from the shard itself works
problem solved
hoi a question about message collector
message.channel.awaitMessages(response => response.content === "uwu", { max: 1,
time: 30000,
errors: ['time'],
})```
How do I make the `awaitMessages` to accept any kind of message and not just `uwu` (Like any text they want to type)
By not copying code and understanding what you're doing
The function you're passing to it acts as a filter
true -> collect
false -> don't collect
so if you want it to collect everything, what do you think the filter should look like

I just delete the === "uwu"
after staring at the codes for some hours
i finally solve something by myself, thanks for being strict to meh
Quick question, I am using createReactionCollector for embed pages, and right now it doesn't time out, so the bot is constantly listening for the reactions. Is this considered API abuse?
I'll probably have it time out if nobody reacts after a certain amount of time anyway, but I was just curious
Well not rlly?
As long as it's not in a loop constantly pinging to check
If it's just like on the reaction
It should be okay
Otherwise things like reaction roles would be considered abuse
can anyone help me with sharding my python bot?
Sure
You rlly don't need to shard unless your servers are near 2000
And you can get a autosharding system with d.py
i am over 2500
like he wont even launch, i left the problem off for months because i was busy with exams
replace your the name with AutoShardedBot
bot = AutoShardedBot(description="a description", command_prefix="!", shard_id=1, shard_count=5)
# shard_id = where to start
# shard_count = amount of shards for your bot
"NameError: name 'AutoShardedBot' is not defined' do i need to import some modules? sorry if im being silly here like i havnet touched python for months
Have u got snippet of code
``@client.event
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == client.user:
return
if message.author.id == elise:
print(message.content)
return
if message.content.startswith('hewwo') or message.content.startswith('HEWWO') or message.content.startswith('howdy'):
msg = 'Hello {0.author.mention}'.format(message)
await client.send_message(message.channel, msg)
if 'what the hell' in message.content:
msg = 'https://www.youtube.com/watch?v=oZTbnoSFgMU'.format(message)
await client.send_message(message.channel, msg)
``
like this?
Ah
Ur using client event not bot
Client event is when any user sends a message or does somthing
You might need to switch to bot
you need to import AutoShardedBot
as simple as that
from discord.ext.commands import AutoShardedBot
client= AutoShardedBot(description="a description", command_prefix="!", shard_id=1, shard_count=5)
also
to improve your code
I don't think client uses a set prefix?
instead of that
if message.content.startswith('hewwo') or message.content.startswith('HEWWO') or message.content.startswith('howdy'):
put that
if message.content.lower().startswith('hewwo'):
it will convert the message to lowercase
so that if someone sends "HeWwO" it will still work
yeah i probably shouldve done that a long time ag huh
from discord.ext.commands import AutoShardedBot
client= AutoShardedBot(description="a description", command_prefix="!", shard_id=1, shard_count=5)
thanks i shall make my bot aps insensitive
this should work fine
should i remove 'from discord.ext.commands import bot' ?
oh heck i meant to
from discord.ext.commands import bot
Yes since you won't use it anymore
The only thing you'll need to change is when u initialize the "client" or "bot" variable
In my bot it's "client"
if u need further help just ask
will do thanks
Otherwise send me a dm
wait oh god i posted my token in that wait
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4011 (private use), reason = Sharding required.
show the actual code where you initialize the bot
i changed it to this ``import os
import discord
from discord.ext.commands import bot
from discord.ext.commands import AutoShardedBot
from discord.ext import commands
from discord.voice_client import VoiceClient
import asyncio
import random
import time
from datetime import datetime, timedelta, tzinfo
from pytz import timezone
import pytz
import datetime
with open("prefix.data") as prefixf:
prefix = prefixf.readline()
Client = discord.Client()
bot = AutoShardedBot(description="a description", command_prefix="!", shard_id=1, shard_count=5)
with open("token.data") as tokenf:
token = tokenf.readline()
TOKEN = 'XXXXXXXXXX'
client = discord.Client()``
``?
``import os
import discord
from discord.ext.commands import bot
from discord.ext.commands import AutoShardedBot
from discord.ext import commands
from discord.voice_client import VoiceClient
import asyncio
import random
import time
from datetime import datetime, timedelta, tzinfo
from pytz import timezone
import pytz
import datetime
with open("prefix.data") as prefixf:
prefix = prefixf.readline()
Client = discord.Client()
client = commands.Bot(command_prefix = prefix)
with open("token.data") as tokenf:
token = tokenf.readline()
TOKEN = 'XXXXXXXXXX'
client = discord.Client()``
import discord
from discord.ext.commands import bot
from discord.ext.commands import AutoShardedBot
from discord.ext import commands
from discord.voice_client import VoiceClient
import asyncio
import random
import time
from datetime import datetime, timedelta, tzinfo
from pytz import timezone
import pytz
import datetime
with open("prefix.data") as prefixf:
prefix = prefixf.readline()
Client = discord.Client()
client = commands.Bot(command_prefix = prefix)
with open("token.data") as tokenf:
token = tokenf.readline()
TOKEN = 'XXXXXXXXXX'
client = discord.Client()```
client = AutoShardedBot (description="desc", command_prefix="!", shard_count=5)
Guys I Need Reply Code and Embed
@restive furnace stop sending random stuff
b
Should I code the sample for you?
don't spoonfeed
hmm. i should define a global constant in my bot's vm called client.token, as a string, with the value https://www.google.com/search?q=token&source=lnms&tbm=isch
... just to mess with hackers that think i was that dumb ๐
yeah
i mean
yeah dont spoonfeed
heck
import discord
from discord.ext.commands import bot
from discord.ext.commands import AutoShardedBot
from discord.ext import commands
from discord.voice_client import VoiceClient
import asyncio
import random
import time
from datetime import datetime, timedelta, tzinfo
from pytz import timezone
import pytz
import datetime
with open("prefix.data") as prefixf:
prefix = prefixf.readline()
Client = discord.Client()
client = AutoShardedBot (description="desc", command_prefix="!", shard_count=5)
with open("token.data") as tokenf:
token = tokenf.readline()
TOKEN = 'XXXXXXXXXX'
client = discord.Client()
startup_extensions = ("Music.py")
bot = commands.Bot("?")
mommywords = ("Oh shit oh fuck looks like something gone wrong with the message to accompany your anime mom.")
ronpatext = ("Error 404, text not assigned yet.")
class Main_Commands():
def __init__(self, bot):
self.bot = bot```
so if someone tries to make a javascript in my control panel that does something like: create_message(CHANNEL_ID, client.token) it gives them an image search for fairground tokens ๐
import os
import discord
from discord.ext.commands import bot
from discord.ext.commands import AutoShardedBot
from discord.ext import commands
from discord.voice_client import VoiceClient
import asyncio
import random
import time
from datetime import datetime, timedelta, tzinfo
from pytz import timezone
import pytz
import datetime
with open("prefix.data") as prefixf:
prefix = prefixf.readline()
Client = discord.Client()
client = AutoShardedBot (description="desc", command_prefix=prefix, shard_count=5)
with open("token.data") as tokenf:
token = tokenf.readline()
TOKEN = 'XXXXXXXXXX'
startup_extensions = ("Music.py")
mommywords = ("Oh shit oh fuck looks like something gone wrong with the message to accompany your anime mom.")
ronpatext = ("Error 404, text not assigned yet.")
class Main_Commands():
def __init__(self, bot):
self.bot = bot
should be better
So it doesnt rly affect anything if u login the bot and change client.token value?
@restive furnace are you asking me, or someone else?
hmm, i'd say it doesnt matter until the next reconnection
k
but ive never tried it
as much as i appreciate your help i still get the ```discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4011 (private use), reason = Sharding required.
File "C:\Users\soyou\Desktop\komaeda\bot.py", line 79, in on_message await client.send_message(message.channel,msg) AttributeError: 'AutoShardedBot' object has no attribute 'send_message'
tbhe bot has actually launched now though so hmm
have you migrated to 1.x?
Since now it's
message.channel.send("message here")
no longer
bot.send_message(message.channel, "mesage here")
he hasnt been updated in months, i had exams. guess i'll go through and change it
thanks for the documentation, i think i'll leave you alone for nwo!
thanks for all the help
It will take some time ;)
What are the reasons for this error?
^^
abc.Messageable.typing()
TypeError: typing() missing 1 required positional argument: 'self'```
what's the easist way with discord.py to send a typing status... like apparently i should repalce Client.send_typing with abc.Messageable.trigger_typing() but i cant seem to get it to work
nvm i fixed it
is there a way to stop my client from sending ```File "C:\Users\soyou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\http.py", line 218, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50001): Missing Access
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\soyou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "C:\Users\soyou\Desktop\komaeda\bot.py", line 59, in on_message
async with abc.Messageable.typing(message.channel):
File "C:\Users\soyou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\context_managers.py", line 63, in aenter
await channel._state.http.send_typing(channel.id)
File "C:\Users\soyou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\http.py", line 218, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50001): Missing Access
like. when forbidden is raised i dont want the cmd.exe running my bot.py to tell me it has been
put it in try: except
if it cant send a message cuz missing perms
tell it to DM the person who called the command
and sya
say*
oi oi im missing perms
op?help
wont chat
@modest schooner personally i'd just put
if isinstance(err, discord.errors.Forbidden):
pass
under on_command_error
also use
async with ctx.typing():
# do things here
okay my bot runs fine but wont execute commands i have the command handler set up it throws no exceptions and does not do anything im not even sure it receives the command
what am i doing wrong
https://hastebin.com/enofajadab.cs <----- my code
https://hastebin.com/uxihemituh.m <----- my module containing the command i want to execute located in root\data
am i doing it wrong in the module or in the main code?
and can i get a pointer to where i need to look?
well im going off cuz its not throwing errors:
is it caps sensitive or no etc... if it is caps sensitive then it will only respond and trigger to the EXACT command as given in the command
If it is not caps sensitive then make sure your commands take that into account, e.g if you turn every message into upper case make sure its looking for a command all in uppercase
(language is C#
yh
well
like Ping
ah
if it converts to upper or lower
it would be doing is "PING -T" == "Ping -T"
which would return false
Ping -T wont work
yes
and no other text manipulation is happening to that string as its processed
are you admin; its hard to tell if Owner is the actual owner of guild or admin
or if its only for you to use set it so it only looks for your UserID
no actually not
but then you also should remember to pre check / make sure when it compares the variables that They are both the same data type
as str(123) != int(123)
well look at le docs and see what else you can have in there
yees
@modest maple https://docs.microsoft.com/nl-nl/dotnet/api/system.object.memberwiseclone?view=netframework-4.8#System_Object_MemberwiseClone
you mean something like this?
When i replace Custom Status to รzel Durum its saying
TypeError: user.presence.game.replace is not a function
But this code working in eval command
python?
@earnest phoenix u dont replace it just tell it to set it again
and Eric im not sure
have a play with it
js
if it doesnt work try requireadministrator
?
wait... [requireOwner] has tooltip: Requires the command to be invoked by the owner of the bot.
Does anyone know how to shuffle a youtube playlist?
I use ffmpeg, ytdl-core, javascript
well fuck
i cant figure out how to make my user owner of bot and allow execution of a special command
@glacial mango is it in an array, object, map, which is the variable with the playlist information stored in?
But what is the queue? Is it an object? An array?
it's like this
**1.** [Halsey - Without Me](https://www.youtube.com/watch?v=ZAfAud_M_mg) **2.** [Post Malone - Better Now](https://www.youtube.com/watch?v=UYwF-jdcVjY) **3.** [benny blanco, Halsey & Khalid โ Eastside (official video)](https://www.youtube.com/watch?v=56WBK4ZK_cw)
audio.queue[targetServer.id] && audio.queue[targetServer.id].map(el => el[2]);```
so it's an array
https://hastebin.com/kulopanuva.cpp <---- my question being why does it not work
(ignore the extension is CS)
How to edit role colours using discord.js??
Thanks
;-;
https://hastebin.com/kulopanuva.cpp <---- my question being why does it not work
what is not working
If a string = Hello! I am hungry
how do I get all characters before the ! ?
split by ! and get the first item out of the returned array
How do I do that?
https://cdn.discordapp.com/attachments/385837258768515083/644555095127621632/IEfefB42-2.png when people spoonfeed in #development even though they know its spoonfeeding
xD
yh ik, altho if its in python its the first thing u search up if you do splitting a string in python... If you dont know how tosplit a string you're gonna have more issues than the split command
Hello! I am looking for a bot that works like a time card system. If an individual were to type a command such as "clock-in", the bot would start logging their time. When the command "clock-out" is used, the bot would then record the total time and log it into a spreadsheet.
Does anyone know of a bot with this type of feature? Any help would be greatly appreciated!
I don't think this is the right channel if you are looking for a bot.
Sorry, I just joined this server. Where should I ask?
Eh, I doubt this server will help much
since it's just a server for a public bot list
Well that's a bummer. Thanks anyways
You might be able to find a bot like that on https://top.gg but other than that, no luck I believe
-hardrequest @digital beacon
@digital beacon
You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already. You can try and put a request on Fiverr or Freelancer.
Making a Bot Builder that has premade commands and features (like economy). Basically, you choose your commands and features, the bot will compile everything into the commands.json file and send it for download
What you guys think so far ?
Hi Guys
looks cool @tight ferry
thank you ๐
I need Help
with?
on what?
I programed the embed reply code and the code after approx hour did not work
Pls whit is error
send the error message
ya need to give us a lil more than just after hr dont work
Thank you Spider
nice idea @tight ferry
but using json files for dynamic data 
I know, it's not ideally what most go for, just easy
And it integrates with my main bot files nicely
How would you run the built thing? I'm assuming you just put it with another file and run the main bot file?
The entirety of the bot is already made, it's a matter of choosing which commands to put in with the rest of the files.
Plug and play
So yes, put it in with the other files and run the bot file
could that potentially get abused in some way
How do you mean ??
potentially you could just spam the bot with changing commands over and over until somthing breaks or crashes
unless theres a time out]
Nah each user would have their own bot instance
^^^
as far as I understand it
so the json doesn't actually have any code, it just acts as a config?
it'd be a neat idea to make it fully modular and have a plugin marketplace on the bot builder bot
It has code, and I was thinking about having it be modular. But that would mean I would need to start over
Well I am off to bed (8 AM)
Is there uh function idk to get message link Discord.js??
@tight ferry Looks awesome fam
There's a URL property for a message
You can probably find out if you go to the Docs
<message>.url?
yes
it won't directly say like that most of the time
just in case.....
it's better to click on the class you want then look through its props on the sidebar
yh
https://discordapp.com/channels/<guild>/<channel>/<message>
^ty
Please i need command auttaja bot and how to set up
not a support server for auttaja bot
https://top.gg/bot/auttaja -> under the server count, click "Join Support Server"
Howdy Folks. Just curious if anyone knows of a Bot that can check Unity Asset store order numbers. Seen a few on servers, but not sure if they are custom built. If there are none, I may look into making one but thought I would ask rather than re-invent the wheel.
I doubt any of us would know. Try searching on https://top.gg/ and if there's nothing, you might be lucky
-hardrequest @amber nebula
@amber nebula
You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already. You can try and put a request on Fiverr or Freelancer.
If you have seen the bot on some servers then look up the bot name on bot websites and see if it's there
ok cool. I did not see anything, but some of the descriptions on features arre sorta lacking lol
yea
anyone here know clojure?
Why the field title is so small ?
Because Discord
I can't change it ? Because on the discord.js guide the text was larger than that ^^
If you can get Discord to change it, sure
The screenshots are from older versions of Discord
If I want to connect discord:
Oki thank u ^^
whats the absolute best way to store and monitor server count with shards
im thinking of updating every shard id with the server count every x minutes in my database
Can someone help me with this? I am getting an error where my bot crashes and deletes the data it has stored is a .json file. I am running the bot off a Raspberry Pi 3 Model B if it helps. It gives me this:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - Javascript heap out of memory Aborted
FATAL ERROR
well have you tried reading the error
as it does give a very good idea to what the issue is
I know its out of memory, but im asking how i could fix it.
Get a better system with more RAM
oof
The PI just doesnt have enough for your program to run
and PI's cant have more memory (RAM) added
Or its a Memory Leak
maybe but its still pushing the PI if its any medium sized bot
Depends on Guides
and the code
yes
some processes and modules take more RAM than others
It could also be something that's using a lot of memory
an easy way is running an infinite loop
any DB system that e.g prefix's will use RAM
cuz cache
R PI 4 would solve the issue tbf you get 4 times the RAM and more cpu power
but depends idk how much optimising you can do to ur code
nope
it's not that his system is bad, discord bots can probably run anywhere
id assume it's a memory leak
it depends on what the bot does, most bots can run anywhere but not all bots
ehhh idk about writing to json but maybe it got deadlocked and didnt know what to do
regardless it's probably faulty code
At some point 1GB just isn't enough ram
Are there any existing bots designed to do the same functions as https://github.com/aetheryx/tweetcord, but on a smaller -- user-hosted -- scale (as to keep it within twitter's free 'premium sandbox' designation)? https://blog.twitter.com/developer/en_us/topics/tools/2018/enabling-all-developers-to-build-on-the-account-activity-api.html
Maybe
erm
Hard request
-hardrequest @hearty tangle
@hearty tangle
You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already. You can try and put a request on Fiverr or Freelancer.
yep
One of my bots interacts with twitter, it isn't hard to implement once you know how to make a bot
just find a good twitter api library
From what I can tell, twitter only has a single free api and from that, I can't find much in terms of documentation
My bots are made in Java, Twitter4J is pretty good for Java
dont know about any JS libs
Does it have the ability to send tweets from an account though?
I thought there was only a singular, official, and poorly documented api for that...
(My main goal is being able to type something in a discord channel and have a twitter page tweet whatever I just typed).
ah. I must have been looking in the wrong place
and if you sign up for a free developer account then your twitter bots can do everything you want
is there a good way to make the prefix of my bot not case-sensitive? my prefix is "hey vector" and I want people to be able to say "Hey Vector" or "Hey vector", etc
var message = "Hello World";
if(message.toLowerCase().includes("hello".toLowerCase()){
message.react("๐")
}```
@tight mountain hope this can help you out
//SHOP
const table2 = sql.prepare("SELECT count(*) FROM sqlite_master WHERE type='table' AND name = 'shop';").get();
if (!table2['count(*)']) {
// create the damn table
sql.prepare("CREATE TABLE shop (id INTEGER, role TEXT, guild TEXT, itemname TEXT, desc TEXT, price INTEGER);").run();
// Ensure that the "id" row is always unique and indexed.
sql.pragma("asynchronous = 1");
sql.pragma("journal_mode = wal"); //journal_mode for an in-memory database
}
// And then we have two prepared statements to get and set the profile data.
client.setShop= sql.prepare("INSERT INTO shop (id, role, guild, itemname, desc, price) VALUES (@id, @role, @guild, @itemname, @desc, @price);");
client.getShop = sql.prepare("SELECT * FROM shop WHERE guild = ?");
client.user.setActivity("Getting Updated..Under Development!");
});```
Hi this a snippet of my SQL DB for `shop` system in my bot. And yes, I do steal the codes from some idiots guide because am still noob at better-sqlite3
For the `id` one I want to make it that each time there's a new records the `id` will be plus by 1. It's like a list la
Should I use ` sql.prepare("CREATE UNIQUE INDEX idx_shop_id ON shop (id);").run();` or something else?
eh nvm im dum got it solved
You mean case-intensive (btw example should be message.content.toLowerCase()...).
message.toLowerCase().includes("hello".toLowerCase()
is there a valid point in using .toLowerCase on a string you are SURE that will be all-lowercase
Help
Every time I start my bot (shard file), I get Error 401: Unaithorized
Thats the log
const { ShardingManager } = require("discord.js");
const { get_Date } = require("./functions.js");
const apitoken = *Removed due to privacy*
const shards = new ShardingManager("./alaia.js", {
token: apitoken,
totalShards: "auto",
});
shards.spawn().catch(err => console.log(err));
shards.on("shardCreate", shard => {
console.log(`[${get_Date(new Date())}] Launched shard ${shard.id}`)
});
Welp just fixed it
I added an amount on spawn()
LMfao
Message.channel.members is often undefined. Any reason for this?
I use it to see if my bot has the permission to post in that channel
id advise going back through all your code and make sure your varibles are the same name
remember caps and no caps count as completely different variables to programming languages
@modest maple was that a reply on my question? ๐
yh
well, i only use it in one place
and my IDE prevents stuff like that
const me = msg.channel.members.get(bot.user.id);
if(!me.permissionsIn(msg.channel.id).has('SEND_MESSAGES')) return;
@silver rapids I think you're looking for the guild members and not channel members as that doesn't exist apparently it exists?
it works though :p
and by looking for guild members, i can't fetch the permissions for that channel
well. it works for 99% of the time. It's rare but sometimes i receive that members is undefined
and this code gets executed with each command
msg.guild.me exists
yes, but i need to check if i have permission to post in the channel that triggers it
by checking on guild it always returns true
permissionsIn is doing that, is it not?
Ah, apparently it exists now. I didn't even know that. 
Do you mean the members property is sometimes undefined (throwing a TypeError), or the me variable is undefined? I believe it'd be safer to use message.channel.permissionsFor then passing a guild member resolvable (it can be undefined if the member doesn't exist) to check its permissions (then .has("SEND_MESSAGES")).
or that as well
yeah members is sometimes undefined. But it isn't a problem as i catch the exceptions
was just wondering why it is undefined sometimes
the only way for it to be undefined is if the message is from a dm
but then guild itself would be undefined as well
What is shard? how to use this?
library?
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Does anyone here know how to code in Python?
@earnest phoenix i meant ask the question you had with python here :p
This course will give you a full introduction into all of the core concepts in python. Follow along with the videos and you'll be a python programmer in no t...
Ummmm thanks?
A- WATCH ABOVE.B-use codecademy's free trial
if it takes 4 hours, you can learn fully blown python in 7 days
@earnest phoenix learn how to code first
@earnest phoenix Look, I'm gonna tell you this and only this. Use books and codecademy. They will help you better that you can think
oh uhhh this isnt really a place to find colaborators
especially if you dont know the language
there is a reason people dont look for "idea guys" 
Thanks for the info?
np bb
If i edit my bot, does that reset the bots queue place?
no @compact oriole
Gud xd
@spare goblet You doing work tf
I use https://www.tutorialspoint.com/index.htm to learn coding
console.log(`Je peux afficher les ${client.ping}`)
});
client.on('message', message => {
if (message.content === prefix +'ping')
message.reply(`**:ping_pong: Pong ! ${Client.pings}** ` )
});```
The bot answer by ๐ Pong ! undefined
@lunar crystal please client and noy Client if you have define client
Not *
Oh I didn't know that
I think, I could be wrong
it literally says it does
i always open the docs when people ask questions, because i dont remember everything in there lul
My bot can't stop doing that lol
Well you're calling pings
not ping
@lunar crystal just return message.reply(your response)
client.on('ready', () => {
console.log(`Je peux afficher les ${client.ping}`)
});
client.on('message', message => {
if (message.content === prefix +'ping')
return message.reply(`**๐ Pong ! ${client.pings}** ` )
});
but 559 ping though
Yes
But he can make a client.pings/3
Ok thank u @earnest phoenix
Np
this is an example x)
๐

woah
Why not just add them normally without the need for eval
thats the joke
๐
dab
client.pings.reduce((c,p) => {
for(let i = 0; i < p; i++) {
c++
}
return c
},0)/3```
lmao
lol
Bruh
lol
that name tho
smh
On a global economy based bot how would you go about guild specific rankings?
I can't rly know who's in the guild without tracking it so like
Seems like I'd have to fetch all guild members which seems very stupid
Or I'd have to keep track of what guilds the user is in by updating that in my DB each time it changes, but that could possibly be wrong if the bot was down while they joined/left so seems like even then I'd still have to fetch all at times to make sure that it's actually right
Maybe I'm missing something here but to me it rly seems like these kind of leaderboards would be incredibly inefficient for large servers / not reliable as in some users might be missing (if I don't fetch all)
Fetch Guild members who uses your bot
I don't think you understand my problem
I have my database with tons of users
I have a discord guild with a bunch of cached users and a ton of uncached users
what i do
I can't fetch the guild members that use the bot without knowing who those members are
yeah sorry mate
I got it
const permissions = 2147483647;
console.log(permissions);
if((permissions & 0x8) == 0x8){
console.log('contains');
}
client has no property called guild
@lunar crystal message.guild.owner
Thank u ^^
@stray wasp pretty sure you can just if (permissions & 0x8)
oh really
As the result would either be 8 or 0
0 would be seen as false and 8 as true
So your second check isn't needed
oh ok thank you
What is shard? discord.js
Sharding shouldn't be a priority until your bot reaches like 1k servers
However sharding is basically running the same instances again
Is there a way to post a message's data which is in one discord server to another discord server
E.G-I wanna order something
sb!order pizza
and it logs only the text bit and an invite
its only when ur at exactly 2.5k servers
in kotlin is there a substantial difference between contains and containsKey when using both methods on a HashMap?
literally
its recommended at 1k
Mhm
log a invite link
yes how do we do that
ok
post in a channel
the link
that works if you want multiple "employees"
@static nexus make sure to state u generate invite links to use to join a server
if not ur breaking tos
i will
cool


