#Hey guys need some assistance in

1 messages · Page 1 of 1 (latest)

prime arrow
#

Willing to pay if someone is able to help us optimize all of this - reach out via DM if you have a lot of experience with larger discord bots and handling sharding

chrome lava
#

How many server is this bot on?

prime arrow
#

over 2500 I believe

chrome lava
#

the ram for that bot(if you aren't using something like voice or etc) shouldn't be more than ~300mb I think
which intents do you have?
also, the issue is in the ram or that webhook triggers twice?

prime arrow
#

My intents/partials are probably unecessary:

partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.GuildMember, Partials.User],
  intents: [GatewayIntentBits.GuildMembers, GatewayIntentBits.Guilds, GatewayIntentBits.DirectMessages, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]

The main issue is the event being processed twice (I believe sharding issue?), but if we can knock out two birds with one stone regarding resource usage that would be awesome

#

The events I currently listen to are

Events.InteractionCreate
Events.GuildMemberAdd
Events.UserUpdate
Events.ClientReady
Events.MessageCreate

chrome lava
#

I'm not sure tbh, your sharding configuring doesn't looks bad as for me.
Is whole bot running twice, or only webhook(message create event) part?

prime arrow
#

I'm seeing the ClientReady event fire twice - but I only have one Dyno running which is why I'm confused

chrome lava
#

if only message create, and it happens often/you know how to reproduce - add some debug, which should log shard id

chrome lava
#

each event for each shard

prime arrow
#
  1. Should I switch ClientReady to be ShardReady?
  2. I can just do message.guild.shardId correct?
#

I appreciate your help!

chrome lava
#
  1. Should cause same(not sure)
  2. Yeah
#

for first question - one client can handle multiple shards iirc(or vice-versa)