welcome message

master
Emojigit 2021-03-22 10:26:44 +08:00
parent a0c742e7b9
commit 50c75fc5bb
2 changed files with 10 additions and 2 deletions

View File

@ -48,6 +48,9 @@ class MyClient(discord.Client):
if RTXT != "":
await message.channel.send(RTXT)
return
async def on_guild_join(self,G):
await G.system_channel.send("Thank you for using this robot. When you enter `[[page name]]` or `{{template name}}`, the robot will automatically reply with a link.")
if __name__ == "__main__":
client = MyClient(baseURL())

View File

@ -5,8 +5,13 @@ def gl(cont):
Lcont = x[0]
PLNK = re.search(r'^\[\[([^|#]+)(?:#([^|]+))?.*?]]$',Lcont)
if PLNK != None:
RLST.append(PLNK.group(1))
continue
try:
SNAME = PLNK.group(2)
SECTION = ("#{}".format(SNAME)) if SNAME != None else ""
except IndexError:
SECTION = ""
RLST.append(PLNK.group(1) + SECTION)
continue
FUNC = re.search(r'^{{ *#(exer|if|ifeq|ifexist|ifexpr|switch|time|language|babel|invoke) *:',Lcont)
if FUNC != None:
RLST.append("mw:Help:Extension:ParserFunctions#{}".format(FUNC))