fix: unecessary scope block
@@ -118,11 +118,9 @@ void on_channel_start_thread(
struct discord_channel *channel = discord_channel_alloc();
char text[MAX_MESSAGE_LEN];
- {
ORCAcode code;
- char *name = "new_thread";
if (msg->message_reference->message_id) {
- struct discord_start_thread_with_message_params params = { .name = name };
+ struct discord_start_thread_with_message_params params = { .name = "new_thread" };
code = discord_start_thread_with_message(
client,
msg->channel_id,
@@ -131,7 +129,7 @@ void on_channel_start_thread(
channel);
}
else {
- struct discord_start_thread_without_message_params params = { .name = name };
+ struct discord_start_thread_without_message_params params = { .name = "new_thread" };
code = discord_start_thread_without_message(
client,
msg->channel_id,
@@ -143,7 +141,6 @@ void on_channel_start_thread(
sprintf(text, "Created thread-channel <#%"PRIu64">", channel->id);
else
sprintf(text, "Couldn't create channel.");
- }
struct discord_create_message_params params = { .content = text };
discord_create_message(client, msg->channel_id, &params, NULL);
