mirror of
https://gitlab.com/ceda_ei/Quadnite-Bot
synced 2026-05-12 08:40:06 +02:00
Add /help command
This commit is contained in:
@@ -2,6 +2,7 @@ from quadnite_bot.command import CommandDispatcher
|
|||||||
from quadnite_bot.commands.absurdify import AbsurdifyCommand
|
from quadnite_bot.commands.absurdify import AbsurdifyCommand
|
||||||
from quadnite_bot.commands.dice import DiceMatch
|
from quadnite_bot.commands.dice import DiceMatch
|
||||||
from quadnite_bot.commands.echo import EchoCommand
|
from quadnite_bot.commands.echo import EchoCommand
|
||||||
|
from quadnite_bot.commands.help import HelpCommand
|
||||||
from quadnite_bot.commands.random import CoinCommand, QuestionCommand, WordCommand, WordsCommand
|
from quadnite_bot.commands.random import CoinCommand, QuestionCommand, WordCommand, WordsCommand
|
||||||
from quadnite_bot.commands.response import ResponseCommands
|
from quadnite_bot.commands.response import ResponseCommands
|
||||||
|
|
||||||
@@ -15,3 +16,4 @@ dispatcher.add_command(WordCommand())
|
|||||||
dispatcher.add_command(WordsCommand())
|
dispatcher.add_command(WordsCommand())
|
||||||
dispatcher.add_command(CoinCommand())
|
dispatcher.add_command(CoinCommand())
|
||||||
dispatcher.add_command(ResponseCommands())
|
dispatcher.add_command(ResponseCommands())
|
||||||
|
dispatcher.add_command(HelpCommand())
|
||||||
|
|||||||
17
src/quadnite_bot/commands/help.py
Normal file
17
src/quadnite_bot/commands/help.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from deltachat2 import NewMsgEvent
|
||||||
|
from quadnite_bot.command import Command, Context
|
||||||
|
|
||||||
|
|
||||||
|
class HelpCommand(Command):
|
||||||
|
command = "help"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.responses = []
|
||||||
|
for file in sorted((Path(__file__).resolve().parent.parent / "static/help").iterdir()):
|
||||||
|
with open(file) as f:
|
||||||
|
self.responses.append(f.read())
|
||||||
|
|
||||||
|
def process_event(self, ctx: Context, event: NewMsgEvent) -> None:
|
||||||
|
for response in self.responses:
|
||||||
|
ctx.reply(response)
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<b>Random</b>
|
|
||||||
|
|
||||||
coin - Tosses a coin
|
|
||||||
wiki - Search Wikipedia
|
|
||||||
arch_wiki - Search the Arch wiki
|
|
||||||
kys - Kill yourself
|
|
||||||
insult - As expected, insults
|
|
||||||
|
|
||||||
<b>Wordplay</b>
|
|
||||||
|
|
||||||
question - Get a random question
|
|
||||||
word - Get a random word
|
|
||||||
words - Get n random words
|
|
||||||
weebify - Weebifies the given text
|
|
||||||
absurdify - mAke tExT aBSUrd
|
|
||||||
expand - Expands a given abbreviation
|
|
||||||
|
|
||||||
<b>Ask a question</b>
|
|
||||||
<code>
|
|
||||||
is are can
|
|
||||||
will did shall
|
|
||||||
was do does
|
|
||||||
should
|
|
||||||
</code>
|
|
||||||
<b>Roleplay</b>
|
|
||||||
<code>
|
|
||||||
angry bite
|
|
||||||
blush bored
|
|
||||||
bonk boop
|
|
||||||
chase cheer
|
|
||||||
cringe cry
|
|
||||||
cuddle dab
|
|
||||||
dance die
|
|
||||||
eat facepalm
|
|
||||||
feed glomp
|
|
||||||
happy hate
|
|
||||||
holdhands hide
|
|
||||||
highfive hug
|
|
||||||
kill kiss
|
|
||||||
laugh lick
|
|
||||||
love lurk
|
|
||||||
nervous no
|
|
||||||
nom nuzzle
|
|
||||||
panic pat
|
|
||||||
peck poke
|
|
||||||
pout run
|
|
||||||
shoot shrug
|
|
||||||
sip slap
|
|
||||||
sleep snuggle
|
|
||||||
stab tease
|
|
||||||
think thumbsup
|
|
||||||
tickle triggered
|
|
||||||
twerk wag
|
|
||||||
wave wink
|
|
||||||
yes
|
|
||||||
</code>
|
|
||||||
<b>Miscellaneous</b>
|
|
||||||
|
|
||||||
help - Need help? Go here
|
|
||||||
feedback - Send feedback, suggestions for kys, insult text
|
|
||||||
rate - Rate me on TGDR
|
|
||||||
|
|
||||||
<b>Dice</b>
|
|
||||||
|
|
||||||
<code>[num]d[sides] [modifier]</code>
|
|
||||||
|
|
||||||
<i>num</i> is the number of the dices to roll. (Optional)
|
|
||||||
<i>sides</i> is the number of sides of the dice. (Required)
|
|
||||||
<i>modifier</i> is in the form of + or - followed by a number. (Optional)
|
|
||||||
|
|
||||||
<i>Examples</i>: 1d6, 2d10 + 5, 3d20 - 2, 2d20
|
|
||||||
5
src/quadnite_bot/static/help/10_random.txt
Normal file
5
src/quadnite_bot/static/help/10_random.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Random
|
||||||
|
|
||||||
|
/coin - Tosses a coin
|
||||||
|
/wiki [search term] - Search Wikipedia
|
||||||
|
/arch_wiki [search term] - Search the Arch wiki
|
||||||
8
src/quadnite_bot/static/help/20_wordplay.txt
Normal file
8
src/quadnite_bot/static/help/20_wordplay.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Wordplay
|
||||||
|
|
||||||
|
/question - Get a random question
|
||||||
|
/word - Get a random word
|
||||||
|
/words [n] - Get n random words
|
||||||
|
/weebify [text] - Weebifies the given text
|
||||||
|
/absurdify [text] - mAke tExT aBSUrd
|
||||||
|
/expand [word] - Expands a given abbreviation
|
||||||
8
src/quadnite_bot/static/help/30_question.txt
Normal file
8
src/quadnite_bot/static/help/30_question.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Ask a question
|
||||||
|
|
||||||
|
/<command> [question]
|
||||||
|
|
||||||
|
/is /are /can
|
||||||
|
/will /did /shall
|
||||||
|
/was /do /does
|
||||||
|
/should
|
||||||
42
src/quadnite_bot/static/help/40_roleplay.txt
Normal file
42
src/quadnite_bot/static/help/40_roleplay.txt
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
Roleplay
|
||||||
|
|
||||||
|
/<command> [@user1] [@user2] ... [@userN] [message]
|
||||||
|
|
||||||
|
(All arguments to the commands are optional)
|
||||||
|
|
||||||
|
/angry /bite
|
||||||
|
/blush /bored
|
||||||
|
/bonk /boop
|
||||||
|
/chase /cheer
|
||||||
|
/cringe /cry
|
||||||
|
/cuddle /dab
|
||||||
|
/dance /die
|
||||||
|
/eat /facepalm
|
||||||
|
/feed /glomp
|
||||||
|
/happy /hate
|
||||||
|
/holdhands /hide
|
||||||
|
/highfive /hug
|
||||||
|
/kill /kiss
|
||||||
|
/laugh /lick
|
||||||
|
/love /lurk
|
||||||
|
/nervous /no
|
||||||
|
/nom /nuzzle
|
||||||
|
/panic /pat
|
||||||
|
/peck /poke
|
||||||
|
/pout /run
|
||||||
|
/shoot /shrug
|
||||||
|
/sip /slap
|
||||||
|
/sleep /snuggle
|
||||||
|
/stab /tease
|
||||||
|
/think /thumbsup
|
||||||
|
/tickle /triggered
|
||||||
|
/twerk /wag
|
||||||
|
/wave /wink
|
||||||
|
/yes
|
||||||
|
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
/hug @foobar
|
||||||
|
/slap making me angry
|
||||||
|
/holdhands @baz biz
|
||||||
16
src/quadnite_bot/static/help/50_dice.txt
Normal file
16
src/quadnite_bot/static/help/50_dice.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Dice
|
||||||
|
|
||||||
|
[num]d[sides] [keep modifier] [modifier]
|
||||||
|
|
||||||
|
num is the number of the dices to roll. (Optional)
|
||||||
|
sides is the number of sides of the dice. (Required)
|
||||||
|
keep_modifier is in the form of kh or kl followed by a number. This only keeps either the highest or lowest dice. (Optional)
|
||||||
|
modifier is in the form of +, -, >, <, >= or <= followed by a number. In case of + or -, the number is added or subtracted to the total. In case of >, <, >= or <=, the dice roll is checked against the condition and counted as a success if it matches it.(Optional)
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
1d6
|
||||||
|
2d10 + 5
|
||||||
|
3d20 kh2 - 2
|
||||||
|
2d20 kl 2
|
||||||
|
10d6 >= 6
|
||||||
|
6d20 < 10
|
||||||
Reference in New Issue
Block a user