v3.4.1 #27
@ -15,7 +15,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Pull latest from Git
|
- name: Pull latest from Git
|
||||||
run: |
|
run: |
|
||||||
echo "Branch: tags/${{ gitea.ref_name }}"
|
echo "Branch: ${{ gitea.ref_name }}"
|
||||||
pwd
|
pwd
|
||||||
whoami
|
whoami
|
||||||
mkdir -p /var/lib/act_runner/
|
mkdir -p /var/lib/act_runner/
|
||||||
@ -24,10 +24,12 @@ jobs:
|
|||||||
git clone https://git.vfsh.dev/voidf1sh/nodbot
|
git clone https://git.vfsh.dev/voidf1sh/nodbot
|
||||||
cd nodbot
|
cd nodbot
|
||||||
else
|
else
|
||||||
|
rm -rf nodbot
|
||||||
|
git clone https://git.vfsh.dev/voidf1sh/nodbot
|
||||||
cd nodbot
|
cd nodbot
|
||||||
git pull
|
git pull
|
||||||
fi
|
fi
|
||||||
git checkout tags/${{ gitea.ref_name }}
|
git checkout ${{ gitea.ref_name }}
|
||||||
- name: Build the Docker image
|
- name: Build the Docker image
|
||||||
run: |
|
run: |
|
||||||
cd /var/lib/act_runner/nodbot
|
cd /var/lib/act_runner/nodbot
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
## v3.4.x
|
## v3.4.x
|
||||||
|
#### v3.4.1
|
||||||
|
* Adding command to change nicknames
|
||||||
|
|
||||||
#### v3.4.0 (#25)
|
#### v3.4.0 (#25)
|
||||||
* Added nested commands, enclose a command in brackets, braces, or parenthesis inside a longer message: `You really don't get it do you? [that's the joke.gif] You're so dense` would return the results for just `that's the joke.gif`
|
* Added nested commands, enclose a command in brackets, braces, or parenthesis inside a longer message: `You really don't get it do you? [that's the joke.gif] You're so dense` would return the results for just `that's the joke.gif`
|
||||||
* Improved the `/save gifsearch` interface and the code behind the scenes
|
* Improved the `/save gifsearch` interface and the code behind the scenes
|
||||||
|
@ -662,6 +662,15 @@ const functions = {
|
|||||||
|
|
||||||
return newText + ' <:spongebob:1053398825965985822>';
|
return newText + ' <:spongebob:1053398825965985822>';
|
||||||
},
|
},
|
||||||
|
setNick(user, nickname) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
user.setNickname(nickname).then(() => {
|
||||||
|
resolve('Nickname set.');
|
||||||
|
}).catch(err => {
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
autoresponses: { // Specific responses for certain keywords in sent messages
|
autoresponses: { // Specific responses for certain keywords in sent messages
|
||||||
checkForAll(messageContent) {
|
checkForAll(messageContent) {
|
||||||
let responses = [];
|
let responses = [];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodbot",
|
"name": "nodbot",
|
||||||
"version": "3.4.0",
|
"version": "3.4.1",
|
||||||
"description": "Nods and Nod Accessories",
|
"description": "Nods and Nod Accessories",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
42
slash-commands/setnick.js
Normal file
42
slash-commands/setnick.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
|
const fn = require('../functions.js');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName('setnick')
|
||||||
|
.setDescription('Set a user\'s nickname.')
|
||||||
|
.addUserOption(o =>
|
||||||
|
o.setName('user')
|
||||||
|
.setDescription('The user to set the nickname for.')
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
.addStringOption(o =>
|
||||||
|
o.setName('nickname')
|
||||||
|
.setDescription('The nickname to set.')
|
||||||
|
.setRequired(true)
|
||||||
|
),
|
||||||
|
async execute(interaction) {
|
||||||
|
try {
|
||||||
|
// Defer the reply, with ephemeral set to true
|
||||||
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
// Get the user and nickname from the interaction
|
||||||
|
const user = interaction.options.getMember('user');
|
||||||
|
const nickname = interaction.options.getString('nickname');
|
||||||
|
|
||||||
|
// Set the nickname
|
||||||
|
await fn.setNick(user, nickname);
|
||||||
|
|
||||||
|
// Reply to the interaction
|
||||||
|
await interaction.editReply(`Successfully set ${user}'s nickname to ${nickname}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
if (error.code === 50013) {
|
||||||
|
return await interaction.editReply('I do not have permission to set the nickname of that user!');
|
||||||
|
}
|
||||||
|
if (error.code === 50035) {
|
||||||
|
return await interaction.editReply('The nickname is too long!');
|
||||||
|
}
|
||||||
|
await interaction.editReply('There was an error while executing this command!');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user