Compare commits
No commits in common. "96ff52ef8a044b9c05f4eeac548b5033969b4b6b" and "8c718ad2729ed013fda10350f153f83f79d4cfee" have entirely different histories.
96ff52ef8a
...
8c718ad272
@ -51,15 +51,13 @@ class FjerkroaBot(commands.Bot):
|
||||
def init_channels(self):
|
||||
if 'chat-channel' in self.config:
|
||||
self.chat_channel = self.channel_by_name(self.config['chat-channel'], no_ignore=True)
|
||||
else:
|
||||
self.chat_channel = None
|
||||
self.staff_channel = self.channel_by_name(self.config['staff-channel'], no_ignore=True)
|
||||
self.welcome_channel = self.channel_by_name(self.config['welcome-channel'], no_ignore=True)
|
||||
|
||||
def init_boreness(self):
|
||||
if 'chat-channel' not in self.config:
|
||||
return
|
||||
self.last_activity_time = time.monotonic()
|
||||
self.last_activity_time = 0.0
|
||||
self.loop.create_task(self.on_boreness())
|
||||
logging.info('Boreness initialised.')
|
||||
|
||||
@ -85,16 +83,12 @@ class FjerkroaBot(commands.Bot):
|
||||
async def on_ready(self):
|
||||
self.init_channels()
|
||||
self.init_boreness()
|
||||
logging.info(f"We have logged in as {self.user}"
|
||||
f" ({repr(self.staff_channel)}, {repr(self.welcome_channel)}, {repr(self.chat_channel)})")
|
||||
logging.info(f"We have logged in as {self.user} ({repr(self.staff_channel)}, {repr(self.welcome_channel)})")
|
||||
|
||||
async def on_member_join(self, member):
|
||||
logging.info(f"User {member.name} joined")
|
||||
if self.welcome_channel is not None:
|
||||
msg = AIMessage(member.name,
|
||||
self.config['join-message'].replace('{name}', member.name),
|
||||
str(self.welcome_channel.name),
|
||||
historise_question=False)
|
||||
msg = AIMessage(member.name, self.config['join-message'].replace('{name}', member.name), str(self.welcome_channel.name))
|
||||
await self.respond(msg, self.welcome_channel)
|
||||
|
||||
async def on_message(self, message: Message) -> None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user