Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: V4.0 new endpoints and more #276

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
687873a
Feat: V4.0 Application emoji endpoints.
Droid00000 Sep 18, 2024
a51886a
Add contexts field to application commands, deprecate default_permiss…
Droid00000 Sep 18, 2024
4655ed1
Add NSFW fields to application commands.
Droid00000 Sep 18, 2024
2a2d757
Update documentation for application commands.
Droid00000 Sep 18, 2024
d5df1cf
Add get-guild-role endpoint.
Droid00000 Sep 18, 2024
3277b75
Add guild onboarding endpoints, and add modifiy-guild-mfa-level endpo…
Droid00000 Sep 18, 2024
87dfd15
Relocate guild voice endpoints to VoiceEndpoints to be more consisten…
Droid00000 Sep 18, 2024
19251e8
Feat: V4.0 Auto-Moderation endpoints.
Droid00000 Sep 18, 2024
a8cf76e
Feat: V4.0 Guild scheduled event endpoints.
Droid00000 Sep 19, 2024
bef56fa
Add new user endpoints.
Droid00000 Sep 19, 2024
83c5c53
Feat: V4.0 Localization for application commands.
Droid00000 Sep 19, 2024
1f68f8e
Feat: V4.0 Poll endpoints.
Droid00000 Sep 19, 2024
afe3c19
Feat: V4.0 entitlement endpoints.
Droid00000 Sep 21, 2024
226714a
Feat: V4.0 SKU endpoints.
Droid00000 Sep 21, 2024
eb9da57
Feat: V4.0 add new fields to message create endpoint.
Droid00000 Sep 21, 2024
e67d205
Feat: V4.0 Followup message endpoints.
Droid00000 Sep 22, 2024
bd1f8f3
Update project dependencies.
Droid00000 Sep 22, 2024
5837747
Cleanup.
Droid00000 Sep 22, 2024
cab1450
Feat: V4.0 Add documentation, excluding channels, guilds, webhooks, a…
Droid00000 Sep 29, 2024
10c1d1f
Feat: V4.0 add documentation for channel endpoints.
Droid00000 Sep 29, 2024
9b9d7d5
Bring development dependencies and workflows up-to-date with master.
Droid00000 Sep 29, 2024
66c3d81
Update examples.
Droid00000 Sep 29, 2024
a75bbbf
Feat: V4.0 add documentation for guild endpoints.
Droid00000 Oct 2, 2024
8aeee1e
Fix push conflict.
Droid00000 Oct 2, 2024
1d19183
Feat: V4.0 complete application command docs.
Droid00000 Oct 2, 2024
c39e718
Feat: V4.0 re-purpose old API file into CDN file.
Droid00000 Oct 2, 2024
77bea9f
Feat: V4.0 fix inconsistent doc formatting.
Droid00000 Oct 2, 2024
a3d6452
feat: v4.0 add interaction documentation.
Droid00000 Oct 3, 2024
0465c9b
feat: V4.0 fix invalid yard types
Droid00000 Oct 3, 2024
82a87fc
feat: V4.0 new gateway intents
Droid00000 Oct 4, 2024
a0e5ff8
feat: V4.0 add message content intent
Droid00000 Oct 4, 2024
b0d7c8b
feat: V4.0 deprecate oauth2 endpoint.
Droid00000 Oct 4, 2024
94e089a
feat: V4.0 add soundboard endpoints
Droid00000 Oct 4, 2024
fdb3dad
rubocop
Droid00000 Oct 4, 2024
4f1f2a8
port: V3.5.0 unique and global usernames.
Droid00000 Oct 4, 2024
0e181d4
port: V3.5.0 new user data
Droid00000 Oct 4, 2024
ee46840
port: V3.5.0 update webhooks URL
Droid00000 Oct 4, 2024
b33f19d
feat: V4.0 add application command localization support
Droid00000 Oct 4, 2024
ed56783
feat: V4.0 update Faraday gem
Droid00000 Oct 6, 2024
78b9caa
port: V3.5.0 port the vast majority of changes from master to the 4.0…
Droid00000 Oct 9, 2024
4d4daa9
Push remaining changes.
Droid00000 Oct 9, 2024
38250ed
feat: V4.0 deprecate user login type.
Droid00000 Oct 9, 2024
a47a152
Cleanup and rubocop.
Droid00000 Oct 9, 2024
91cecf9
Fix dependency error.
Droid00000 Oct 9, 2024
0c7b509
Fix sodium load error.
Droid00000 Oct 9, 2024
6c5d618
Fix yard docs.
Droid00000 Oct 9, 2024
9358003
Appease da rubocop
Droid00000 Oct 9, 2024
98d2cdd
Add nonce fields.
Droid00000 Oct 9, 2024
0966039
Fix misdefined variable.
Droid00000 Oct 9, 2024
bb07dae
Fix yard tag
Droid00000 Oct 9, 2024
4e5e327
Update webhooks version.
Droid00000 Oct 10, 2024
a96f9b2
Fix delagate class warning and remove type param from commandbot.
Droid00000 Oct 10, 2024
461a73b
Fix rubocop
Droid00000 Oct 10, 2024
420b14d
Potential fix for slash commands breaking?
Droid00000 Oct 10, 2024
e5ce2ce
Minor fix.
Droid00000 Oct 10, 2024
02b9ca9
Update new hash method name.
Droid00000 Oct 10, 2024
b78c5b5
Remove unneeded type parameter
Droid00000 Oct 10, 2024
f433ebf
Bump Faraday version to silence console warnings.
Droid00000 Oct 10, 2024
89dd934
Update webhooks gemspec
Droid00000 Oct 11, 2024
333d2f2
Try to fix undefined method resolve_id for an instance of string
Droid00000 Oct 11, 2024
3b9bac0
Undo previous commit
Droid00000 Oct 11, 2024
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
50 changes: 32 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ commands:
steps:
- run:
name: Install OS packages
command: apk add git build-base ruby-dev ruby-etc ruby-json libsodium
command: apk add git build-base ruby-dev ruby-etc ruby-json libsodium-dev
- checkout
- run:
name: "Ruby version"
Expand All @@ -27,45 +27,50 @@ commands:
- ./vendor/bundle

