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

Add formatting to images in documentation and replace string datatype to const for guildId #14

Merged
merged 15 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@ Follow these steps to create a Discord developer account.

### Step 1: Login to Discord developer page

<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">
1. Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.

Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.
<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">

If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.
2. If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.

<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">
<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">

Complete the account creation process by including the relavant information in the given fields.
3. Complete the account creation process by including the relevant information in the given fields.

### Step 2: Make a new Discord application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">
1. Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.

Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">

### Step 3: Name the Discord Application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

1. Proceed by giving the Discord Application a name and click on the terms of service.

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

2. Finally complete the naming process by clicking on the `next` button.

### Step 4: Obtain the Client ID and Client Secret

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">
1. Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.

Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">

## Quickstart

Expand Down
22 changes: 11 additions & 11 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ Follow these steps to create a Discord developer account.

### Step 1: Login to Discord developer page

<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">
1. Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.

Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.
<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">

If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.
2. If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.

<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">
<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">

Complete the account creation process by including the relavant information in the given fields.
3. Complete the account creation process by including the relevant information in the given fields.

### Step 2: Make a new Discord application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">
1. Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.

Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">

### Step 3: Name the Discord Application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

1. Proceed by giving the Discord Application a name and click on the terms of service.

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

2. Finally complete the naming process by clicking on the `next` button.

### Step 4: Obtain the Client ID and Client Secret

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">
1. Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.

Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">

## Quickstart

Expand Down
22 changes: 11 additions & 11 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ Follow these steps to create a Discord developer account.

### Step 1: Login to Discord developer page

<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">
1. Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.

Visit [Discord developer portal](https://discord.com/login?redirect_to=%2Fdevelopers) by logging into your Discord account.
<img src="https://github.com/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/discord-dev-page.png?raw=true" alt="Discord Dev Page" style="width: 70%;">

If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.
2. If you do not have a Discord account already, [create a new discord account](https://discord.com/login) by clicking on the `Register` hyperlink below the `Log In` button when opening the Discord developer page.

<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">
<img src= "https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-acc.png?raw=true" alt="Create Discord Account" style="width: 70%;">

Complete the account creation process by including the relavant information in the given fields.
3. Complete the account creation process by including the relevant information in the given fields.

### Step 2: Make a new Discord application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">
1. Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.

Once in the Discord developer portal is open, click on the `New Application` button as displayed above to start the process.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/make-new-app.png?raw=true" alt="Make New Application" style="width: 70%;">

### Step 3: Name the Discord Application

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

1. Proceed by giving the Discord Application a name and click on the terms of service.

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/create-app.png?raw=true" alt="Name and Create the App" style="width: 70%;">

2. Finally complete the naming process by clicking on the `next` button.

### Step 4: Obtain the Client ID and Client Secret

<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">
1. Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.

Under the `OAuth2` section found on the left-sided list, locate the Client's Information as shown on the screen. To implement the functionalities provided by Discord's API, you will need the Client ID and Client Secret.
<img src="https:/ballerina-platform/module-ballerinax-discord/blob/main/docs/setup/resources/obtain-client-id.png?raw=true" alt="Obtain Client ID and Secret" style="width: 70%;">

## Quickstart

Expand Down
6 changes: 3 additions & 3 deletions examples/automated-event-reminders/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string[] scopes = ?;

string guildId = "YOUR_GUILD_ID";
const GUILD_ID = "YOUR_GUILD_ID";

# Represents a Discord Channel.
public type Channel record {
Expand Down Expand Up @@ -62,7 +62,7 @@ public function main() returns error? {
}
};

Event|error eventResponse = discord->/guilds/[guildId]/scheduled\-events.post(payload);
Event|error eventResponse = discord->/guilds/[GUILD_ID]/scheduled\-events.post(payload);
if eventResponse is error {
log:printError("Error creating the scheduled event: ", eventResponse);
return;
Expand All @@ -83,7 +83,7 @@ class EventReminderJob {
}

public function execute() {
anydata[]|error channelsResponse = discord->/guilds/[guildId]/channels();
anydata[]|error channelsResponse = discord->/guilds/[GUILD_ID]/channels();
if channelsResponse is error {
log:printError("Error getting the channels: ", channelsResponse);
return;
Expand Down
4 changes: 2 additions & 2 deletions examples/automated-role-assignment/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import ballerinax/discord;
import ballerina/http;
import ballerina/time;

const string CHANNEL_ID = "YOUR_CHANNEL_ID";
const string GUILD_ID = "YOUR_GUILD_ID";
const CHANNEL_ID = "YOUR_CHANNEL_ID";
const GUILD_ID = "YOUR_GUILD_ID";
KamalikaSene marked this conversation as resolved.
Show resolved Hide resolved

configurable string clientId = ?;
configurable string clientSecret = ?;
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.caching=true
group=io.ballerina.lib
version=0.1.0-SNAPSHOT
version=1.0.0-SNAPSHOT

checkstylePluginVersion=10.12.0
spotbugsPluginVersion=5.0.14
Expand Down
Loading