-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add QOTD command. Add boop response per beep
- Loading branch information
Showing
10 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.envrc | ||
.idea |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .beep import BeepCommand | ||
from .qotd import QotdCommand | ||
|
||
__all__ = ["BeepCommand"] | ||
__all__ = ["BeepCommand", "QotdCommand"] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from selenium.webdriver.chrome.options import Options | ||
from signalbot import Command, Context | ||
from bs4 import BeautifulSoup | ||
import requests | ||
from selenium import webdriver | ||
|
||
class QotdCommand(Command): | ||
def describe(self) -> str: | ||
return "🏓 Beep Command: Listen for a beep" | ||
|
||
async def handle(self, c: Context): | ||
command = c.message.text | ||
|
||
if command == "qotd": | ||
print("command qotd triggered") | ||
await c.react('🤖') | ||
options = Options() | ||
options.headless = True | ||
driver = webdriver.Chrome(options=options) | ||
driver.get('https://randomwordgenerator.com/question.php') | ||
html = driver.page_source | ||
soup = BeautifulSoup(html, 'html.parser') | ||
s = soup.find('ol', id='result') | ||
qotd = s.find('span', class_='support-sentence') | ||
await c.send(f"❓QOTD: {qotd.text}") | ||
driver.quit() | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: asterdroid | ||
labels: | ||
app: asterdroid | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: asterdroid | ||
template: | ||
metadata: | ||
labels: | ||
app: asterdroid | ||
spec: | ||
containers: | ||
- name: signal-cli | ||
image: bbernhard/signal-cli-rest-api | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: MODE | ||
value: "json-rpc" |