Skip to content

Commit

Permalink
Final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenrac committed Mar 20, 2020
1 parent f5dfbdb commit 52b8a3e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ def start_bot(shard_count=None, shard_ids=None, send=None):
class Watora(commands.AutoShardedBot):

def __init__(self, shard_count=None, shard_ids=None, send=None):
title = "%shelp | patreon.com/watora" % globprefix
streamer = "https://www.twitch.tv/monstercat"
game = discord.Streaming(url=streamer, name=title)

super().__init__(
command_prefix=_prefix_callable,
case_insensitive=True,
description='',
shard_ids=shard_ids,
shard_count=shard_count,
status=discord.Status.idle,
activity=game,
fetch_offline_members=False,
max_messages=None
max_messages=None,
heartbeat_timeout=300
)

self.pipe = send
Expand Down
6 changes: 5 additions & 1 deletion cogs/useful.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,11 @@ async def userinfo(self, ctx, *, user: discord.Member = None):

joined_at = user.joined_at
since_created = (ctx.message.created_at - user.created_at).days
since_joined = (ctx.message.created_at - joined_at).days
try:
since_joined = (ctx.message.created_at - joined_at).days
except TypeError:
since_joined = 0

user_joined = joined_at.strftime("%d %b %Y %H:%M")
user_created = user.created_at.strftime("%d %b %Y %H:%M")
try:
Expand Down
2 changes: 1 addition & 1 deletion cogs/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def update(self, bypass=False):
guild_count = self.bot.guild_count
shard_count = self.bot.shard_count

if self.bot.is_main_process and ((time() - self.timer) > 60) or bypass): # max 1 per 60 sec
if self.bot.is_main_process and ((time() - self.timer) > 60) or bypass: # max 1 per 60 sec
self.timer = time()

payload = json.dumps({
Expand Down
4 changes: 2 additions & 2 deletions run_multiprocessing_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

loop = asyncio.get_event_loop()

shard_count = 30
shard_per_instance = 5
shard_count = 60
shard_per_instance = 10
instance_count = int(shard_count / shard_per_instance)

selection = -5
Expand Down

0 comments on commit 52b8a3e

Please sign in to comment.