Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DickieBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ async def on_message(message):
db.updateLastFact(message.guild.id, id, message.channel.id)
db.updateLastCalled(id)

# Replace $1item variables with the same random inventory item
itemCount = msgOut.count("$1item") if msgOut is not None else 0
if itemCount > 0:
randItem = db.getInventoryItem(message.guild.id)
msgOut = msgOut.replace("$1item", randItem)

# Replace $item variables each with random inventory item
itemCount = msgOut.count("$item") if msgOut is not None else 0
for i in range(itemCount):
Expand Down
3 changes: 2 additions & 1 deletion cogs/factoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ async def nsfw(self, ctx, id: typing.Optional[int] = 0):
Using !onnsfw marks the response as NSFW and will not be triggered in SFW channels.
Use $self to refer to the bot in the trigger. i.e. !on "Hi $self" -say Hello.
Use $rand, $nick, and $item in response to sub in a random user, the triggering user, and an inventory item, respectively.
$item consumes the inventory item.
Use $1item to reference the same inventory item every instance.
$item and $1item consume the inventory item.
Using -react will expect a single emoji as the response arg. All reactions are SFW.""",
brief="Teach me to respond to something",
)
Expand Down