jobs:
test_ruby_26:
test_ruby_31:
docker:
- image: ruby:2.6-alpine
- image: ruby:3.1-alpine
steps:
- setup-env
- run:
name: Run RSpec
command: bundle exec rspec
command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
- store_test_results:
path: ~/rspec

test_ruby_27:
test_ruby_32:
docker:
- image: ruby:2.7-alpine
- image: ruby:3.2-alpine
steps:
- setup-env
- run:
name: Run RSpec
command: bundle exec rspec
command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
- store_test_results:
path: ~/rspec

test_ruby_30:

test_ruby_33:
docker:
- image: ruby:3.0-alpine
- image: ruby:3.3-alpine
steps:
- setup-env
- run:
name: Run RSpec
command: bundle exec rspec
command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml

rubocop:
docker:
- image: ruby:2.6-alpine
- image: ruby:3.3-alpine
steps:
- setup-env
- run:
name: Run Rubocop
command: bundle exec rubocop -P
command: bundle exec rubocop

yard:
docker:
- image: ruby:2.6-alpine
- image: ruby:3.3-alpine
steps:
- setup-env
- attach_workspace:
Expand All @@ -79,13 +84,22 @@ jobs:
- docs

pages:
machine: true
docker:
- image: alpine
steps:
- run:
name: Install OS packages
command: apk add git openssh-client-default
- attach_workspace:
at: /tmp/workspace
- run:
name: Clone docs
command: git clone $CIRCLE_REPOSITORY_URL -b gh-pages .
command: |
mkdir -p ~/.ssh

echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >> ~/.ssh/known_hosts

git clone $CIRCLE_REPOSITORY_URL -b gh-pages .
- add_ssh_keys:
fingerprints:
- "9a:4c:50:94:23:46:81:74:41:97:87:04:4e:59:4b:4e"
Expand All @@ -111,9 +125,9 @@ jobs:
workflows:
test:
jobs:
- test_ruby_26
- test_ruby_27
- test_ruby_30
- test_ruby_31
- test_ruby_32
- test_ruby_33
- rubocop
- yard
deploy:
Expand Down
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Which Ruby version to use. You may need to use a more restrictive version,
# e.g. `3.0`
ARG VARIANT=3.3

# Pull Microsoft's ruby devcontainer base image
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}

# Install libsodium dependency for voice channel interactions
RUN apt update -yq && apt install -y libsodium-dev

# Ensure we're running the latest bundler, as what ships with the Ruby image may
# not be current, and bundler will auto-downgrade to match the Gemfile.lock
RUN gem install bundler
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Ruby",
"build": {
"dockerfile": "Dockerfile"
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"shopify.ruby-lsp"
]
}
},

// Set the environment variables
// "runArgs": ["--env-file",".env"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash .devcontainer/postcreate.sh",

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
4 changes: 4 additions & 0 deletions .devcontainer/postcreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

bundle config set path vendor/bundle
bundle install --jobs=1
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Report a bug to help us improve the library

---

# Summary
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature Request
about: Request a new feature, or change an existing one

---

<!---
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "CodeQL"

on:
push:
branches: [ 'main' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ 'main' ]
schedule:
- cron: '29 6 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'ruby' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD024": { "siblings_only": true }
}
53 changes: 50 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inherit_mode:

AllCops:
NewCops: enable
TargetRubyVersion: 2.6
TargetRubyVersion: 3.3

# Disable line length checks
Layout/LineLength:
Expand Down Expand Up @@ -67,5 +67,52 @@ Style/SingleLineBlockParams:
- reduce: [m, e]
- inject: [m, e]

Layout/EndOfLine:
EnforcedStyle: lf
###################################
## NEW COPS TO MAKE DECISIONS ON ##
###################################

# TODO: Decide how you want to handle this:
# https://rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashSyntax
Style/HashSyntax:
EnforcedShorthandSyntax: either

Style/ArgumentsForwarding:
Enabled: false

Performance/StringIdentifierArgument:
Enabled: false

Style/ComparableClamp:
Enabled: false

Style/SuperArguments:
Enabled: false

Naming/BlockForwarding:
Enabled: false

Style/RedundantSelfAssignmentBranch:
Enabled: false

Performance/MapCompact:
Enabled: false

Gemspec/RequiredRubyVersion:
Enabled: false

Gemspec/DevelopmentDependencies:
Enabled: false

Style/RedundantReturn:
Enabled: false

Style/RedundantParentheses:
Enabled: false

# This will probably be a breaking change, but should happen
Style/ReturnNilInPredicateMethodDefinition:
Enabled: false

# FIXME: Disabled due to breaking tests, should probably refactor the code instead
Style/SafeNavigation:
Enabled: false
Loading