小编PLA*_*ken的帖子

Gremlin 更新现有属性

如何使用 Gremlin 更新图中节点的现有属性?

以下方法创建两个具有 2 个不同值的属性“timestamp”,而不是更新现有属性“timestamp”:

ContentGraph.g.addV('Filter').property('timestamp', new Date());
ContentGraph.g.V().hasLabel('Filter').property('timestamp', new Date());
Run Code Online (Sandbox Code Playgroud)

properties gremlin

12
推荐指数
1
解决办法
2818
查看次数

Discord Oauth2 加入公会

const guildMembersResponse = fetch(`http://discordapp.com/api/guilds/440494010595803136/members/278628366213709824`,
            {
              method: 'PUT',
              headers: {
                Authorization: `Bearer TOKEN`,
              },
            });
            setTimeout(() => {
                console.log(guildMembersResponse)
            }, 500);
Run Code Online (Sandbox Code Playgroud)

我想使用他的用户 ID 和他在 nodejs 中的令牌将用户加入我的 Discord 服务器,但是如果我请求 Dicord api,我会收到一个错误:

Promise {
 Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: { body: [PassThrough], disturbed: false, error: 
  null },
  [Symbol(Response internals)]:
  { url:
  'https://discordapp.com/api/guilds/440494010595803136/members/278628366213709824',
   status: 401,
   statusText: 'UNAUTHORIZED',
   headers: [Headers] } } }
Run Code Online (Sandbox Code Playgroud)

我正在使用node-fetch库!

node.js oauth-2.0 express discord node-fetch

5
推荐指数
1
解决办法
7587
查看次数

如何在kubernetes中创建秘密文件

我有 yaml,我用它来使用下面的命令创建一个秘密。

kubectl create secret generic -n <NAMESPACE> gitlab-openid-connect --from-file=provider=provider.yaml
Run Code Online (Sandbox Code Playgroud)

下边是Provider.yaml

name: 'openid_connect'
label: 'OpenID SSO Login'
args:
  name: 'openid_connect'
  scope: ['openid','profile','email']
  response_type: 'code'
  issuer: 'https://keycloak.example.com/auth/realms/myrealm'
  discovery: true
  client_auth_method: 'basic'
  client_options:
    identifier: 'gitlab.example.com-oidc'
    secret: '<keycloak clientID secret>'
    redirect_uri: 'https://gitlab.example.com/users/auth/openid_connect/callback'
Run Code Online (Sandbox Code Playgroud)

我想将其转换为 Secret yaml 文件,以便我可以运行kubectl apply -f provider.yaml

我尝试创建以下文件但它不起作用,provider-new.yaml

apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: 'openid_connect'
  label: 'OpenID SSO Login'
data:
  scope: ['openid','profile','email']
  response_type: 'code'
  issuer: 'url'
  discovery: true
  client_auth_method: 'basic'
  client_options:
    identifier: 'identifier'
    secret: 'secret-key' …
Run Code Online (Sandbox Code Playgroud)

yaml kubernetes kubernetes-secrets

3
推荐指数
1
解决办法
6038
查看次数

从播放到观看的 Discord Bot“状态”?

我希望将我的不和谐机器人状态从“播放”更改为“观看”或任何其他选项,但不知道在哪里声明,有人可以帮助我吗?这是我当前状态的代码行:

client.user.setActivity(`${client.users.size} in here buying the dip on AAPL`);
});
Run Code Online (Sandbox Code Playgroud)

javascript bots node.js discord discord.js

1
推荐指数
1
解决办法
3万
查看次数

guilds.verificationLevel 无法正确执行自定义输出

当我尝试在 Discord.JS 中增强我的 aboutserver 命令时,我意识到你可以自定义输出,比如如果输出是 1,你可以让它说别的东西而不是 1,比如验证级别低。我为我的explicitContentFilter 和我的命令的verificationLevel 部分做了这个,他们设法获取了自定义消息,但只获取了代码每个部分的最后一个。当我调整调节或 eCF 时,自定义消息在运行命令时保持不变。

我试过backticks从代码中删除, (if (serv.explicitContentFilter = `1`) => (`if (serv.explicitContentFilter = 1) 但是没有做任何改变。我尝试?Number:1像这样在末尾添加: if (serv.explicitContentFilter?Question:1){ 并且代码不起作用,它一直卡住,我什至尝试调整代码的位置,我尝试else在最后删除部分代码。未进行更改。

async run(message, args){
    if (message.channel instanceof discord.DMChannel) return message.channel.send('This command cannot be executed here.')
    else
    var serv = message.guild

    if (serv.explicitContentFilter = `0`) {
        var eFC = "Don't Scan Any messages";
    } else {
        var eFC = serv.explicitContentFilter;
    }
    if (serv.explicitContentFilter = `1`) {
        var eFC = "Scan …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord.js

0
推荐指数
1
解决办法
553
查看次数