File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
from discord .ext import commands
2
2
3
+ from ..log_setup import logger
3
4
from ..utils import utils as ut
4
5
5
6
@@ -23,7 +24,7 @@ async def ping(self, ctx):
23
24
24
25
@param ctx Context of the message
25
26
"""
26
- print (f"ping: { round (self .bot .latency * 1000 )} " )
27
+ logger . info (f"ping: { round (self .bot .latency * 1000 )} " )
27
28
28
29
await ctx .send (
29
30
embed = ut .make_embed (
Original file line number Diff line number Diff line change @@ -45,24 +45,25 @@ def _prefix_callable(_bot: commands.Bot, msg: discord.Message):
45
45
@bot .event
46
46
async def on_ready ():
47
47
"""!
48
- function called when the bot is ready. emits the '[Bot] has connected' message
48
+ function called when the bot is ready. Emits the '[Bot] has connected' message
49
49
"""
50
- print (f'{ bot .user .name } has connected' )
51
50
52
- logger .info (f"Bot has connected, active on { len (bot .guilds )} guilds" )
53
-
54
- print (f'Bot is connected to the following guilds:' )
55
51
print ()
56
52
member_count = 0
53
+ guild_string = ""
57
54
for g in bot .guilds :
58
- print ( f"{ g .name } - { g .id } - Members: { g .member_count } " )
55
+ guild_string += f"{ g .name } - { g .id } - Members: { g .member_count } \n "
59
56
member_count += g .member_count
60
- print ()
57
+
58
+ logger .info (f"Bot '{ bot .user .name } ' has connected, active on { len (bot .guilds )} guilds:\n { guild_string } " )
59
+
61
60
await bot .change_presence (
62
61
activity = discord .Activity (type = discord .ActivityType .watching , name = f"{ PREFIX } help" ))
63
62
64
63
# LOADING Extensions
64
+ # this is done in on_ready() so that cogs can fetch data from discord when they're loaded
65
65
bot .remove_command ('help' ) # unload default help message
66
+ # TODO: Register your extensions here
66
67
initial_extensions = [
67
68
'.cogs.misc' ,
68
69
'.cogs.help'
You can’t perform that action at this time.
0 commit comments