Comments (5)
The first task of randomly picking an answer can be realized with using (readfilerandom …)
and having a text file with all possible answers.
The second one isn't as trivial. But could probably be solved with regexps indeed.
from phantombot.
^((?!@\w+).)*your keyword((?!@\w+).)*$
here is a draft for ignoring messages with mentions. Considerations: 1) it might fail if there are user accounts with any other symbols but a-z, A-Z, _, or -. 2) If you have characters in your keyword that have a meaning in regexps, you need to escape them.
I recommend regex101.com for developing, analyzing, and testing of regexps.
from phantombot.
The first task of randomly picking an answer can be realized with using (readfilerandom …) and having a text file with all possible answers.
It'd be nice if there were an easy way for mods to set up commands like this, without access to the bot's filesystem.
from phantombot.
I agree. I see two ways:
- Try to work around with a command using
(writefile …)
- In the long run it would be nice to have a command variable like
(eval …)
that actually executes javascript. I've talked about this with some people on Discord and I'm not sure a PR like that would be accepted. Besides the fact that it could be a pain to implement without opening a bunch of security holes.
from phantombot.
Other possibilities:
- Add a tag handler to pick from a set of strings, and include all the options as part of the command response:
!addcom !hackername Your hacker name is (pickrandom Trinity|Darkweb|Neo) (pickrandom Bladerunner|Gattaca|Anonymous)
- Add an editable "quip system", with commands to create/delete named sets of quips or add/remove/edit individual quips in a set, and a tag handler to pick quips from a set:
!addquipset hackerfirst Trinity|Darkweb|Neo
!addquipset hackerlast Bladerunner|Gattaca
!addquip hackerlast Anonymous
!addcom !hackername Your hacker name is (randomquip hackerfirst) (randomquip hackerlast).
from phantombot.
Related Issues (20)
- java.lang.NullPointerException: Cannot invoke "com.gmt2001.twitch.cache.Viewer.id()" because the return value of "com.gmt2001.twitch.cache.ViewerCache.broadcaster()" is null
- java.lang.NullPointerException: Cannot invoke "com.gmt2001.twitch.cache.Viewer.id()" because the return value of "com.gmt2001.twitch.cache.ViewerCache.getByLogin(String)" is null
- java.lang.NullPointerException: Exception parsing getChattersAsync
- java.lang.NullPointerException: Cannot invoke "tv.phantombot.PhantomBot.getAuthFlow()" because the return value of "tv.phantombot.PhantomBot.instance()" is null
- java.lang.NullPointerException: Cannot invoke "discord4j.core.GatewayDiscordClient.logout()" because "tv.phantombot.discord.DiscordAPI.gateway" is null
- java.lang.NullPointerException: Cannot invoke "java.util.concurrent.Future.cancel(boolean)" because "this.future" is null
- User Greetings module toggle switcher in Panel work incorrect
- Add the ability to use commands in User Greetings messages HOT 1
- upgrade from 3.9.0.6 to 3.10.0.10 database fails upgrade so no logins. HOT 4
- Discord alerts mention incompatibility
- Error Message if a new panel user creates oder edits timers
- Docker version hangs on update while starting HOT 3
- Multiple channels HOT 2
- Giveaway not clearing past participants
- Update DurationString Reference
- Random command too kinky. PG13 filter doesn't seem to work
- Quote mode format toggle regression HOT 3
- Phantombot uses different database as configured in some cases HOT 1
- Forwarding Twitch chat to a Discord channel HOT 3
- !shoutoutapitoggle not functioning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phantombot.