Adding the wolfram api key as an env var
This commit is contained in:
parent
f1bce6bda5
commit
d088b55bf1
28
app/.syncthing.questions.py.tmp
Normal file
28
app/.syncthing.questions.py.tmp
Normal file
@ -0,0 +1,28 @@
|
||||
import os
|
||||
import wikipedia
|
||||
import wolframalpha
|
||||
|
||||
import help_methods
|
||||
|
||||
|
||||
def answer_question(message):
|
||||
"""
|
||||
answer_question(question)
|
||||
|
||||
Submits a request to the wolfram API and returns the response
|
||||
If no answer is found, tries wikipedia. If that fails, apologizes
|
||||
"""
|
||||
|
||||
if len(message.split()) > 1:
|
||||
client = wolframalpha.Client(os.getenv("wolfram_token"))
|
||||
question = " ".join(message.split()[1:])
|
||||
try:
|
||||
res = client.query(question)
|
||||
return next(res.results).text
|
||||
except Exception:
|
||||
try:
|
||||
return wikipedia.summary(question, sentences=5)
|
||||
except Exception:
|
||||
return "Sorry, I'm unable to answer that"
|
||||
|
||||
return help_methods.get_help_message("message")
|
@ -591,7 +591,6 @@ async def tts(ctx):
|
||||
|
||||
@bot.command(name="issue")
|
||||
async def issue(ctx):
|
||||
|
||||
import gitlab
|
||||
|
||||
await ctx.send(gitlab.parse_message(ctx.message))
|
||||
|
@ -1,3 +1,4 @@
|
||||
import os
|
||||
import wikipedia
|
||||
import wolframalpha
|
||||
|
||||
@ -13,7 +14,7 @@ def answer_question(message):
|
||||
"""
|
||||
|
||||
if len(message.split()) > 1:
|
||||
client = wolframalpha.Client("2LU2Y7-YJQTA7TL8E")
|
||||
client = wolframalpha.Client(os.getenv("wolfram_token"))
|
||||
question = " ".join(message.split()[1:])
|
||||
try:
|
||||
res = client.query(question)
|
||||
|
95
helm/.syncthing.values.yaml.tmp
Normal file
95
helm/.syncthing.values.yaml.tmp
Normal file
@ -0,0 +1,95 @@
|
||||
# Default values for dragon-bot.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: ldooks/dragon-bot
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "122"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: false
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
volumes:
|
||||
name: dale-pics
|
||||
type: nfs
|
||||
server: 192.168.1.119
|
||||
path: /volume1/nas/docker_storage/default-syncthing-claim-pvc-24ed3294-4330-466f-bc4b-70b1fe192d5f/syncthing-configs/Dropbox Mirror/Photos/dale
|
||||
mountPath: /tmp/dale
|
||||
|
||||
env:
|
||||
token: discord_token
|
||||
ffxiv_token: ffxiv_token
|
||||
gitlab_token: gitlab_token
|
||||
wolfram_token: wolfram_token
|
@ -8,7 +8,7 @@ image:
|
||||
repository: ldooks/dragon-bot
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "121"
|
||||
tag: "122"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
@ -92,3 +92,4 @@ env:
|
||||
token: discord_token
|
||||
ffxiv_token: ffxiv_token
|
||||
gitlab_token: gitlab_token
|
||||
wolfram_token: wolfram_token
|
||||
|
Loading…
x
Reference in New Issue
Block a user