Small fixes
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
from miniscord import Bot
|
||||
import discord
|
||||
|
||||
|
||||
async def hello(client: discord.client, message: discord.Message):
|
||||
await message.channel.send("Hello!")
|
||||
|
||||
@@ -22,12 +23,12 @@ bot.register_command(
|
||||
"hello", # command text (regex)
|
||||
hello, # command function
|
||||
"hello: says 'Hello!'", # short help
|
||||
f"```\n" # long help
|
||||
f"* |help\n"
|
||||
f"\tSays 'Hello!'.\n"
|
||||
f"```"
|
||||
"```\n" # long help
|
||||
"* |help\n"
|
||||
"\tSays 'Hello!'.\n"
|
||||
"```"
|
||||
)
|
||||
bot.start() # this bot respond to "|help", "|info" and "|hello"
|
||||
bot.start() # this bot respond to "|help", "|info" and "|hello"
|
||||
```
|
||||
|
||||

|
||||
@@ -275,9 +276,10 @@ async def hello(client: discord.client, message: discord.Message, *args: str):
|
||||
'''
|
||||
if len(args) > 1:
|
||||
await message.channel.send(f"Hello {args[1]}!")
|
||||
else :
|
||||
else:
|
||||
await message.channel.send("Hello stranger!")
|
||||
|
||||
|
||||
async def mention(client: discord.client, message: discord.Message, *args: str):
|
||||
channels[channel_id(message)] += 1
|
||||
senders[sender_id(message)] += 1
|
||||
@@ -286,6 +288,7 @@ async def mention(client: discord.client, message: discord.Message, *args: str):
|
||||
f"{channels[channel_id(message)]} mentions on this channel so far"
|
||||
)
|
||||
|
||||
|
||||
async def message(client: discord.client, message: discord.Message):
|
||||
if "catapult" in message.content:
|
||||
sent_msg = await message.channel.send(f"{message.author.mention} No profanity on this server")
|
||||
@@ -304,10 +307,10 @@ bot.register_command(
|
||||
"hello", # command text (regex)
|
||||
hello, # command function
|
||||
"hello: says 'Hello!'", # short help
|
||||
f"```\n" # long help
|
||||
f"* |help\n"
|
||||
f"\tSays 'Hello!'.\n"
|
||||
f"```"
|
||||
"```\n" # long help
|
||||
"* |help\n"
|
||||
"\tSays 'Hello!'.\n"
|
||||
"```"
|
||||
)
|
||||
|
||||
bot.register_fallback(mention) # the bot was mentioned or the alias was used
|
||||
|
||||
Reference in New Issue
Block a user